Akshay S Report post Posted April 1, 2014 Hi, I'm new to FusionCharts. I can call a Javascript function and pass parameters onClick of each column(say i'm using Column2D shockwave File+XML input+Jquery render method) using following XML <graph yAxisNamePadding='20' labelPadding='10' yAxisName='AMOUNT' decimalSeparator=',' showhovercap='1' canvasborderalpha='0' canvasborder='3D86C6' showalternatehgridcolor='0' numdivlines='0' animation='1' showValues='0' showLimits='0' showYAxisValues='0' showDivLineSecondaryValue='0' numDivLines='0' outCnvBaseFontColor='3D86C6' outCnvBaseFontSize='12' bgColor='ffffff' showLegend='0' showBorder='1' borderAlpha='0' plotGradientColor='' plotBorderColor='ffffff'> <vLine color='3D86C6' thickness='2'/> <set name='MAY' value='28090.02' color='3D86C6' link='JavaScript: myJS(4,1); ' /> <set name='JUN' value='0' color='3D86C6' link='JavaScript: myJS(5,2); ' /> <set name='JUL' value='186236.7' color='3D86C6' link='JavaScript: myJS(6,3); ' /> <set name='AUG' value='0' color='3D86C6' link='JavaScript: myJS(7,4); ' /> <set name='SEP' value='0' color='3D86C6' link='JavaScript: myJS(8,5); ' /> <set name='OCT' value='65102.434' color='3D86C6' link='JavaScript: myJS(9,6); ' /> <set name='NOV' value='0' color='3D86C6' link='JavaScript: myJS(10,7); ' /> <set name='DEC' value='492987.38' color='3D86C6' link='JavaScript: myJS(11,8); ' /> <set name='JAN' value='0' color='3D86C6' link='JavaScript: myJS(0,9); ' /> <set name='FEB' value='0' color='3D86C6' link='JavaScript: myJS(1,10); ' /> <set name='MAR' value='0' color='3D86C6' link='JavaScript: myJS(2,11); ' /> <set name='APR' value='59831.70' color='B0BC25' link='JavaScript : myJS(3,12); ' /> <trendLines> <line startValue='166449.66' color='#FBA91E' thickness='5' displayValue=' ' /> </trendLines> <trendlines> <line color='3D86C6' showOnTop='1' isTrendZone='0' thickness='2' endValue='1' startValue='1' displayValue=' ' /> </trendlines> <styles><definition><style name='MyFirstFontStyle' type='font' font='GothamMedium' size='14' color='3D86C6' bold='0'/> </definition><application><apply toObject='YAXISNAME' styles='MyFirstFontStyle'/><apply toObject='DATALABELS' styles='MyFirstFontStyle'/> <apply toObject='DATAVALUES' styles='MyFirstFontStyle'/></application></styles> </graph> As per my another requirement i need to call javascript function onClick of x-axis labels not onClick of Columns. Here i'm using MSCombiDY2D shockWave File to get Multiseries column 2D+Single line chart with input fed as Json like { "chart": { "palette": "5", "caption": "Sales", "showlabels": "1", "connectnulldata": "0", "pyaxisname": "TICKET VOLUME", "plotGradientColor": " ", "showPlotBorder": "0", "canvasborder": "3D86C6", "canvasborderalpha": "0", "showalternatehgridcolor": "0", "numdivlines": "0", "showLimits": "0", "plotBorderColor": "ffffff", "showBorder": "0", "chartRightMargin": "0", "chartTopMargin": "0", "lineColor": "00611C", "borderAlpha": "0", "bgColor": "ffffff", "showYAxisValues": "0", "legendPosition": "TOP", "formatnumberscale": "0" }, "categories": [ { "category": [ { "vline": "true", "color": "3D86C6", "thickness": "2" }, { "label": "<a href='http://www.fusioncharts.com'> Jan </a>" }, { "label": "Feb" }, { "label": "Mar" }, { "label": "Apr" } ] } ], "dataset": [ { "seriesname": "First", "color": "33CCFF", "showvalues": "1", "data": [ { "value": "25601.34" }, { "value": "20148.82" }, { "value": "35407.15" }, { "value": "38105.68" } ] }, { "seriesname": "Second", "color": "6666FF", "showvalues": "1", "data": [ { "value": "57401.85" }, { "value": "41941.19" }, { "value": "45263.37" }, { "value": "117320.16" } ] }, { "seriesname": "Third", "color": "D14719", "anchorBorderColor": "D14719", "anchorBgColor": "D14719", "anchorRadius": "5", "showvalues": "0", "parentyaxis": "S", "renderas": "Line", "data": [ { "value": "45000" }, { "value": "44835" }, { "value": "42835" }, { "value": "77557" } ] } ], "trendlines": [ { "line": [ { "color": "3D86C6", "showOnTop": "1", "isTrendZone": "0", "thickness": "2", "endValue": "1", "startValue": "1", "displayValue": " " } ] } ], "styles": { "definition": [ { "name": "CategoryLink", "type": "font", "ishtml": "1" } ], "application": [ { "toobject": "DATALABELS", "styles": "CategoryLink" } ] } } but i'm not able to make atleast x-axis label Clickable. Share this post Link to post Share on other sites
Haritha Report post Posted April 2, 2014 Hi, Due to security and performance reasons, support for HTML tags like anchor tags defined within X-axis labels has been dropped. So, this feature will not be available for the current version v3.3.1 SR3 as well. The using of anchor (<a> tag) inside label for having links was a workaround provided to address the requirement to have links on x-axis labels in older versions of FusionCharts. This workaround does not work anymore, since we have made the charts more restrictive to external tags due to security constraints. Hope this helps. Share this post Link to post Share on other sites
Akshay S Report post Posted April 2, 2014 Okay. Thanks haritha. Can we make x-axis labels clickable, say i want to call a javascript function onClick of x-axis labels. Share this post Link to post Share on other sites
Haritha Report post Posted April 3, 2014 Hi, As said above, it is not possible to add a link on x-axis label to make it call a JavaScript function when a user clicks on it. However, you may add links to data plots (columns) such that a JavaScript function gets called when a user clicks on the particular data plot. For more information on adding JavaScript function as link on data plot, refer: http://docs.fusioncharts.com/charts/contents/index.html?DrillDown/JavaScript.html Also, for a demo of the same, refer: http://docs.fusioncharts.com/charts/Code/DrillDown/JSExample.html Hope this helps. Share this post Link to post Share on other sites
Akshay S Report post Posted April 3, 2014 Okay. Thanks for response. We already achieved making links on Data plot but making labels clickable i needed. Anyway thanks for response. Share this post Link to post Share on other sites
spawlish Report post Posted February 24, 2016 Hi, I'm re-opening this thread because I find the answer quite unsatisfying and we need this feature as well. Why would it be a security hole to call a javascript function when clicking on the axis members, but it's NOT a security hole to call a javascript function when clicking on a data plot? That doesn't make any sense. Thanks, Steve Share this post Link to post Share on other sites
Vishalika Report post Posted February 29, 2016 Hi, Welcome to FusionCharts Forum! Using FusionCharts v3.10.1, you can use the attribute "labellink" to add links to X-axis labels. Refer this sample JSFIddle: http://jsfiddle.net/vishalika/s7t8F/1184/ You can download the package from this: http://www.fusioncharts.com/download/ Hope this helps. Share this post Link to post Share on other sites
spawlish Report post Posted February 29, 2016 Excellent! Thank you! Share this post Link to post Share on other sites