Skip to content

Grid

Customize the background grid lines on the chart.

← Back to Custom Styles overview

Copy the property path into your setCustomStyles config. You only need to include the values you want to change.

PropertyDescriptionTypeExample
grid.showShow or hide the entire gridbooleantrue
grid.horizontal.showShow horizontal grid linesbooleantrue
grid.horizontal.colorColor of horizontal linescolor'#e8e8e8'
grid.horizontal.sizeThickness of horizontal linesnumber1
grid.horizontal.styleLine style for horizontal lines'dashed' | 'solid''dashed'
grid.vertical.showShow vertical grid linesbooleantrue
grid.vertical.colorColor of vertical linescolor'#e8e8e8'
grid.vertical.sizeThickness of vertical linesnumber1
grid.vertical.styleLine style for vertical lines'dashed' | 'solid''dashed'

Example

typescript
chart.setCustomStyles({
  dark: {
    grid: {
      horizontal: { color: '#333333', size: 1 },
      vertical: { color: '#333333', size: 1 },
    },
  },
})

Developers who need full TypeScript interfaces can use the type reference.