RomRider / apexcharts-card

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

float_precision is not manipulating decimals palces of yaxis-values #708

Open Manuel1948 opened 1 month ago

Manuel1948 commented 1 month ago

Checklist

Describe the bug If I enter a value for float_precision, the 5 values on the y-axis has the precision of the entity and not of the wanted floaat_precision.

Version of the card Version: 2.0.4

To Reproduce This is the configuration I used:

header:
  show: true
  title: Klimaanlage Stromverbrauch
  show_states: true
  colorize_states: true
series:
  - entity: sensor.klimaanlage_current_power
    type: line
    color: '#3b719c'
    float_precision: 0
    stroke_width: 2
    curve: stepline
    show:
      name_in_header: false

Screenshots image

Expected behavior The amount of decimal places of the y-axis should be the float_precision-value.

RomRider commented 5 days ago

That is expected as if you have multiple series, they might not all have the same float precision. However, there's a config option to do so https://github.com/RomRider/apexcharts-card?tab=readme-ov-file#yaxis-options-multi-y-axis

header:
  show: true
  title: Klimaanlage Stromverbrauch
  show_states: true
  colorize_states: true
yaxis:
  - decimals: 0
series:
  - entity: sensor.klimaanlage_current_power
    type: line
    color: '#3b719c'
    float_precision: 0
    stroke_width: 2
    curve: stepline
    show:
      name_in_header: false