This gives a gap between the end of today and start of tomorrow on the graph.
I guess its because of “startsAt” ends at 23:00 on Today and starts at 00:00 on Tomorrow.
So sensor.power_consumption_grid is the red line and you are wondering why it is red?
If so, because you can only use threshold on line OR area. It is not applied to both.
Create the same entry twice and set stroke_width to 0 for the area and to 2 (or whatever) for the duplicate with type:line. This will create two curves that will combine to what you want.
If I misunderstood, please explain further.
P.S.: I am on my mobile but can post an example of mine tomorrow if unclear
Yes. The series still doesn’t join even though the offset sets them to meet at the same point on the x axis. Since the last value in today is not the same as the first value for tomorrow on the Y axis.
I guess the best way would be to strip and join the two objects in the array to get one series containing the data for today and tomorrow.
JavaScript is not my strong suit so I have no idea of how to manipulate json arrays in js.
Sorry, I understand now. Is there a reason why today’s data ends at 23:50 and not 24:00?
Where is the data coming from?
I also think you would need to merge both data sets into one. That way the line would be without the interruption.
But not sure how to merge to data sets in side Apexcharts.
P.S.: fill_raw: last probably doesn’t do anything, does it?
I’m trying to achieve something similar based on a weather entity. What I would like to display:
Temperature history
Temperature forecast high
Temperature forecast low
The graph spans 14 days (7 in the past, 7 in the future), and the idea would be to set temp forecast high to noon and temp forecast low to midnight, as well as join the temperature history (currently grouped by 2h average) via the data generator.
At the moment, I have the following for temp forecast high:
I would like to show the sum of the two as well (since that is, in the end, what I’m going to have to pay in total). Is there a way to add the energy price (“kraftpris”) and grid tariff (“nettleie”) directly in the chart, or should I rather set up another sensor for the sum?
please , can somebody explain me, how can I setup bar chart with day energy consumption?
From entity I can get total consumption and I think, i must use transform to compute consumption difference for every day.
They do work. Did you enable the experimental feature?
You need to edit the legend part also.
For 1. use card-mod
For 2. datalabels are to be set in show for each series.
Not possible for 1 entity unfortunately, that’s a limitation of the library I use.
You can use as_duration from the documentation. But if I remember correctly, it doesn’t apply to the datalabels (that is something I can add)
You should be able to use EVAL for that (check the documentation). I don’t remember if the hass object is available though… I’d need to check further.
You can use card-mod for that
No trick unfortunately, that’s how the library works
Please open a GH issue if you didn’t fix it
I’m not sure I understand what the issue is. Not that if there are gaps in the values (ie. some values are null, then color_threshold doesn’t work well.)
try this:
return entity.attributes.forecast.flatMap((entry) => {
let noon = new Date(entry.datetime).setHours(12, 0, 0, 0);
let midnight = new Date(entry.datetime).setHours(23, 59, 59, 99);
return [[new Date(noon).getTime(), entry.temperature], [new Date(midnight).getTime(), entry.templow]];
});
Can you please share your code for this one. It seems the example on the Github page for the HNT component. doesn’t work anymore as y_axis_precision: is depreciated. Thanks.
When I have more than one y-axis, the min value is allways set to 0. Therefore I experiment calculating that value by my own. my example sets the min to next 1.000 below and the max to the next 1.000 above the real values.
What I would like to to is something like set the tickAmount to the number of 1.000 between min and max.
I was afraid of that! I’ll poke around with the regular graph options, see if I can avoid the overlap between forecast and history that I’m currently having.