ApexCharts card - A highly customizable graph card

good question, I’m interested in that too.
have you managed to solve it?

I just noticed when you export to CSV using the toolbox the values have a date stamp but no time stamp. Am I missing something?

Is there a way to overlay one column on top of another. I would like to do this for temperature max and min, like you can do with a line chart, but with columns, as the below pic has.

1 Like

could anyone please help me with data_generator. I need the value that is returned by this query to simply be multiplied by 4:

  return entity.attributes.forecast.map((entry) => {
    return [new Date(entry.datetime).getTime(), entry.precipitation];
  });

hi,

Providing your code works I would try something as below.:

  return entity.attributes.forecast.map((entry) => {
    return [new Date(entry.datetime).getTime(), (entry.precipitation * 4)];
  });
1 Like

I have an Apexcharts card set to show the last 6 hours with graph_span: 6h When I restart HA the data is lost and it starts over. Is there a setting that causes it not to see the sensor data prior to the restart?

type: custom:apexcharts-card
graph_span: 6h
show:
  loading: false
header:
  show: true
  title: Thermostat High and Low
series:
  - entity: sensor.thermostat_high
    stroke_width: 3
    color: rgb(198, 40, 40)
    curve: stepline
  - entity: sensor.thermostat_low
    stroke_width: 4
    curve: stepline
    color: rgb( 13, 71, 161 )

edit: I figured it out. If there hasn’t been a change within the beginning of the time frame the data just shows since there has been a change. Previously when looking a the data there hadn’t been changes. I noticed just a moment ago in a 24 hour graph there were periods where there were changes at the beginning and the end of the graph and in between there was a restart that caused some data to not display. To fix it I used fill_raw: last below the entity.

Without fill_raw: last
image

With fill_raw: last
image

thank you, works a treat :heart:

What is the sensors configuration.yaml code/settings ?

Apexcharts only displays the data which is in/retained by home assistant or from a external database like influx.

Does it display correctly in another card - (sensor card) ?

  #######Thermostat Target High#######
  - platform: template
    sensors:
      ###New sensor name
      thermostat_high:
        ####New friendly name
        friendly_name: "Thermostat Target High"
        ####New Unit of measurement
        unit_of_measurement: '°F'
        value_template: "{{ state_attr('climate.thermostat', 'target_temp_high') }}"
        ####New icon

#######Thermostat Target Low#######
  - platform: template
    sensors:
      ###New sensor name
      thermostat_low:
        ####New friendly name
        friendly_name: "Thermostat Target Low"
        ####New Unit of measurement
        unit_of_measurement: '°F'
        value_template: "{{ state_attr('climate.thermostat', 'target_temp_low') }}"
        ####New icon

The data is retained by HA through MariaDB. I have data retention set to default which is 10 days.

Yes, the default history-graph card displays the data correctly.

Hi, I experienced a strange behaviour with the pie chart: having history recording retention to 1 day, values that have not been updated during the last day are zero (appears last value for the sensor, but “No state history found” on the default HA history graph)
image
In the graph the sensor “main_energy_month_punta” the last recorded value es 4.8 kWh but there is no history data (it is purged every 24h):
image
How could I get the last known value? I looked at the data_generador examples but couldn’t find it for a single point (all examples show data series)

And second question, how can we access an attribute? I tried in another chart setting the attribute “last_period” but no luck even setting the update_delaySolved, data also appeared to be unavailable until fresh data was into HA history db.

Please try the latest beta. That should now be handled without requiring the recorder.

hi, I hope someone can help me, I need to create a graph with horizontal bars, which measures my weight in kg, by month, and shows me all the weighings I have made during the month.
I couldn’t do it, can you help me?

Thanks for the quick reply! Just installed the dev branch, will check next week after the tariff change

Hi, a quick question. Have been through all the options, not finding what im looking for.

I would like to have a graph showing the energy used by the floorheating in combination with 2 different temperatur readings. The graphs gives most value to me if it is over a full week. Problem is that the apexchart loads all the datapoints, hence takes a lot of time to load on the device.

In the minigraphs card, the option “points_per_hour: 1” solves the problem.

Im not able to find a similar possibility in apexcharts?

Would like to change to Apex as the layout is much more flexible, and I like the layout better. Are in the process of changing all my other graphs.

As was pointed out to you in another post, you need to show what you’ve tried: docs you’ve read, things you don’t understand, entities/sensors available, configs you’ve tried, or similar posts and examples seen on the forum.

Use

group_by:
  duration: 1h
  func: avg

This is all in the documentation on github.

Hi RomRider,

I have looked at, and tried the group_by. Should have mentioned, however did not see that as made to solve this problem. The group by works very well to make the graphs more smooth, a nice feature.

However. As I understand it still reads all the “points” to the client and do the math on the device. As there is a lot of “points” this takes way to long and put stress on the HA server. At least that is the behaviour on my devices

The “points_per_hour: 1” is just only reading 1 data point pr hour, hence loads much faster.

mini-graph-card and apexcharts-card work the same way:

  • They collect all the history from home-assistant from the period to display on the chart
  • do the compute (grouping) on the web browser (not adding any load on the server)
  • display the chart

points_per_hour is the same as group_by with a duration of 1h.

However, what is true is that apexchart-card is heavier compared to mini-graph-card and the reason is that is has A LOT more features. It will never be as fast.

Unfortunately not. I’ve gone with configuring all axes separatey.

It was solved by modifying THEME.
Thanks!

One more question
image

I want to hide the displayed text, is there a way?