Optional addWhether legend entries should be automatically added and displayed.
Defaults to true for default legend and false for manually added legends (chart.addLegend).
Optional autoThe maximum allowed proportion of the viewport that the legend can occupy before it is automatically hidden. For example, a value of 0.75 means the legend will be hidden if it covers more than 75% of the viewport.
Optional backgroundBackground FillStyle of the legend.
Optional backgroundBackground LineStyle of the legend.
Optional backgroundWhether the legend background should be visible.
Optional entriesDefault LegendEntryOptions for the entries.
Optional entryMargin between legend entries.
Optional marginMargin from the main chart element to the legend.
Optional marginMargin from the legend to the edge of the chart area.
Optional orientationLegend orientation. By default, this is automatically dictated by configured position But it can be forced to a specific value, which can be useful when positioning legends at arbitrary locations.
// Example syntax, arbitrary location
chart.legend.setOptions({
position: {
x: 0,
y: 0,
origin: UIOrigins.UIOrigins.LeftBottom
},
orientation: LegendOrientation.Horizontal
})
Optional paddingLegend content padding.
Optional positionPosition of the legend.
// Example syntax, choose from preset options
const chart = lc.ChartXY({
legend: {
position: LegendPosition.RightCenter
}
})
Alternatively, arbitrary location as pixels relative to container bottom left corner can be specified:
// Example syntax, arbitrary location
chart.legend.setOptions({
position: {
x: 0,
y: 0,
origin: UIOrigins.UIOrigins.LeftBottom
}
})
These coordinates are defined in coordsRelative coordinate system.
Optional renderWhether the legend should be rendered on top of the chart.
Optional titleTitle of the legend.
Optional titleFillStyle of the legend title.
Optional titleFontSettings of the legend title.
Optional visibleWhether the legend should be visible.
Options for the Legend.