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

Specifying multiple fill types does not work when graph contains column plots and line or area plots #848

Open
DistractedPhysicist opened this issue Jan 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@DistractedPhysicist
Copy link

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 latest version in my browser console
  • [*] I checked if there is another issue opened with the same problem

Describe the bug
When specifying multiple fill types, the fill type is not applied correctly if the graph contains columns and either lines or areas. However, the fill types are applied correctly if the graph contains no columns or only columns. Based on my testing, it seems like what happens is that for columns, the application of the fill types resets back to the beginning of the list instead of picking up the next type on the list which is the expected behaviour (and the behaviour of all the other plot types).

Version of the card
Version: 2.1.2

To Reproduce
Here is a slightly modified version of the default card to demonstrate the issue. This should produce a line with solid fill and columns with gradient fill.

type: custom:apexcharts-card
header:
  show: true
  title: ApexCharts-Card
  show_states: true
  colorize_states: true
apex_config:
  fill:
    type:
      - solid
      - gradient
    gradient:
      type: vertical
      shadeIntensity: 0
      opacityFrom: 1
      opacityTo: 0.1
      stops:
        - 0
        - 90
        - 100
series:
  - entity: sensor.adguard_home_cpu_percent
    type: line
    data_generator: |
      // REMOVE ME
      const now = new Date();
      const data = [];
      for(let i = 0; i <= 24; i++) {
        data.push([now.getTime() - i * 1000 * 60 * 60, Math.floor((Math.random() * 10) + 1)])
      }
      return data.reverse();
  - entity: sensor.wireguard_cpu_percent
    type: column
    data_generator: |
      // REMOVE ME
      const now = new Date();
      const data = [];
      for(let i = 0; i <= 24; i++) {
        data.push([now.getTime() - i * 1000 * 60 * 60, Math.floor((Math.random() * 10) + 1)])
      }
      return data.reverse();

Screenshots
However, the above code produces a plot with no gradient applied to the columns:
Screenshot 2025-01-11 at 14 28 27

Changing type: column to type: area for the second entity produces exactly the expected result:
Screenshot 2025-01-11 at 14 44 43

Expected behavior
The columns should have gradient applied.

Desktop (please complete the following information):

  • Browser: Safari
  • Version: 17.6
@DistractedPhysicist DistractedPhysicist added the bug Something isn't working label Jan 11, 2025
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

1 participant