Skip to content
On this page

SeriesToggler

SeriesToggler accepts an array of DataSets and builds structure for "deactivating" each series. This can mean simply visually hiding a series, or removing the series from the aggregate domains (replotting on hide)

INFO

any series with no points will be automatically deactivated

html
...
<DDV>
  <template #default="{ domState }">
    <SeriesToggler v-if="domState?.plotWidth > 0">
      <template #default="{ inactiveDataSets }">
        <SeriesReducer
          :data-sets="dataSets"
          :inactive-data-sets="inactiveDataSets"
          :absolute-scale="true"
          :max-points="domState.plotWidth > 0 ? domState.plotWidth * 3 : 500"
        >
          ...
        </SeriesReducer>
      </template>
    </SeriesToggler>
  </template>
</DDV>

Props

None

Emits

signalargscomment
seriesActivatedseriesIdfired when an inactive series becomes active
seriesDeactivatedseriesIdfired when an inactive series becomes inactive

Slots

default

proptypecomment
inactiveDataSetsnumber[]a list of series indexes that are inactive
activateSeries(number) => voida function that accepts a series index number and activates it
deactivateSeries(number) => voida function that accepts a series index number and deactivates it
toggleSeries(number) => voidcalls either activate or deactivate depending on current state

Released under the MIT License.