Set Configuration as XML String or JS Object

Overview

When you have no intention to use a configuration file for setting chart configuration, but you want to use AJAX or simply generate the settings on the fly, you can do that by using the setConfig() method.

Read on about the setConfig() method in JavaScript API Reference: setConfig()

For the parameter, this method takes either an XML string or a JavaScript object. Here is the simplest call example:

The method automatically detects what is passed to it as the parameter - XML String or JS Object

to top

Set Chart Configuration as XML String

For setting a configuration from a string, simply call the setConfig() method and pass the XML string to it as the parameter. Example:

Here is a sample demonstrating setting chart configuration using an XML string:

Online HTML/JavaScript Sample

to top

Set Chart Configuration as JavaScript Object

Setting a configuration from a JS Object is much simpler. To set a configuration, simply call the setConfig() method and pass the object with the settings to it. Example:

Here is a sample demonstrating setting chart configuration using a JS Object:

Online HTML/JavaScript Sample

to top