FusionCharts JavaScript API - Properties | ||||||||||||||||||||||||||||||||||||
FusionMaps XT uses FusionCharts JavaScript Class that takes care of all the products of FusionCharts Suite XT including FusionMaps 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 a lot of information about the map instance as well as the JavaScript class. Let's quickly go though 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 maps present in a page. It is a normal JavaScript Object which can be iterated using for(var maps in FusionCharts.items). Each object in items has a string key to identify the map object reference it stores. The key value is same as the map's Id or DOMid. Hence, you can access each map object from this array using standard JavaScript access methods. For example: var mapReference = FusionCharts.items["myMapId"]; |
||||||||||||||||||||||||||||||||||||
This property of FusionCharts JavaScript Object returns the DOMId of the map as String. This is only applicable to FusionCharts JavaScript object. var mapId = myMap.id; | ||||||||||||||||||||||||||||||||||||
This property of FusionCharts JavaScript Object returns the width of the map. 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 the resizeTo() function to get the change reflected on the map. var mapWidth = FusionCharts("myMapId").width; //gets current width FusionCharts("myMapId").width = "80%"; FusionCharts("myMapId").resizeTo( , "100%" ); // sets map's width to 80% and height to 100% |
||||||||||||||||||||||||||||||||||||
This property of FusionCharts JavaScript Object returns the height of the map. 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 will need to call resizeTo() function to get the change reflected on the map. var mapHeight = FusionCharts("myMapId").height;//gets current height FusionCharts("myMapId").height = "60%"; FusionCharts("myMapId").resizeTo( "50%" ); // sets map's height to 60% and width to 50% |
||||||||||||||||||||||||||||||||||||
This property of FusionCharts JavaScript object returns the path or URL of the map SWF file as String. This is only applicable to FusionCharts JavaScript object. var mapSrc = FusionCharts("myMapId").src; |