Skip to content

#legend slot

Compare
Choose a tag to compare
@graphieros graphieros released this 26 Mar 13:34
· 1628 commits to master since this release

This release adds a #legend slot to all chart components except for:

  • VueUiWheel
  • VueUiTiremarks
  • VueUiHeatmap
  • VueUiRelationCircle
  • VueUiThermometer
  • VueUiSparkline
  • VueUiSparkbar
  • VueUiSparkStackbar
  • VueUiSparkgauge
  • VueUiSparkHistogram
  • VueUi3dBar

This feature allows for increased customization of chart legends.

The legend slot also works when using the VueDataUi universal component, if the component it wraps supports it.
It is recommended to set the show legend config attribute to false, to hide the default legend.

<VueUiDonut :config="config" :dataset="dataset">
  <template #legend="{ legend }">
    <div v-for="item in legend">
      {{ legend.name }}
    </div>
  </template>
</VueUiDonut>