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.
Events for the legend background.
Optional backgroundBackground FillStyle of the legend.
Optional backgroundBackground LineStyle of the legend.
Optional backgroundWhether the legend background should be visible.
Chart padding, used for adjusting the legend position.
Space allocated for the chart title, used for adjusting the legend position.
Array of legend entries.
Optional entryMargin between legend entries.
Optional marginMargin from the main chart element to the legend.
Margin 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.
Position of the legend.
If x and y are provided, they will be interpreted as relative coordinates of the chart bottom left (chart.coordsRelative).
If origin is provided, it will be interpreted as the origin of the legend position.
Optional renderWhether the legend should be rendered on top of the chart.
Optional titleTitle of the legend.
Events for the legend title.
Optional titleFillStyle of the legend title.
Optional titleFontSettings of the legend title.
Optional visibleWhether the legend should be visible.
Information used for rendering the legend.