Open AnMakc opened 9 months ago
When min and max are specified for Y-axis, data points with values out of this range should still be included in the Time Cartesian Axis range.
min
max
Following chart
{ type: 'line', data: { datasets: [{ data: [ { x: '2024-01-06 07:00:00', y: 0 }, { x: '2024-01-06 08:00:00', y: 2 }, { x: '2024-01-06 09:00:00', y: 4 }, ]}]}, options: { scales: { x: { type: 'time' }, y: { min: 0, max: 3 }, }} }
Should be displayed as follows
Note that X-axis range is [7:00, 9:00].
It is however displayed as follows
Note that X-axis range is [7:00, 8:00].
It could be fixed either by
category
suggestedMax
2021-11-06 09:00:00
https://stackblitz.com/edit/line-chart-5yxrkz?file=app%2Fapp.component.ts
No response
I was adding manual Y-axis range controls in HomeAssistant history graphs: https://github.com/home-assistant/frontend/pull/19297 Data values out of the specified range led to unexpected behaviour where some of data were not displayed at all.
v4.4.1
Expected behavior
When
min
andmax
are specified for Y-axis, data points with values out of this range should still be included in the Time Cartesian Axis range.Following chart
Should be displayed as follows
Note that X-axis range is [7:00, 9:00].
Current behavior
It is however displayed as follows
Note that X-axis range is [7:00, 8:00].
It could be fixed either by
category
suggestedMax
to2021-11-06 09:00:00
Reproducible sample
https://stackblitz.com/edit/line-chart-5yxrkz?file=app%2Fapp.component.ts
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
I was adding manual Y-axis range controls in HomeAssistant history graphs: https://github.com/home-assistant/frontend/pull/19297 Data values out of the specified range led to unexpected behaviour where some of data were not displayed at all.
chart.js version
v4.4.1
Browser name and version
No response
Link to your project
No response