Bharat Patel

The < character causes the chart to break

Recommended Posts

Hi There,

Is there is an alternate character that I can use for < symbol inside the categories label.

 

I tried < and < but it seems to be not working for the element "category" attribute "label"

 

I tried appending the <apply toObject='DATALABELS' styles='HTMLMode' /> to see if that solves the problem but still seems to be issue

 

<!-- Using ASP.NET VB FusionCharts v3.2.2.1 Wrapper and JavaScript rendering --><!-- START Script Block for Chart ctl00_cphPageBody_chartFundSizes_chart1_fusion -->
<div id='ctl00_cphPageBody_chartFundSizes_chart1_fusionDiv'>
Chart.
</div>
<script type="text/javascript">
var categorydata = "<categories> <category label='< 50' /> <category label='50 - 149' /> <category label='150 - 499' /> <category label='500 - 999' /> <category label='1,000 - 4,999' /> <category label='5,000 - 9,999' /> <category label='10,000 +' /></categories>";
var dataset = "<dataset seriesName='PercentageCount' > <set value='2.07' /> <set value='5.66' /> <set value='13.21' /> <set value='11.06' /> <set value='32.41' /> <set value='14.31' /> <set value='21.38' /></dataset>";
if (FusionCharts && FusionCharts('ctl00_cphPageBody_chartFundSizes_chart1_fusion')) FusionCharts('ctl00_cphPageBody_chartFundSizes_chart1_fusion').dispose();
var chart_ctl00_cphPageBody_chartFundSizes_chart1_fusion = new FusionCharts({ "renderer": "javascript", "dataFormat": "xml", "scaleMode": "noScale", "renderAt": "ctl00_cphPageBody_chartFundSizes_chart1_fusionDiv", "lang": "EN", "debugMode": "0", "swfUrl": "/js/FusionCharts/MSColumn2D.swf", "id": "ctl00_cphPageBody_chartFundSizes_chart1_fusion", "wMode": "opaque", "width": "100%", "height": "350px", "registerWithJS": "1", "dataSource": "<chart caption='' subCaption='' captionPadding='15' xAxisName='' yAxisName='' showValues='1' showPlotBorder='0' borderColor='DDDDDD' borderThickness='0' canvasBorderThickness='1' canvasBorderColor='DDDDDD' chartLeftMargin='10' chartRightMargin='10' chartTopMargin='10' chartBottomMargin='40' showLegend='0' legendBorderThickness='1' legendBorderColor='DDDDDD' legendShadow='0' legendAllowDrag='0' legendBgColor='FFFFFF' legendPosition='BOTTOM' interactiveLegend='0' dateFormat='yyyy-mm-dd' outputDateFormat='dd/mm/yyyy' numberScaleValue='1000,1000' numberScaleUnit='Bn,Tn' showPercentageValues='0' alternateHGridColor='FFFFFF' divLineColor='DDDDDD' vDivLineColor='DDDDDD' vDivLineThickness='1' vDivLineIsDashed='1' numVDivLines='5' numDivLines='10' divLineAlpha='0' yAxisMinValue='0' yAxisMaxValue='35' NumberPrefix='' formatNumber='1' formatNumberScale='0' sformatNumberScale='0' sNumberPrefix='' syncAxisLimits='1' rotateValues='0' showSum='0' canvasPadding='5' valuePadding='0' baseFont='Verdana' valuePosition='AUTO' paletteColors='05C218, 8FFA47, 05C276, C27605, C21805, C20551, 9A0BF9, C205AF, 7605C2, 05AFC2' plotGradientColor='' unescapeLinks='0' labelStep='0' showYAxisValues='1' yAxisValuesStep='1' showDivLineValues='1' bgColor='FEFEFE' logoURL='/images/SVG/preqin-logo.svg' logoPosition='BR' ExportWithlogo='1' ExportWithBackground='0' exportEnabled='1' exportShowMenuItem='1' exportFormats='PNG=Export as High Quality Image|JPG|PDF=Export as PDF File' exportAtClient='0' exportHandler='/user/uc/Charts/Export/FusionChartExporter.aspx?ExportWithlogo=True&logoPosition=BR&ExportWithBackground=False' exportAction='download' exportFileName='ChartImage' showExportDialog='1'>" + categorydata + dataset + "<styles> <definition> <style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' /> <style name='CaptionStyle' type='font' font='Verdana' isHTML='1' /> </definition> <application> <apply toObject='Canvas' styles='CanvasAnim' /> <apply toObject='Caption' styles='CaptionStyle' /> </application></styles></chart>" }).render()</script>
<!-- END Script Block for Chart ctl00_cphPageBody_chartFundSizes_chart1_fusion -->

 

Kind Regards,

Bharat Patel

Edited by bharatpatel

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

It seems the '<' and '>' characters are not encoded in the generated XML which is fed to the chart object for plotting.

 

Could you please try once Server.HtmlEncode() (since you are plotting graph from ASP.NET) and see if it helps?

 

For more details, please refer: http://stackoverflow.com/questions/157646/best-way-to-encode-text-data-for-xml

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi There,

Thanks for your reply. I mean to say that even if I convert < to < still  does not work. I had to replace it with word "less than" for it to work. I am already calling the server.htmlencode to take care of these issues soon after I found it on the forums.

Kind Regards,

Bharat Patel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now