Sign in to follow this  
Rahul44

Change Data

Recommended Posts

I was trying to follow your example but only the first data show its not actually switching the data.

 

I am using FusionChart 3.1.1 not sure what the name of it is and i tried the following code ..

 

<script LANGUAGE="JavaScript">

 

function updateChart(domId){

updateChartXML(domId,"<graph><set name='A' value='30' color='D64646' /><set name='B' value='51' color='AFD8F8' /></graph>");

this.document.frmUpdate.btnUpdate.disabled = true;

}

</SCRIPT>

 

<div id="chart1div">

FusionCharts

</div>

<script language="JavaScript">

var chart1 = new FusionCharts("/FusionCharts/Optix/Column2D.swf", "chart1Id", "100%", "350");

chart1.setDataXML("<graph><set name='A' value='10' color='D64646' /><set name='B' value='11' color='AFD8F8' /></graph>");

chart1.render("chart1div");

</script>

<form name='frmUpdate'>

<input type='button' value='Change Data' onClick="javaScript:updateChart('chart1Id');" name='btnUpdate'>

</form>

 

Its giving me object expected error ..

Can you pls advise ..

Or can you suggest another way to change data in a fusion chart on the client side ..

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi Rahul,

 

Welcome to FusionCharts Forum! smile.gif

 

Sincere apologies for delayed response.

 

Could you please try it out using the latest version of FusionCharts XT?

 

Recently, we have released FusionCharts XT v3.3.0. It has many bug fixes and improvements. Also, it provides powerful JavaScript API for more customization as compared to FusionCharts v3.1.1

 

Please find the attached illustration for your reference.

 

Hope this helps!

UpdateChart_Data.zip

Share this post


Link to post
Share on other sites

Hi Sumedh,

 

Unfortunately my hands are tied for the update. If you can help me with a solution for that version that woudl have been great.. Thank you ..

 

Thank you for your help

 

Rahul.

 

 

Hi Rahul,

 

Welcome to FusionCharts Forum! smile.gif

 

Sincere apologies for delayed response.

 

Could you please try it out using the latest version of FusionCharts XT?

 

Recently, we have released FusionCharts XT v3.3.0. It has many bug fixes and improvements. Also, it provides powerful JavaScript API for more customization as compared to FusionCharts v3.1.1

 

Please find the attached illustration for your reference.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi sumedh,

 

Thank you so much for your help that worked ..sorry to bother you again ..so how can i have a link to get back to the old data ?? I mean i know i can another function with same old data to link back to that function but is there a better way ..like when i am in the second chart a back link to go back ?

 

 

Thank you sumedh.

 

 

 

 

Hi Rahul,

 

Please find attached illustration with FusionCharts v3.1.1 files.

 

Hope this helps!

Edited by Rahul44

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi Rahul,

 

As you have mentioned, you would need to update the chart again with the old data to get back the original chart.

 

However, instead of passing the old data again to the "setDataXML()" method, you can get the chart XML by "getXML()" method and store it in a JavaScript variable, just before updating the chart and onClick of "Back" button you can update the chart with that saved data.

 

Please find the modified "test.html" attached here, for your reference.

 

Hope this helps!

test.html

Share this post


Link to post
Share on other sites

Hi,

 

Hi sumedh,

 

Thank you so much for your help that worked ..sorry to bother you again ..so how can i have a link to get back to the old data ?? I mean i know i can another function with same old data to link back to that function but is there a better way ..like when i am in the second chart a back link to go back ?

 

 

Thank you sumedh.

 

 

Please note that FusionCharts XT supports a special type of Drill-down called LinkedCharts that natively provides a "Back" button to go back to parent child from where you have drilled-down to the child chart.

Ref.- http://www.fusioncharts.com/demos/features/#linkedcharts-for-easy-drill-down

http://docs.fusioncharts.com/charts/contents/?FirstChart/LinkedCharts.html

 

In case you wish to achieve the same feature on the chart in FusionCharts v3.1.1, this is natively not possible. However, you can always wrote your own piece of code to call the function to go back to the previous chart at your end, as per your requirement.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Hi Sashibhusan,

 

Thank you for that .. that is exactly what i was looking for ..

 

Thank you for your help..Take care

 

Rahul

 

 

 

Hi Rahul,

 

As you have mentioned, you would need to update the chart again with the old data to get back the original chart.

 

However, instead of passing the old data again to the "setDataXML()" method, you can get the chart XML by "getXML()" method and store it in a JavaScript variable, just before updating the chart and onClick of "Back" button you can update the chart with that saved data.

 

Please find the modified "test.html" attached here, for your reference.

 

Hope this helps!

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi Rahul,

 

We are glad to hear that the solution was helpful to you.

 

Happy FusionCharting!:)

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