Class: ThemeHelper

CIQ. ThemeHelper


new ThemeHelper(params)

Generates an object that can be used programatically to load new themes or to create a theme dialog to manage chart themes. The initial values contain the existing values in the current chart. Simply have your dialog modify these values and then call the method CIQ.ThemeHelper#update

Note that the chart has many granular customizations beyond what this theme helper produces. These can be manipulated in the CSS. This helper simplifies and consolidates into a manageable set.

Parameters:
Name Type Description
params Object

Parameters

Properties
Name Type Description
stx CIQ.ChartEngine

A chart object

Example
var helper=new CIQ.ThemeHelper({stx:stx});
console.log(helper.settings);
helper.settings.chart["Grid Lines"].color="rgba(255,0,0,.5)";
helper.update();

Members


settings

Current theme settings. These are the settings that are ready to be loaded, or currently loaded. Modify as needed. To load these settngs call CIQ.ThemeHelper#update

Example
//Default settings object structure
	"chart":{
			"Background":{
				"color":color1
			},
			"Grid Lines":{
				"color":color2
			},
			"Grid Dividers":{
				"color":color3
			},
			"Axis Text":{
				"color":color4
			}
		},
		"chartTypes":{
			"Candle/Bar":{
				"up":{
					"color":color5,
					"wick":color6,
					"border":color7
				},
				"down":{
					"color":color8,
					"wick":color9,
					"border":color10
				}
			},
			"Line":{
				"color":color11
			},
			"Mountain":{
				"color":color12
			}
		}

Methods


update( [stx])

Call this method to activate the chart theme with values set in CIQ.ThemeHelper#settings

Parameters:
Name Type Argument Description
stx CIQ.ChartEngine <optional>

Optional chart engine to apply the changes to.

Since:
  • 4.1.0 Added optional chart engine parameter.
Example
var helper=new CIQ.ThemeHelper({stx:stx});
console.log(helper.settings);
helper.settings=NewSettings;
helper.update();