This section is regarding Methods and Properties available in the Chart element of StockChart.
Examples :Method | Description | Example |
---|---|---|
get(String propertyName) | Returns the specified property of chart | stockChart.charts[0].get(“backgroundColor”) |
set(String propertyName, Mixed value [,Boolean updateChart = true]) | Sets the specified property of chart and optionally updates (default) the chart. | stockChart.charts[0].set(“backgroundColor”, “#dedede”) |
addTo(String arrayName, Object options [, Number index=array.length [, Boolean updateChart = true]]) | Adds a new element of given type to the specified array. | stockChart.charts[0].addTo(“axisX”, {title: “Axis X Title”}) |
render() | Renders the chart | stockChart.charts[0].render() |
exportChart(Object options) | Exports the respective chart as image. | stockChart.charts[0].exportChart() |
print() | Prints the chart | stockChart.print() |
Can be accessed via get method or dot notation.
Property | Description | Example |
---|---|---|
bounds | Bounding rectangle of chart: {x1, y1, x2, y2} | stockChart.charts[0].get(“bounds”) / stockChart.charts[0].bounds |
container | DOM-Element | stockChart.charts[0].container / stockChart.charts[0].get(“container”) |
All chart options become available as properties only after Stock Chart is rendered. You can access them either via get method or dot notation. But you can change/set those values only via set method.
Please refer to chart options for complete list of properties available.
Also See: