RomRider / apexcharts-card

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

Stacked 100% bar Graph for Multiple Entities #702

Open flautze opened 2 months ago

flautze commented 2 months ago

Checklist

Is your feature request related to a problem? Please describe. I want to replicate this display/bar from my Huawei App in Homeassistant (focus on the bar with the % values /or actual values) grafik However I have not found any possibility.

Describe the solution you'd like ApexCharts itself supports this feature. Its called 100% stacked bar. https://apexcharts.com/javascript-chart-demos/bar-charts/stacked-100/

I would like to have the possibility to use this as simple bargraph that shows 2 or more entities and sizes the bars according to their percentage.

Describe alternatives you've considered Alternative is Bar Card with Card-Mod (and Config-template-card), however I was not able to succeed so far.

Additional context With Donut chart I was able to build something that resembles what I would want as bar. I would love to be able to build this as bar - since on mobile devices the Donut takes up too much space. grafik

type: custom:apexcharts-card
chart_type: donut
header:
  show: true
  title: Stromnutzung (heute)
  show_states: true
  colorize_states: true
apex_config:
  fill:
    type: gradient
  dataLabels:
    formatter: |
      EVAL:function(value) {
        return value.toFixed(0) + " %";
      }
  legend:
    show: false
  plotOptions:
    pie:
      startAngle: -180
      endAngle: 180
      donut:
        labels:
          show: true
          total:
            show: true
            label: Produktion
            formatter: |
              EVAL:function(w) {
                return w.globals.seriesTotals.reduce((a, b) => {return (a + b)} , 0).toFixed(1) + " kWh"
                }
series:
  - entity: sensor.home_selfuse_energy_daily
    name: Eigenverbrauch
    float_precision: 1
    color: darkgreen
  - entity: sensor.grid_export_energy_daily
    name: Einspeisung
    float_precision: 1
    color: lightgreen
github-actions[bot] commented 1 week ago

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.