ioBroker/ioBroker.echarts

Bar charts with wrong monthly interval

Norb1204 opened this issue · 1 comments

There are shiftings when looking at a longer period of time with values that were created at the end of the month (with Flot this works).
Since a month has between 28 and 31 days, this does not work here with the intervals that are probably set to 30 days in the Auto setting.

Sample values for testing:
timestamp, value
2021-12-31T22:58:00.200Z, 311310
2022-01-31T22:58:00.055Z, 326486
2022-02-28T22:58:00.046Z, 315371
2022-03-31T21:58:00.098Z, 306648
2022-04-30T21:58:00.046Z, 284649
2022-05-31T21:58:00.051Z, 280660
2022-06-30T21:58:00.079Z, 261538
2022-07-31T21:58:00.044Z, 223407
2022-08-31T21:58:00.175Z, 233983
2022-09-30T21:58:00.105Z, 191090
2022-10-31T22:58:00.032Z, 256817
2022-11-30T22:58:00.180Z, 267888
2022-12-31T22:58:00.076Z, 277355
2023-01-31T22:58:00.042Z, 300691
2023-02-28T22:58:00.376Z, 209572
2023-03-31T21:58:00.051Z, 262541
2023-04-30T21:58:00.313Z, 463820
2023-05-31T21:58:00.115Z, 438150
2023-06-30T21:58:00.335Z, 439927
2023-07-31T21:58:00.136Z, 41002

echarts

For the month August, you can see the shift in the hover details (data from 07/31/2023, hover details from 08/22/2023).
The months in the X-axis are shown incorrectly (e.g. 0.2022).
I also cannot zoom or scroll a bar chart.

I noticed that everything is generally shifted. Data at the end of an hour, day or month will be displayed in the next hour, day or month. I assume that there is a common problem.

I hope I was able to describe the problem properly.

BR
Norbert

I have exactly the same issue. I am logging the reading of my gas meter.

Based on this data, I want to create a bar chart showing the difference of the data:
image

Issue 1: When I configure the time to "end of this month" (should be end of October) and 6 month to show, the diagram ends next month (November):

image

Issue 2: As Norbert wrote before, the bars do not correspond to a month, but a 30 day period. Thus, as month have between 28 and 31 days, some days are shifted between the month and the result is wrong.

Example 1: When hovering over the May bar, the data shown corresponds to the May 31, which is correct:
image

Example 2: June also correctly corresponds to June 30:
image

Example 3: July incorrectly refers to July 30 (should be July 31):
image

Example 4, jumping to September, the data is only accumulated in the September bar until September 28:
image

Instead of 30-day-intervals, the aggregation must be done on a monthly basis.
I am a beginner here, but I assume, that can be done by data transformation described here