BaseGrid

live example

Explore the API in the live example.

api reference

BaseGrid()
Component implementing grid lines.
BaseGrid.lineStyle(style)
Sets the grid line's line style. Default line style is dashed.

Parameters

NameTypeDescription
stylestringLine style. Supported values: solid, dashed, dotted.

Returns

Widget
Reference to the Widget's API.

Examples

// Set X grid line style to solid for a chart.
chart.xGrid.lineStyle('solid')

// Set Y grid line style to dotted for a chart.
chart.yGrid.lineStyle('dotted')
BaseGrid.on(on)
Turns on/off grid lines. By default, the grid is off.

Parameters

NameTypeDescription
onbooleanWhether to have grid lines.

Returns

Widget
Reference to the Widget's API.

Examples

// Turn on X grid for a chart.
chart.xGrid.on(true)

// Turn off Y grid for a chart.
chart.yGrid.on(false)
BaseGrid.opacity(value)
Sets the grid line's opacity. The grid color is the same as the axis color. Default opacity is 0.3.

Parameters

NameTypeDescription
valuenumberThe opacity value.

Returns

Widget
Reference to the Widget's API.

Examples

// Set X grid opacity to 0.8 for a chart.
chart.xGrid.opacity(0.8)