When rendering a time interval with incomplete data, the chart's x axis only shows the interval for which there is data:

This means that the axis boundaries and the bucket size jump on auto-reload as newly processed data come in.
The x axis is always scaled to match the selected interval.
@markov00 Would it be possible to get clarification about something regarding annotations in elastic-charts. I'm seeing a situation where series are rendering, but annotations aren't. This is in a sitation where all the values are 0, but even so I'd expect the annotations to render, and they do if I copy one of the simpler examples from the elastic-charts storybook page.
The chart in it's rendered form:

(My timezone is 1 hour ahead of the code snippets).
The time range:
Start: 1570688816594 // (Thursday, 10 October 2019 06:26:56.594)
End: 1570690141590 // (Thursday, 10 October 2019 06:49:01.590)
Which is fed to the settings component as xDomain={{ min: timeRange.startTime, max: timeRange.endTime }}.
The following data snippets focus on a single partition (redis.slowlog in this instance).
The series for the partition look as follows, and render correctly:
[
{
"time": 1570689000000, // Thursday, 10 October 2019 06:30:00
"value": 0
},
{
"time": 1570689900000, // Thursday, 10 October 2019 06:45:00
"value": 0
}
]
The anomaly entries for the partition look as follows:
Anomaly entry for bucket 1:
actualLogEntryRate 0
anomalyScore 7.39312
duration 900000
startTime 1570689000000 // Thursday, 10 October 2019 06:30:00
typicalLogEntryRate 55.67994661967715
Anomaly entry for bucket 2:
actualLogEntryRate 0
anomalyScore 8.252227
duration 900000
startTime 1570689900000 // Thursday, 10 October 2019 06:45:00
typicalLogEntryRate 55.67678191433922
The data for the above anomalies in annotation form look like the following:
{
coordinates: {
x0: 1570689000000 // Thursday, 10 October 2019 06:30:00
x1: 1570689900000 // Thursday, 10 October 2019 06:45:00
},
details: "Max anomaly score: 7"
}
{
coordinates: {
x0: 1570689900000 // Thursday, 10 October 2019 06:45:00
x1: 1570690800000 // Thursday, 10 October 2019 07:00:00
},
details: "Max anomaly score: 8"
}
However, despite there being series rendered on the chart, and annotations with overlapping x0 and x1 values, the annotations don't render. I initially thought this was just because of all the 0 values, but that's not the case with other examples. The chart code powering this lives here. Is there something I'm missing there?
Maybe we need to specify a minimum interval on the y axis as well? Like, always show at least [0, 1]?
Maybe we need to specify a minimum interval on the y axis as well? Like, always show at least [0, 1]?
Yep - that would work. But I'm still interested to know why other examples work without that 馃
@Kerry350 sorry for the late reply. I think that is a bug that needs to be solved on our end.
As identified by @weltenwort the problem is that the min value correspond to max value of your dataset. In that case, the chart max height is equal to the chart min height. A rectangle annotation is rendered using the existing data yScale (because if you want to can draw an annotation that with that start at a different y position). With this edge case the annotation is drawn but has 0 height.
Can you please open an issue in the elastic-chart repo https://github.com/elastic/elastic-charts to track that? thanks
FYI to have a better and quicker support for elastic-charts you can also ping the @elastic/elastic-charts team