Sign in to follow this  
pekem

How do I keep the same chart-settings

Recommended Posts

I have 100 xml-files that Im changing between. The chart-settings should be the same for them all, but sometimes I have to change them. Can it really be true that I have to change the chart-setting for every document or can I enter the settings once inside my movie to make it the basic chartsettings for all my Pies.

 

When I say chart-setting Im talking about showValue, baseFontColor and so on...

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

Could you please try follwing the steps below and see if this helps?

1. Fetch the individual dataURL using Ajax.

2. Add the attributes to response html . e.g. You can replace "<chart" with "<chart showValue='1/0' baseFontColor='ff00ff' ...."

3. Then use this changed data to render the chart or update the chart.

 

If you need further help on this, please do revert.

 

Share this post


Link to post
Share on other sites

Please, can you calrify this for me.

 

First, when you ask me to do this is it then because you know it will work. You sound as it just worth a try...

 

Secondly I am not sure what you mean.

 

Should I remove the chart-settings from the xml-files and place them in the html-page.

 

How and where exactly

 

And should the xml-files start like this

 

 

 

<..../>

 

 

 

 

and then what should happen inside the movie....

 

 

 

Please explain more detailed....

Share this post


Link to post
Share on other sites

You can not save chart settings inside the chart...that would be too specific for a generic component that we provide..

 

 

 

May I try explaining the implementation method? (There can be many methods)

 

Since the chart's cosmetics are the settings that you want to keep same for all the charts, should I assume that all these settings should be in <chart> node?

 

 

 

1. If so all you need to do is keep the XML files' <chart> node without any settings that you want common in all charts.

 

 

 

2. In the page(s) where you load the chart(s) keep a copy of the common settings in a global JavaScript string variable, say strSettings.

 

 

 

3. Instead of using dataURL method to load the XML directly into the chart first load the required XML into JavaScipt as ResponseText using AJAX calls.

 

 

 

4. Once the AJAX call is complete, the ResponseText will load the XML from the file in a JavaScript string variable, say RTXML

 

 

 

5. Now remove "<chart" with "<chart " + strSettings +" " and store, say in dataXML String variable.

 

 

 

you can use code like dataXML = RTXML.replace(/<chart /, "<chart " + strSettings +" ");

 

 

 

6. Once done, render the chart using dataXML method and get the finally composed XML from dataXML varaible. Assing this variable to setDataXML() function of FusionCharts JavaScript class while you render the chart.

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