Skip to contents

Each panel has its own x-axis and y-axis with the same index. Indices start at zero and run from left to right across each row. To add a series to a panel, pass its index to both axis arguments of hc_add_series(). Several series can share a panel.

Usage

hc_gridAxis(hc, nrow, ncol, xAxis = list(), yAxis = list())

Arguments

hc

A highchart widget.

nrow, ncol

Number of rows and columns in the grid.

xAxis, yAxis

A named list of Highcharts axis options for every panel, or an unnamed list with one option list per panel in row order.

Value

The widget with its x-axis and y-axis collections set to the grid.

Examples

highchart() |>
  hc_gridAxis(1, 2) |>
  hc_add_series(data = c(1, 3, 2), name = "First", xAxis = 0, yAxis = 0) |>
  hc_add_series(data = c(4, 2, 5), name = "Second", xAxis = 1, yAxis = 1)