Charts starts with zero
Currently, if you select data with 1-minute granularity, the WHERE conditions for time buckets do not respect the selected granularity. For example, when choosing 1m granularity, it does not select from the start of the minute to the end of the minute, but instead uses timestamps including seconds and milliseconds.
WHERE
(
TimeUnix >= fromUnixTimestamp64Milli (1758938282942)
AND TimeUnix <= fromUnixTimestamp64Milli (1758941882942)
)
that's why we have zeroes in the beginning of the charts.
If we add toStartOfInterval to time from and dateAdd to time to with specified granularity - that will fix an issue:
WHERE
(
TimeUnix >= toStartOfInterval(fromUnixTimestamp64Milli (1758938282942), INTERVAL 1 minute)
AND TimeUnix <= dateAdd(toStartOfInterval(fromUnixTimestamp64Milli (1758941882942), INTERVAL 1 MINUTE), INTERVAL 1 MINUTE)
)
Looking forward for comments; Thank you!
UPD
I found includedDataInterval in .ts files, but not sure if it configurable.
Hrmm it's not clear to me that it'd be a good idea to overwrite the user's time range setting to match with granularity by default. We could introduce an option to allow users to opt into it if they wish to do so (hide incomplete time intervals or something)
That makes sense, thank you sir.
This is a big problem for me because my chart values are very close together (say milliseconds).
So the huge difference between 0 and my values results in that the y-axis becomes tall and the chart becomes useless.
I would need the ability to hide incomplete intervals, or a way to force a y-axis range (for the pic below, I would want something like 2.8-3.0)
Thanks for the help!