apexcharts-card icon indicating copy to clipboard operation
apexcharts-card copied to clipboard

color_threshold not adapted for locale settings

Open gigatexel opened this issue 2 years ago • 2 comments

Checklist

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

Describe the bug !! experimental feature

My PV-system outputs a sensor that uses the locale setting for decimal (point). The experimental color_threshold feature does not take this point into account

image

Version of the card Version:

To Reproduce This is the configuration does not work:

        color_threshold:
          - value: 250
            color: '#FF8E15'
          - value: 500
            color: '#FAB733'
          - value: 1250
            color: '#ACB334'
          - value: 1750
            color: '#69B34C'

This is the configuration does not work:

        color_threshold:
          - value: 0.250
            color: '#FF8E15'
          - value: 0.500
            color: '#FAB733'
          - value: 1.250
            color: '#ACB334'
          - value: 1.750
            color: '#69B34C'

gigatexel avatar Sep 16 '22 12:09 gigatexel

The point is just a display feature on the chart. A number should be expressed without any formatting in the configuration as it is the case for any other piece of configuration in Home Assistant.

RomRider avatar Sep 22 '22 08:09 RomRider

You are right, I was on the wrong path,but still it does not work as expected.

type: custom:stack-in-card
cards:
  - type: custom:apexcharts-card
    experimental:
      color_threshold: true
    chart_type: radialBar
    series:
      - entity: sensor.pv_power_numeric
        color_threshold:
          - value: 0
            color: blue
          - value: 1500
            color: cyan
          - value: 1700
            color: green
          - value: 2000
            color: orange
        max: 2610
        show:
          legend_value: false
    apex_config:
      plotOptions:
        radialBar:
          offsetY: 0
          startAngle: -108
          endAngle: 108
          hollow:
            size: 70%
          dataLabels:
            name:
              show: false
            value:
              show: false
          track:
            strokeWidth: 80%
            margin: 0
      fill:
        type: solid
      legend:
        show: false
      chart:
        height: 240
  - type: custom:mushroom-entity-card
    entity: sensor.pv_power_numeric
    primary_info: state
    secondary_info: name
    name: Vermogen
    icon: mdi:lightning-bolt
    icon_color: green
    layout: vertical
    card_mod:
      style: |
        ha-card {
          margin-top: -90px;
          width: 140px;
          margin-left: auto;
          margin-right: auto;
        }

Always colors blue in radialBar. Works as expected in other chart types

image

gigatexel avatar Sep 22 '22 11:09 gigatexel

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Oct 23 '22 03:10 github-actions[bot]

Someone else seeing this?

gigatexel avatar Oct 24 '22 07:10 gigatexel

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Nov 25 '22 02:11 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Dec 06 '22 02:12 github-actions[bot]