Appearance
ChartLegend
ChartLegend
is a DOM-based component that draws an entry for each data-series. It can be used with v-model
as a graphical series toggler when used in combination with SeriesToggler
.
Props
name | type | default | required | description |
---|---|---|---|---|
dataSets | DataSet | N/A | 🗹 | The dataSets to draw legend entries for |
domState | DOMState | N/A | 🗹 | |
margins | Margins | N/A | 🗹 | |
modelValue | number[] | N/A | 🗹 | You can pass a ChartLegend a v-model of a list of plot ids and the legend can toggle them on and off by adding/removing from this list and emitting the changes |
marginPx | number | 10 | ☐ | margin around legend in pixels |
toolTipInfo | ToolTipInfo | {} | ☐ | A mapping of data series id to the nearestPoint for that series (if the mouse is close enough to one) |
Slots
perSeries
This slot will draw for every dataset, activated or not
prop | type | comment |
---|---|---|
dataSet | DataSet | The dataSet for this series |
dataSeriesNumber | number | The index in dataSets this series represents |
nearestPoint | NearestPoint | nearest point for this series |
activateSeries | () => void | A callback function to activate this series |
deactivateSeries | () => void | A callback function to deactivate this series |
seriesIsActive | boolean | true is the series is active |
beforeDatasets
This slot defaults to empty and is directly before the loop of perSeries
afterDatasets
This slot defaults to empty and is directly after the loop of perSeries
beforeThresholds
This slot defaults to empty and is directly before the loop of thresholds
afterThresholds
This slot defaults to empty and is directly after the loop of thresholds