Hi @RomRider and thanks for card and support!
It is working fine.
I have a question - is it possible to change the datasource “on the fly”?
I have found (in ApexCharts docu) the “customIcons” in toolbar with the possible mapping to a function, but not sure how it could work here.
I want to click anything and change the URL (and reload the chart) in this code snippet:
data_generator: |
var data = [];
url = new URL("http://homeassistant.local:8123/local/data.csv");
function getValue(){
var request = new XMLHttpRequest();
request.open('GET',url,false);
...
return data1;
}
return getValue();
Hi, thanks for such a great card.
I am trying to graph the energy used every hour coming from some utility_meters, most days with good results, but one thay and another I get this graph:
At the change of day (hour 0) the chart calculates a negative ammount.
Here is the relevant config for the “grid vall” (green) meter:
type: custom:apexcharts-card
graph_span: 24h
span:
start: hour
offset: '-24h'
update_delay: 3s
update_interval: 1min
cache: true
header:
show: true
show_states: true
series:
- entity: sensor.energy_current_hour
name: solar sud
color: blue
fill_raw: 'null'
group_by:
duration: 1h
type: area
opacity: 0.1
stroke_width: 1
curve: stepline
- entity: sensor.main_energy_day_vall
name: grid vall
color: rgb(76,161,55)
fill_raw: last
group_by:
func: diff
duration: 1h
fill: last
type: area
opacity: 0.2
stroke_width: 1
curve: stepline
Any advice for solving this? (apart from limiting the y_axis to a min value of 0)?
I would like colors for certain y-values. I thought I could just use a fixed value sensor, like this:
type: custom:apexcharts-card
experimental:
color_threshold: true
series:
- entity: sensor.value_50
type: area
color_threshold:
- value: -10
color: blue
- value: 0
color: blue
- value: 20
color: green
- value: 40
color: orange
But this does not seem to work, the area color is always one solid color. I also tried to use transform: return 80, but this also does not work.
When I just change the sensor by an actual sensor, the coloring works. When I use transform on a sensor, it works when i do a ‘return x;’ but when I try ‘return x/2+50;’ the coloring does not work.
I have a chart with two series, (today & tomorrow) taken from a sensor that fetches prices from the web. There is a gap in the line chart when transitioning from today till tomorrow. Any suggestions on how to connect these two series without the gap? I’m guessing it is in the data_generator part but I’m not proficient enough to figure this out on my own.
I love this!! However I had a question, for the radial sensor, how do I add my own icon? Im not familiar with the coding here, how did u obtain the data:image/svg…etc.
Really great project, I like the charts!
I am using this for the gas prices of my local filling station. As this is shut down during the night, there is no data. I see that there is the possibility to fill the empty data, but I would just like to exclude it, basically taking out 22.00-6.00. I see the start and end option, but that seems to only work for one continuous timeline (start each morning from 6.00), not if I display multiple days.
Any way to achieve that?
I like to make these mini icons. Is it possible to decrease the space reserved for the header? I can do so already a bit by setting floating: true, but with this option the “action” is no longer working. Is it for example possible to have the graph span the entire card, with still overlaying the actual value and title?
is there no way to remove legends? I am making a power graph for devices in my home, and I don’t need legends when I can press them. I can only remove value, but not the legend it self which is a huge bummer
Hallo RomRider, thanks for this marvelous effort, I discovered this thread few weeks ago and I cant stop reading it. I need for my Lovelace dashboard st. like a combination of apex line chart and history graph… I have found some samples here at the forum and so far I succeded to implement it… as a sample this pic:
But the HA history graph itself doesn’t have the option for time span like you prepared in the apexchart integration… is it plz somehow possible to get it included also?
I have noticed in the apexcharts .js documentation there is a kind of graph called “Timeline chart - group series”
and I hope this graph might be used for this purpose(?)
The goal is to get in one graph both - the numeric values and also non-numeric values (such as DHW water tank states - like: charging, discharging, charged… etc. or service allerts, like “heatpump running”, “blocked” “waiting” … etc. to be able to track the temperatures and also the states back in time.
So far I have implemented dynamic “hours-to-show” option and I only succeeded to combine the custom minigraph and historygraph together as the best result. This of course doesnt have the span option, but looks a bit better than the previous sample of apex and history combined:
I also play a bit with the animation or blinking effect to visualize the current state a bit better.
It would be great to have the span option (instead of just dynamic “hours-to-show” like I have now) implemented and keep the look as much as this last sample graph.
(one more sample - switched to 48 hours, and mouse hover on the history graph to see the details…)