Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line and area chart not working since the version 2.1.0 #799

Open
4 tasks done
pes001 opened this issue Oct 21, 2024 · 1 comment
Open
4 tasks done

Line and area chart not working since the version 2.1.0 #799

pes001 opened this issue Oct 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pes001
Copy link

pes001 commented Oct 21, 2024

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser
  • I verified that I'm really running the lastest version in my browser console
  • I checked if there is another issue opened with the same problem

Describe the bug
Since updating to the verison 2.1.0 line and area chart doesn't work in my dashboard. Column type works as before.

Version of the card
Version: 2.1.2

To Reproduce
This is the configuration I used:
Configuration that doesn't work:

type: custom:apexcharts-card
span:
  start: day
series:
  - entity: sensor.current_spot_electricity_price
    type: line
    color: lightblue
    show:
      legend_value: false
    data_generator: |
      return Object.entries(entity.attributes).map(([date, value], index) => {
        return [new Date(date).getTime(), (value) ];
      });

Configuration that works:

type: custom:apexcharts-card
span:
  start: day
series:
  - entity: sensor.current_spot_electricity_price
    type: column
    color: lightblue
    show:
      legend_value: false
    data_generator: |
      return Object.entries(entity.attributes).map(([date, value], index) => {
        return [new Date(date).getTime(), (value) ];
      });

Screenshots
image

image

Expected behavior
Graphs of line type should appear as the column type ones

Desktop (please complete the following information):

  • Browser Chrome

  • Version 129.0.6668.101 (Official Build) (64-bit)

  • Browser Edge

  • Version 130.0.2849.46 (Official build) (64-bit)

Smartphone (please complete the following information):

  • Device: [iphone 13]
  • OS: [17.6.1]
  • Browser [edge, chrome, safari]

Additional context
Everything was correct in version 2.0.4.
It appears in both instances of Home assistant I have.

@pes001 pes001 added the bug Something isn't working label Oct 21, 2024
@pihiandreas
Copy link

I can confirm this bug, last functioning version is 2.0.4. (over one year old).
I found some apexcharts-card: TypeError: this.series is null and Uncaught (in promise) TypeError: this.w.globals.dom.Paper is undefined in the console log.
One theory could be that HomeAssistant has changed the availability of sensor-data (on load) and 2.1.x versions of apexcharts-card don't handle these situations. Apexcharts-card probably needs some mechanism to retry reading sensor-data without throwing an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants