Sign in to follow this  
Guest Madhumita

JavaScript Calling Problem

Recommended Posts

Hi,

 

 

 

I am trying to generate a line chart with links, below is the XML for the chart I am trying to create.

 

 

 

<chart caption='Messages Recieved By You' xAxisName='Day' yAxisName='Tweets' yAxisMinValue='15000' showValues='0' alternateHGridColor='FCB541' alternateHGridAlpha='20' divLineColor='FCB541' divLineAlpha='50' canvasBorderColor='666666' baseFontColor='666666' lineColor='FCB541'><set label='28-10-2009' value='8' link='showReplies(28-10-2009)'/><set label='29-10-2009' value='0' link='showReplies(29-10-2009)'/>< label='30-10-2009' value='8' link='showReplies(30-10-2009)'/>< label='31-10-2009' value='0' link='showReplies(31-10-2009)'/><styles><definition><style name='Anim1' type='animation' param='_xscale' start='0' duration='1'/><style name='Anim2' type='animation' param='_alpha' start='0' duration='0.6'/><style name='DataShadow' type='Shadow' alpha='40'/></definition> <application><apply toObject='DIVLINES' styles='Anim1'/><apply toObject='HGRID' styles='Anim2'/><apply toObject='DATALABELS' styles='DataShadow,Anim2'/></application></styles></chart>

 

 

 

Now the javascript that I want to call is getting invoked, but the value that is being passed is not the one which is being shown in XML.

 

 

 

This is very urgent for me, could you please help.

 

 

 

Regards,

 

Rohit

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

Since you had not enclosed the variable passed with quotes, it was passed as a numeric calculation, and thus you were not receiving the correct values.

As the variable you are passing in the javascript function is a string, please enclose the variable with quotes.

e.g.

<set label='28-10-2009' value='8' link='javascript:showReplies("28-10-2009")' />

<set label='29-10-2009' value='0' link='javascript:showReplies("29-10-2009")' />

<set label='30-10-2009' value='8' link='javascript:showReplies("30-10-2009")' />

<set label='31-10-2009' value='0' link='javascript:showReplies("31-10-2009")' />

Hope this helps. :)

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

Since you had not enclosed the variable passed with quotes, it was passed as a numeric calculation, and thus you were not receiving the correct values.

As you are passing a string in the javascript function, please enclose it within quotes.

e.g. <set label='28-10-2009' value='8' link='javascript:showReplies("28-10-2009")' />

Hope this helps. :)

Share this post


Link to post
Share on other sites

Thanks for the reply.

 

 

 

Actually, I am not able to add the " to the javascript call. Since I am generating the xml in Java, I need to escape the " with " . When I generate the XML with such escape character, the gaph gives an error saying invalid data.

 

 

 

Is there any other way I can achieve this.

 

 

 

Regards,

 

Rohit

 

 

 

p.s: need to view source to see your reply. The page is not loading correctly.

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Could you please send us the XML codes that you are using as an attachment so that we might look into it?

Also, could you please try it using the attribute 'clickURL' in the chart element?

Ref:-http://www.fusioncharts.com/docs/Contents/ChartSS/Line2D.html

Hope this helps and also waiting for your reply. :)

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

You can try using the following syntax to invoke the javascript function.

<set label='28-10-2009' value='8' link='j-showReplies-28-10-2009' />

<set label='29-10-2009' value='0' link='j-showReplies-29-10-2009' />

<set label='30-10-2009' value='8' link='j-showReplies-30-10-2009' />

<set label='31-10-2009' value='0' link='j-showReplies-31-10-2009' />

ref:- http://www.fusioncharts.com/docs/Contents/DrillDown/JavaScript.html

Hope this helps. :)

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
Sign in to follow this