aside form the colors threshold colors (the lower colors are too light), id love to have those bars we wider, and leave less whitespace. Is there some default config setting for that, or do I simply need to set the stroke_width to a higher number.
figured the columnWidth: 100% should be doing that, but apparently not.
I can set the
stroke:
width:
global option, because then it also makes the secondary line fat and I want that to be a thinner line. like in
more like this, whihc I copied at first, but still showed very thin bars…
still dont get the legend to be 0 on Solar power though. does this not find the value in the data object maybe?
btw, can we set the left Y-axis scale to use the same numbers as I set in the color_thresholds, this is a bit random somehow…
yeah, the second of your post above I get
and I had already seen and changed that into:
data_generator: |
let res = []; for (const [key,value] of
Object.entries(entity.attributes.watts)) {
res.push([new Date(key).getTime(),value]);
} return res;
however, on your first remark on the variable not being defined in
The line const myArray = Watts.split(" ");. means, take the string (it only works on strings) from Watts and split in into a list on every space.
You are correct let Watts would define the variable, and let Watts = [] would fill that variable with an empty list. But there isn’t any actual data there, only an empty list. So you would need a function to fill the variable Watts with a string of data.
The function list.map(x)=>{}, it is the same as a for loop: for x in list. Within the {} you can use the value x.
We know the value x will consist of two fields: a time and a value. Thats what the const [key, value] means. It says to not return the values as one variable x, but as two separate variables a key and a value.
Is there anything you would still like to accomplice?
For some reason this one stays completely empty on my wallmount iPad Air 2 (ios maxed at 15.7.3). Other ApexCharts do show. Is this known or is there something wrong in my code?
For reference, the chart does show on iphone devices with ios 16 and Windows / MacOS devices.
I guess I would like to use the simplest, of, rephrase, most economical of generators. If any difference at all.
since I can only get the
data_generator: |
let res = []; for (const [key,value] of
Object.entries(entity.attributes.watts)) {
res.push([new Date(key).getTime(),value]);
} return res;
to do what is required, I seem to have no choice, but, you might yet see a better way of converting those KVP and feeding them to the apex-chart.
If that were the case, Id be very interested.
one other detail:
my data refreshes each hour, but the secondary (now) entity is a life updating entity. Updating the apex-chart per hour as I do, might require some further customizing of the handling of that entity in the chart?
I know I can use tickAmount to set a fixed amount of ticks, but depending on the series values I often end up like below. What I would like to have is in the exmaple below even “5 ticks”, so for the right series “0, 5, 10, 15…”. Is that possible somehow? I can change tickAmount and get it to look good, but when sensors increase/decrease this all changes again. Not sure what to search for:)
@Mariusthvdb which integration offers you that sensor (solar forecast estimate watts) ? I have [Forecast.Solar] installed as integration but don’t have that sensor.
And that would be very reasonable, of course. Now I don’t agree iOS 15.7.2 isn’t modern, but if it lacks certain features to show the charts that’s fine and nothing anyone can help. I hoped to find an explanation of why some charts do work and some don’t so I can change my charts to work. Never the less; thanks for your reply and help.
color changed to #ffa500
added min: 0
altered the retrun code
removed yaxis section
Saved, the values have changed a bit, which is fine. Unfortunately, the iOS device still shows nothing. It’s just completely empty. To clarify, there are no values, so the yaxis and xaxis are there, but no values.