schulle877 Report post Posted February 7, 2011 Hi! I will use a link for the chart caption to enlarge the chart. By clicking the categories down below I will have a data list for the the selected category. I use PHP class. Here is my code to link the caption using styles. $linkstart = "<a href=index.php?reporttype=report&charttype=trend'>"; $linkend = "</a>"; $link = $linkstart."chart caption text".$linkend; $strParam = "caption=$link;"; ... $FC->defineStyle("CaptionLabelStyle","font","isHTML=1;Underline=0;color=0434B1;"); $FC->applyStyle("CAPTION","CaptionLabelStyle"); I do not use urlencode for the linkstart and linkend because it will produce XML-errors. For categories of a stacked column this code works fine, I used urlencode: $link = urlencode("index.php?reporttype=report"); $link = "<a href="".$link."">".$categorytext."</a>"; I tried the code for the category links also for the caption, but there is always a xml error. (when using urlencode) Plese help me resolving this. Sven Schulze Share this post Link to post Share on other sites
Guest Angie Report post Posted February 8, 2011 (edited) Hi, Could you please confirm the FusionCharts version you are using? If you are using FusionCharts version 3.2, there is no need to encode the URL. Hope this helps. Edited February 8, 2011 by Angie Share this post Link to post Share on other sites
shadey Report post Posted August 25, 2011 (edited) Hi, Could you please confirm the FusionCharts version you are using? If you are using FusionCharts version 3.2, there is no need to encode the URL. Hope this helps. Hi. Hoping you can put my mind at ease! Am I right in thinking that you cannot use the ".setDataXML" approach to rendering when with a caption? I cant avoid javascript errors when I do this. My code is as follows: <div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"> var myChart = new FusionCharts("charts/Column3D.swf", "myChartId", "900", "300", "0", "0"); myChart.setDataXML("<chart caption="<a href='http://www.fusioncharts.com'> Monthly Sales Summary </a>" xAxisName='Month' yAxisName='Sales' numberPrefix='$'><set label='January' value='17400' /><set label='February' value='19800' /><set label='March' value='21800' /><set label='April' value='23800' /><set label='May' value='29600' /><set label='June' value='27600' /><set label='July' value='31800' /><set label='August' value='39700' /><set label='September' value='37800' /><set label='October' value='21900' /><set label='November' value='32900' /><set label='December' value='39800' /><styles><definition><style name='CaptionLink' type='font' isHTML='1' /></definition><application><apply toObject='Caption' styles='CaptionLink' /></application></styles></chart>"); myChart.render("chartdiv"); </script Javascript error: Error: missing ) after argument list Source File: http://localhost/website/testasp.asp?sdfdfdfsdssssgg Line: 17, Column: 45 Source Code: myChart.setDataXML("<chart caption="<a href='http://www.fusioncharts.com'> Monthly Sales Summary </a>" xAxisName='Month' yAxisName='Sales' numberPrefix='$'><set label='January' value='17400' /><set label='February' value='19800' /><set l i.e. the error caused by double quote in the string, but there are double and single quotes in the string, so cannot change the render to myChart.setDataXML('') using single quotes. Maybe the only solution is to render it using an XML file? Thanks Edited August 25, 2011 by shadey Share this post Link to post Share on other sites
Swarnam Report post Posted August 29, 2011 Hi Shadey, Thanks for your response. Could you please try replacing the setDataXML with the following line: myChart.setDataXML("<chart caption='<a href='http://www.fusioncharts.com' > Monthly Sales Summary </a>' xAxisName='Month' yAxisName='Sales' numberPrefix='$'><set label='January' value='17400' /><set label='February' value='19800' /><set label='March' value='21800' /><set label='April' value='23800' /><set label='May' value='29600' /><set label='June' value='27600' /><set label='July' value='31800' /><set label='August' value='39700' /><set label='September' value='37800' /><set label='October' value='21900' /><set label='November' value='32900' /><set label='December' value='39800' /><styles><definition><style name='CaptionLink' type='font' isHTML='1' /></definition><application><apply toObject='Caption' styles='CaptionLink' /></application></styles></chart>"); I hope this helps. Hi. Hoping you can put my mind at ease! Am I right in thinking that you cannot use the ".setDataXML" approach to rendering when with a caption? I cant avoid javascript errors when I do this. My code is as follows: <div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"> var myChart = new FusionCharts("charts/Column3D.swf", "myChartId", "900", "300", "0", "0"); myChart.setDataXML("<chart caption="<a href='http://www.fusioncharts.com'> Monthly Sales Summary </a>" xAxisName='Month' yAxisName='Sales' numberPrefix=' ><set label='January' value='17400' /><set label='February' value='19800' /><set label='March' value='21800' /><set label='April' value='23800' /><set label='May' value='29600' /><set label='June' value='27600' /><set label='July' value='31800' /><set label='August' value='39700' /><set label='September' value='37800' /><set label='October' value='21900' /><set label='November' value='32900' /><set label='December' value='39800' /><styles><definition><style name='CaptionLink' type='font' isHTML='1' /></definition><application><apply toObject='Caption' styles='CaptionLink' /></application></styles></chart>"); myChart.render("chartdiv"); </script Javascript error: Error: missing ) after argument list Source File: http://localhost/web...sdfdfdfsdssssgg Line: 17, Column: 45 Source Code: myChart.setDataXML("<chart caption="<a href='http://www.fusioncharts.com'> Monthly Sales Summary </a>" xAxisName='Month' yAxisName='Sales' numberPrefix=' ><set label='January' value='17400' /><set label='February' value='19800' /><set l i.e. the error caused by double quote in the string, but there are double and single quotes in the string, so cannot change the render to myChart.setDataXML('') using single quotes. Maybe the only solution is to render it using an XML file? Thanks Share this post Link to post Share on other sites