Hello all, I’ve created a chart page and added 4 timeseries. Now I have a strange behavior on my x-axis, the time axis. The ticks are set but not evenly spaced.
How can I solve this? I’ve included the code and a screenshot below.
I don’t really know what’s going here. I’ve never seen anything like it, but here are some possible things to look at.
What version of OH are you running? If you are on an old version can you update see if this is a bug that has already been fixed?
What persistence strategy are you using and how is it configured? My gut feeling is that the most likely issue here has something to do with the data that are being returned from persistence.
The chart system uses apache eCharts so you could also look around those help docs and forums. If there’s a a solution to the problem there we can probably figure out how to make it work in OH.
One of the temperatures (Buiten temperatuur = OutsideTemperature) is not in the Temperatures group (glitch while building the configuration it seems). So it’s saved every 5 minutes. The other temperatures are at everyChange which happens every minute.
Here is a query result for the OutsideTemperature coming from the database:
You can’t indeed define xAxis in the “root” component options because those are normally handled by subcomponents. Currently the way it’s done is you have options you defined at the root level and then those configured with subcomponents redefine sections, taking precedence. You have the list of sections here, below ...chartConfig:
There could be a better “merging” mechanism of options so that those you define would still be considered.
I feel a bit stupid for not trying that out myself
The chart still feels strange because the axis ticks are not evenly spaced and I would expect dates as labels when the chart spans a timeseries of multiple days. But now that I know how to use echarts parameters, I’ll look for the solution there and report back here when I found a solution.