grid
Configuration Structure
grid: {}show
trueTo show or hide grid area (including xaxis / yaxis)
borderColor
'#e0e0e0'Colors of grid borders / lines
strokeDashArray
0Dashes the grid lines. A higher number creates longer dashes and gaps. Since 8.5.0 it also takes a full dash pattern, a string such as '8 3 2 3' or an array of lengths. See stroke.dashArray.
position
'back'Whether to place grid behind chart paths of in front. Available options for position
- front
- back
xaxis
lines
show
falseWhether to show / hide x-axis lines
yaxis
lines
show
trueWhether to show / hide y-axis lines
row
colors
undefinedGrid background colors filling in row pattern. Each row will be filled with colors based on the index in this array. If less colors are specified, colors are repeated.
opacity
0.5Opacity of the row background colors.
Accepts values from 0 to 1
column
colors
undefinedGrid background colors filling in column pattern. Each column will be filled with colors based on the index in this array. If less colors are specified, colors are repeated.
opacity
0.5Opacity of the column background colors.
Accepts values from 0 to 1
padding
Extra space around the plot, in pixels, added to what the chart reserves itself. Negative values take reserved space back.
Above the plot, an axis chart keeps a 20px band even with no title or subtitle: 10px, plus 5px for each of the two that is unset (a set one adds its margin instead, 5px by default). On column, line and area charts that band holds the top y-axis label's overhang and any marker or data label above the top value, so top: -12 is about as far as is safe there. On a horizontal bar chart with no title the band is empty, and top: -20 removes it. Trellis panels drop the band on their own.
top
0Grid padding from top
right
10Grid padding from right
bottom
0Grid padding from bottom
left
12Grid padding from left
offsetX
Sets the left offset of the vertical grid lines.
offsetY
Sets the top offset of the vertical grid lines.
offsetX
Sets the left offset of the horizontal grid lines.
offsetY
Sets the top offset of the horizontal grid lines.