Gridlines
The Gridlines class represents a set of grid lines for a visual encoding. To create a Gridlines object, use the gridlines method in the Scene class, for example:
let gridlines = scene.gridlines("x", "metric");
Properties
property | explanation | type | default value |
---|---|---|---|
id | the unique id of the legend | String | |
type | the type of the legend | String | “legend” |
channel | the visual channel of the legend possible values: “fillColor”, “strokeColor” | String | |
field | the data field of the legend | String | |
x | the x coordinate of vertical gridlines | Number | |
y | the y coordinate of horizontal gridlines | Number | |
textColor | the text color of gridlines | Color | “#555” |
strokeColor | the stroke color of gridlines | Color | “#ddd” |
strokeWidth | the stroke width of gridlines | Number | 1 |
values | the data values represented by the grid lines, if not provided, Mascot will auto-generate values | Array |