Grid
About
A Grid object defines how gridlines are displayed. They are visible by default and appear on each tick mark.
Properties
The following properties can be set:
Property | Definition | Type | Default |
---|---|---|---|
visible | Grid's visibility | Boolean | true |
style | Grid's style | LineStyle | { stroke: 'black', strokeWidth: 1, strokeDashArray: '1 3'} |
Example
In the following examples, we create charts with different gridlines settings.
//vertical gridlines
chart.layout.xAxis.grid.style.strokeDashArray = ' 1 0';
//horizontal gridlines
chart.layout.yAxis.grid.style = {
stroke: 'brown',
strokeDashArray: '1 4'
};
//hide vertical gridlines
chart.layout.xAxis.grid.visible = false;
//horizontal gridlines
chart.layout.yAxis.grid.style = {
strokeDashArray: '2 3',
strokeWidth: 2
};
Comments
Contents