Chart class, used to define and create charts. Constructor takes container element as the first, and only, parameter.
new Chart(el);
Name | Description |
None. |
Name | Type | Descripton |
None. |
Name | Description | |||||||||||||||
addSyntax
Arguments
Return Type
| Adds series to chart. | |||||||||||||||
drawSyntax
Arguments
Return Type
| Draws the chart, all series should be added and all settings made before calling this. | |||||||||||||||
setBarDistanceSyntax
Arguments
Return Type
| Sets distance between bars for bar charts. | |||||||||||||||
setBarWidthSyntax
Arguments
Return Type
| Sets with of bars for bar charts. | |||||||||||||||
setDefaultTypeSyntax
Arguments
Return Type
| Sets default series type. Flags can be one of CHART_LINE, CHART_AREA or CHART_BAR and optionally CHART_STACKED. For instance to set the default type to a line chart, CHART_LINE is specified, for a stacked area chart CHART_AREA | CHART_STACKED is used. | |||||||||||||||
setGridDensitySyntax
Arguments
Return Type
| Sets grid density, the number of grid lines shown and the number of axis labels. | |||||||||||||||
setHorizontalLabelsSyntax
Arguments
Return Type
| Sets the labels for the horizontal axis, number of labels specified should match the x-axis density specified with setGridDensity. | |||||||||||||||
setLabelPrecisionSyntax
Arguments
Return Type
| Sets the precision for labels on the vertical axis. | |||||||||||||||
setPainterFactorySyntax
Arguments
Return Type
| Sets factory function used to create the chart painter. If not set CanvasChartPainterFactory is used. | |||||||||||||||
setShowLegendSyntax
Arguments
Return Type
| Controls whatever or not the legend should be shown. Defaults to true if not set. | |||||||||||||||
setVerticalRangeSyntax
Arguments
Return Type
| Sets the range of the vertical axis, if not set the minimum and maximum value of all series will be used. |
Name | Type | Descripton |
None. |
Name | Descripton |
None. |
None.
Introduction
Implementation
Usage
API
Demo
SVG Demo (mozilla/opera only)
JsGraphics Demo
Download