apexcharts-card
apexcharts-card copied to clipboard
Change order of series labels in the legend
Checklist
- [x] I am running the latest version of the card
- [x] I checked if there isn't another feature request opened with the same request
- [x] I checked that the feature is not already available in the
dev
branch
Is your feature request related to a problem? Please describe.
I am drawing area plots one on top of the other, with yesterday's data ("wczoraj") with low opacity. I want this series to be drawn behind the series with today's data ("dziÅ›"), so it must be defined first in the YAML. This now means that in the legend, the less important series is listed first. This is a bit OCD, of course, but it would be nice to be able to reverse the legend.
Thanks for opening this issue. Unfortunately, this is how the library I use (ApexCharts) works. There's nothing I can do, sorry.
Maybe you can have a look at https://apexcharts.com/docs/options/legend/#inverseOrder .
Appreciate this is an old issue! But was there a way to use that inverseOrder option found? Thanks!
Appreciate this is an old issue! But was there a way to use that inverseOrder option found? Thanks!
Well, yes. Add any option you need in the apex_config
section. E.g.
type: custom:apexcharts-card
header:
show: true
title: my chart
standard_format: true
series:
- entity: sensor.xxx
name: xx
apex_config:
legend:
position: bottom
inverseOrder: true
chart:
height: 123px
Ah that is brilliant, thanks so much for the quick answer!
just to check, is there any option to change order in the header as well?