FusionCharts JavaScript API - Properties | ||||||||||||||||||||||||||||||||||||
FusionWidgets XT uses FusionCharts JavaScript Class that takes care of all the products of FusionCharts XT Suite including FusionWidgets XT. FusionCharts JavaScript Class API provides a number of properties. The list below shows details on each property : |
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Details | ||||||||||||||||||||||||||||||||||||
From the FusionCharts JavaScript Object you can get various information about the chart instance as well as the JavaScript class. Let's quickly go through the information: 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 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. e.g. var chartReference = FusionCharts.items["myChartId"]; |
||||||||||||||||||||||||||||||||||||
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; | ||||||||||||||||||||||||||||||||||||
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 need to call the 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% |
||||||||||||||||||||||||||||||||||||
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 set also value for this property. But you 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% |
||||||||||||||||||||||||||||||||||||
This property of FusionCharts JavaScript object returns the path/URL of the chart SWF file as String. This is only applicable to FusionCharts JavaScript object. var chartSrc = FusionCharts("myChartId").src; |