Legend
Legend is an component that describes each of Series of the Plot, it's also used to interact with them.
Restriction
- In order to add a
SerieinLegendyou must specify itslabel - It's not possible to set
topandbottom,leftandrightoffsets at the same time
Props
position: determines
Legendposition in the plot
type:'top' | 'bottom' | 'left' | 'right'| 'embedded'
default:'embedded'margin: adds spacing out of legend
type:number
default:10onClick: Creates a callback when clicking to one of legend's elements, event: MouseEvent data, id: id of clicked serie
type:(args: {event: React.MouseEvent<SVGGElement, MouseEvent>;id: string;}) => voidlabelStyle: changes legend style in general or for specific serie's label
type:CSSFuncProps
default:{}lineStyle: changes line style in general or for specific serie's label
type:CSSFuncProps
default:{}showHide: activates "show/hide" functionality that allows you to hide and show series when clicking on it in the legend
type:boolean
default:falsetop changes top legend offset that cannot be defined with
bottom
type:numberbottom changes bottom legend offset that be cannot defined with
top
type:numberleft changes top legend offset that cannot be defined with
right
type:numberright changes top legend offset that cannot be defined with
left
type:number