Sign in to follow this  
duderonomy

Customizing charts via API; and tweaking the canvas

Recommended Posts

Hello!  :)

 

I have searched the forum (both via google and on forum's search tool, too). I see some requests to customize FusionCharts. The solution often includes being directed to a web page like this one:

 

http://docs.fusioncharts.com/charts/contents/?AttDesc/Legend.html

 

Usually this page will show the parameters to modify the appearance of the particular item, such as the legend. 

 

We would prefer to design our application in a way that does not insert chart configuration data in the XML, like this:

<chart palette='2' caption='Sales' subCaption='March 2006' showValues='0' divLineDecimalPrecision='1' limitsDecimalPrecision='1' numberPrefix='$' formatNumberScale='0' >

We believe it is desirable to programmatically send the chart attributes to the "new FusionCharts()" api.

 

Is it possible to send the chart attributes to the FusionChart library via the javascript call mentioned in the last sentence?

 

Also, can someone point me to documentation that illustrates all of the possible customizations for the chart's canvas (background colors, borders, etc.)

 

Many thanks!

 

Cheers!

 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

if you want to update the chart with new chart attributes, then you can make use of setChartAttribute function.
 
All you need to do is pass the name of the attribute and its new value to this function.
 
Ref. Code:
var chartReference = FusionCharts("myChartId"); 
chartReference.setChartAttribute({"subCaption" : "new sub-title"});
 
For more information, please refer the following link:
 
Also note, you can only update chart elements through this function. For updating/changing the data of the chart (<set> and <dataset> elements), you would need to pass updated JSON/XML to the chart.
 
If you are willing to bind chart XML using a JavaScript function, then please refer the following link:
 
If this doesn't suffice, then please elaborate more on your requirement.

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