You are viewing documentation for an older version. For current documentation - click here.

FusionCharts JavaScript class API provides a number of properties. The list below shows details on each property :

API Properties Description Example
FusionCharts class - static properties
version This returns the version of FusionCharts JavaScript class
FusionCharts.version
items This is an Array containing references to all the chart instances in a page. Using this, you can get the reference of a chart object. A reference of a chart is necessary to perform all available functions, use all available properties and listen to events.

When a chart ID is passed, it tries to return (if available) the reference of the instance of the FusionCharts Object.

This is same as FusionCharts() static function which also provides the reference of the chart Object.
FusionCharts.items["myChartId"]
printManager This is an Object which configures FusionCharts Print Manger. Click here to know about the functions available in this Object.  
debugMode This is an Object which sets debugMode of FusionCharts JavaScript class. Click here to know about the functions available in this Object.  
 
FusionCharts class - instance properties
id Id of the chart. This is commonly called the DOMId of the chart.
myChart.id
width Width of the chart
FusionCharts.items["myChartId"].width
height Height of the chart
FusionCharts.items["myChartId"].height
src Path of the chart SWF file
FusionCharts.items["myChartId"].src
Details

From the FusionCharts JavaScript Object you can get various information about the chart instance as well as the JavaScript class. Let us quickly go though the information:

FusionCharts.version

This static property of FusionCharts class returns an indexed array containing version information of FusionCharts JavaScript class. The information comes in the format - [ major, minor, revision, identifier, build ]. This is only applicable in FusionCharts JavaScript class.

var FCJSMajorVersion = FusionCharts.version[0]; // returns the major version number i.e., 3 
var FCJSbuild = FusionCharts.version[4]; // returns the build number

FusionCharts.items[]

This static property contains an array of the references of all the charts present in a page. It is a normal JavaScript Object which can be iterated using for(var charts in FusionCharts.items). Each object in items has a string key to identify the chart object reference it stores. The key value is same as the chart's ID or DOMId. Hence, you can access each chart object from this array using standard JavaScript access methods.

For example

var chartReference = FusionCharts.items["myChartId"];

chartJSInstance.id

This property of FusionCharts JavaScript Object returns the DOMId of the chart as String. This is only applicable to FusionCharts JavaScript object.

var chartId = myChart.id;

chartJSInstance.width

This property of FusionCharts JavaScript Object returns the width of the chart. It returns value either in percentage or in pixels. This is only applicable to FusionCharts JavaScript object.

You can also set value for this property. But you will need to call resizeTo() function to get the change reflected on the chart.

var chartWidth = FusionCharts("myChartId").width; //gets current width

FusionCharts("myChartId").width = "80%";
FusionCharts("myChartId").resizeTo( , "100%" ); // sets chart's width to 80% and height to 100% 

chartJSInstance.height

This property of FusionCharts JavaScript Object returns the height of the chart. It returns value either in percentage or in pixels. This is only applicable to FusionCharts JavaScript object.

You can also set value for this property. But you will need to call resizeTo() function to get the change reflected on the chart.

var chartHeight = FusionCharts("myChartId").height;//gets current height 

FusionCharts("myChartId").height = "60%";
FusionCharts("myChartId").resizeTo( "50%" ); // sets chart's height to 60% and width to 50%

chartJSInstance.src

This property of FusionCharts JavaScript object returns the path or URL of the chart SWF file as String. This is only applicable to FusionCharts JavaScript object.

var chartSrc = FusionCharts("myChartId").src;