ApexCharts card - A highly customizable graph card

Cannot compare as you have different y-axis and you hide these values (why?)
EDIT: there are a few issues reported so have a look there.

1 Like

They are actually all the same. The origional is here, maybe that will help:
image
To create this graph all I’ve done is take the “group_by” and “func” out and the “chart; stacked” out

Nope…your 2nd stack starts from 0

It is the exact same data. It is probable that there is no data there as the blue line didn’t exist until just after 1400. The data is identical in all 3 graphs, just the YAML configuration is different

OK…well…look at the tickets
RomRider/apexcharts-card: :chart_with_upwards_trend: A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant (github.com)

oh that’so sad :frowning:

Hi everyone,

I finally had some time to play with my ApexCharts card and found that entities that still exist in the database but are not longer part of Home Assistants entities, cannot be displayed in ApexCharts card.

I get the error that the entity is not available. However, using the History dashboard I can display the data of that very same entitiy.

Is this a built-in check to see if the entity is valid? And if so, can this be disabled somehow?

Hi all,

I tried to use the radialBar in a completely different way I suppose.
I want to highlight the distance a lightning strike occurs and managed to do so after lots of trial and errors.
image

Now I would like to have a custom legend showing what distance each color represents, is this possible? I would prefer to not use card-mod if possible.

Share code maybe?

here we go, never mind the Number in the transform, it isn’t necessary.

type: custom:apexcharts-card
header:
  show: true
  show_states: true
  colorize_states: true
chart_type: radialBar
show:
  last_updated: false
apex_config:
  plotOptions:
    radialBar:
      offsetY: 0
      startangle: 0
      endangle: 360
      hollow:
        size: 5%
    dataLabels:
      name:
        show: false
      value:
        show: false
  legend:
    show: false
all_series_config:
  min: 0
  max: 1
  show:
    in_header: false
    in_chart: true
  unit: km
series:
  - entity: input_number.test_lightning_distance
    transform: 'return (Number(x)>25) ? x : 0;'
    color: lightgreen
  - entity: input_number.test_lightning_distance
    transform: 'return (Number(x)>20 && Number(x)<=25) ? x : 0;'
    color: darkgreen
  - entity: input_number.test_lightning_distance
    transform: 'return (x>15 && x<=20) ? x : 0;'
    color: yellow
  - entity: input_number.test_lightning_distance
    transform: 'return (x>10 && x<=15) ? x : 0;'
    color: orange
  - entity: input_number.test_lightning_distance
    transform: 'return (x>5 && x<=10) ? x : 0;'
    color: red
  - entity: input_number.test_lightning_distance
    transform: 'return x<=5 ? x : 0;'
    color: purple

I didn’t know how to draw a full circle for each range so resorted to setting them zero if out of range.

1 Like

And what are the expectations wrt to legend then?
‘Custom’ is limited to what Apex can provide as you understand
EDIT: for lightning distances this is a bit of an odd way of presenting (or maybe I am missing the point). It will always be in % as 100% is the full circle

Agree it might be odd. It’s just for graphical purposes where you would see the thunderstorm closing in or out or just passing by at distance. The percentages don’t reflect anything at all. I do intend to add a direction of movement, that is closing in/out.
In the ideal world I would create a dedicated card for this but haven’t got time to do so for the next 8 months or so and would need to learn how to as I’m only familiar with C programming.

Anyhow I understand it will not be possible to add some text to the apex card so used some tiles to make it work for now. Maybe when the new badges can be used at the top of a section that would be a better option.

But the 5km one will only show a very small increase vs. the 30km-away … I guess I still not see the use for it :slight_smile: but you have a way forward
EDIT : if you are using blitzortung you can also picture them on a map, which I found informative too :slight_smile:

Hey folks… have look high and low on threads and forms but cannot find the answer I am looking for!

Have a apex card that is supposed to have four values, the Load, Battery In and Grid Out and the Total Solar in the middle of the donut, the first three there are no problems with. But the total solar which I implemented as a label is where my headache starts. Have them all aligned and ready to go but I cannot seen to find the right way to tell the lable that I want to use states(‘sensor.edb_i1_mppt_total_energy_out_daily’) as the default value for the center label.

My current config

type: custom:apexcharts-card
chart_type: donut
header:
  show: true
  title: Solar Utilization Today
  show_states: true
  colorize_states: true
apex_config:
  chart:
    toolbar:
      show: false
      autoSelected: zoom
  stroke:
    width: 1
    curve: smooth
  legend:
    show: false
  plotOptions:
    pie:
      donut:
        labels:
          show: true
          total:
            show: true
            label: Total Solar
            formatter: |
              EVAL:function(w) {
                return w.globals.seriesTotals.reduce((a) => {return (a)}).toFixed(2) + " kWh"
                }
            color: orange
  responsive:
    - breakpoint: 10000
      options:
        chart:
          height: 360px
series:
  - entity: sensor.edb_i1_mppt_total_energy_out_daily
    name: Solar
    color: orange
    float_precision: 2
    show:
      in_chart: false
      in_header: false
  - entity: sensor.edb_i1_load_energy_daily_total
    name: Load
    color: cyan
    float_precision: 2
  - entity: sensor.edb_i1_battery_energy_in_daily_utility_meter
    name: Battery In
    color: pink
    float_precision: 2
  - entity: sensor.edb_i1_grid_energy_out_daily_total
    name: Grid Out
    color: steelblue
    float_precision: 2
view_layout:
  grid-area: m6
card_mod:
  style: |
    ha-card { 
      --ha-card-background: transparent;
      border-style: none;
    }

You should see that the above image the loads value, have attempted a ghost value for the solar as well see the config?! any help would be greatly appreciated

Hello,
I have sensor (history stats ) that shows how long my PC is turned ON.
obraz

obraz

Then I have created next helper that round that time to whole mins:

{% set total_hours = states('sensor.xamrex_stacjonarny_home') | float %}
          {% set total_minutes = total_hours * 60 %}
          {% set rounded_minutes = (total_minutes / 1) | round %}
          {% set rounded_hours = rounded_minutes / 60 %}
          {{ rounded_hours }}

obraz

then I m using that code to show bar graph:

type: custom:apexcharts-card
graph_span: 1w
span:
  end: day
header:
  show: true
  title: XamreX Stacjonarka ON
series:
  - entity: sensor.czas_dec_xamrex_stacjonarny_home
    type: column
    show:
      as_duration: hour
    group_by:
      func: last
      duration: 1d

but even in that case, sometimes it shows ms, like here:
obraz

is there any way to get rid of displaying those ms?

Hi to all,

Is it possible to set a background color other than the default HA theme , and how to?,

Thanks in advance,

Jose

Solved with:

apex_config:
  chart:
    background: '#FFFFFF'

how to hide it?

type: custom:apexcharts-card
graph_span: 24h
experimental:
  color_threshold: false
apex_config:
  chart:
    height: 200px
  grid:
    show: false
header:
  show: false
yaxis:
  - min: '|-0.1|'
    max: '|+0.1|'
    decimals: 1
    show: false
all_series_config:
  float_precision: 2
series:
  - entity: sensor.pressure_mmhg_pogoda_ulitsa_pressure
    show:
      extremas: true
      in_header: false
      name_in_header: true
      in_chart: true
    name: pressure
    type: area
    curve: smooth
    extend_to: end
    stroke_width: 2
    opacity: 0.2
    color: '#90bfff'
apex_config:
  xaxis:
    axisborder:
      show: false
    axisTicks:
      show: false
    labels:
      show: false
2 Likes

Great!
Does the white stripe always remain?