View source: R/highcharts-api.R
hc_legend | R Documentation |
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols.
hc_legend(hc, ...)
hc |
A |
... |
Arguments defined in https://api.highcharts.com/highcharts/legend. |
A Highmaps legend by default contains one legend item per series, but if a colorAxis is defined, the axis will be displayed in the legend. Either as a gradient, or as multiple legend items for dataClasses.
highchart() |>
hc_xAxis(categories = month.abb) |>
hc_add_series(name = "Tokyo", data = sample(1:12)) |>
hc_add_series(name = "London", data = sample(1:12) + 10) |>
hc_add_series(name = "Other City", data = sample(1:12) + 20) |>
hc_legend(
align = "left",
verticalAlign = "top",
layout = "vertical",
x = 0,
y = 100
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.