Settings inside HTML

Instead of loading settings from a file, you can pass them to the chart directly from the HTML file. The settings get embedded in the HTML code snippet that you use to add the chart to the page.

Open your web page file in your text editor and locate the code snippet. Find the following line:

so.addVariable("chart_settings", "");

By default this line has in front of it, which means that it is ignored by the software. If you remove the characters, the software will look for settings in that line, not in the settings file.

The settings go inside the last pair of quotation marks. They must be in the same format as the settings file (XML), but without line breaks. Here is an example:

so.addVariable ("chart_settings", "<settings><background><color>#DADADA</color><alpha>100</alpha></background></settings>");

Important notice:

If you include settings inside the HTML code, check that your settings don't have XML attributes, for example: <graph gid="1">. If you have this or any other attributes in the HTML code, replace all double quotes with single quotes: <graph gid='1'>. If you don't do this, you will receive JavaScript errors, because your full settings string is already inside double qoutes.

Additional Settings

There is another line in the code snippet that you can use for settings:

so.addVariable("additional_chart_settings", "");

Using this line, you can append some settings to the ones loaded from a settings file or passed to the chart with the chart_settigs variable. This is useful if you have a general settings file that you use across all charts, and just want to customize a few things for this particular one. For example:

so.addVariable("additional_chart_settings", "<settings><plot_area><color>#BBBB00</color></plot_area></settings>");