RomRider / apexcharts-card

📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant
MIT License
1.12k stars 78 forks source link

color_threshold missing since v2.1.2 #729

Open bwduncan opened 1 month ago

bwduncan commented 1 month ago

Checklist

Describe the bug Experimental color_threshold is not being rendered, graphs just come out grey.

Version of the card Version: 2.1.2

To Reproduce This is the configuration I used:

type: custom:apexcharts-card
experimental:
  color_threshold: true
header:
  show: true
  title: Next agile rates
stacked: false
graph_span: 23h
span:
  start: day
  offset: +24h
series:
  - entity: event.octopus_energy_electricity_REDACTED_next_day_rates
    type: column
    curve: stepline
    name: p/kWh
    group_by:
      func: first
      duration: 5m
    extend_to: false
    stroke_width: 3
    show:
      extremas: time
    color_threshold:
      - value: -100
        color: cyan
      - value: 0
        color: green
      - value: 20
        color: orange
      - value: 30
        color: red
      - value: 40
        color: purple
    data_generator: |
      return entity.attributes.rates.map((entry) => {
         return [new Date(entry.start), entry.value_inc_vat*100];
       });

Screenshots image

Expected behavior Until this week, when I upgraded to HA 2024.7.2 and apexcharts v2.1.2 the columns were coloured according to the thresholds, now they are all grey.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context The headers appear to be coloured correctly as the entity state changes over the day, but the chart remains grey.

bjornbak commented 1 month ago

I experience the same. My charts also lost their colors: image

arsenicks commented 1 month ago

Same here, adding another screenshot, sorry I'm on mobile. Screenshot_20240713_154821_Home Assistant

bwduncan commented 1 month ago

And just to confirm, reverting to version v2.0.4 fixes the issue and colours are shown according to the thresholds again. v2.1.0 and (unsurprisingly) v2.1.1 both have the bug. I've looked at the changelog for v2.1.0 and can't see any obvious commits that would be worth me looking more closely at.

Sorry I'm not a js person so that's the extent of my debugging ability!

knurrdog commented 1 month ago

btw: only column-charts are affected. When you use "type: line" color_threshold is working.

MCBrakel commented 3 weeks ago

+1 on this issue for column charts.

timdreier commented 1 week ago

+1

Chacsam commented 4 days ago

same issue here according to this comment on the HA forum it seems that a gray border has been added to the bars and covers the original color.