trying to pass variables in XML to javascript through link
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



trying to pass variables in XML to javascript... Expand / Collapse
Author
Message
Posted 1/16/2008 3:38:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/20/2008 5:48:10 PM
Posts: 4, Visits: 10
I am having some difficulties, I am creating the XML string and passing some parameters through the link='' after setting data:

exampl:

 <script type="text/javascript"> 
            Ext.onReady(function() {
  var chart_HDS = new FusionCharts("flash/MSColumn3D.swf", "HDS", "800", "300", "0", "1");
    chart_HDS.setDataXML("<chart caption='Datacenter total hds Storage vs. Free Storage' xAxisName='Datacenters' yAxisName='Storage (GB)' showValues='0' labelDisplay='ROTATE' slantLabels='1'><categories><category name='Bothell' /><category name='Dallas-ITO' /><category name='Windward' /><category name='WWDC-Lab' /></categories><dataset seriesName='phys'><set value='1149104' link='javascript:displayArea(Bothell,HDS)' /><set value='313606' link='javascript:displayArea(Dallas-ITO,HDS)' /><set value='1057704' link='javascript:displayArea(Windward,HDS)' /><set value='53799' link='javascript:displayArea(WWDC-Lab,HDS)' /></dataset><dataset seriesName='free'><set value='273591' /><set value='14305'  /><set value='38439' /><set value='11276'  /></dataset></chart>")
                chart_HDS.addParam("wmode", "transparent");
  chart_HDS.render("HDSDiv");
            });
 </script> 

As you can see from the red Highlight I have a function called displayArea(local,stor) {} , this is expecting to have 2 parameters passed to it, which I belive I am doing by passing (Bothell, HDS) after calling the function in the XML string. What am I doing incorrect here. The error I get is "Bothell is not defined"

Post #3893
Posted 1/24/2008 1:23:21 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: 2 days ago @ 9:41:33 AM
Posts: 809, Visits: 1,285
hi,

You need to put the string values passed to javascript functions within quotes. quotes need to be encoded.

try like this :

link='displayArea(%26apos;Bothell%26apos;,%26apos;HDS%26apos' 


Regards,

Sudipto Choudhury
FusionCharts Team
Post #4054
Posted 4/16/2008 9:30:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/8/2008 7:34:13 AM
Posts: 4, Visits: 12
Hi, 

I'm having a similar problem - here is my XML:

<chart caption='Sales Points' showPercentageValues='1' animation='true' pieSliceDepth='30' showBorder='1' formatNumberScale='0' ><set label='NoArea' value='14' link='JavaScript:SetNextLevel(%26apos;5%26apos;,%26apos;%26apos;,%26apos;1|DIV%26apos;,%26apos;0%26apos'></chart>

Does anyone know why this isn't working?

Thanks

Post #5702
Posted 4/22/2008 11:42:59 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117, Visits: 498
One way to check this would be to switch the debug mode of chart to on. That'll show the link that chart has received.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #5830
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 10:10am


Execution: 0.047.