minY/maxY was missing

This commit is contained in:
Patrick Haßel 2025-11-21 09:57:39 +01:00
parent dc7e57f341
commit 9f24ea08ae

View File

@ -73,10 +73,7 @@ export class EnergyCharts implements AfterViewInit {
}, },
bounds: 'ticks', bounds: 'ticks',
}, },
y: { y: {},
max: this.maxY,
min: this.minY,
}
}, },
interaction: { interaction: {
mode: 'index', mode: 'index',
@ -134,8 +131,13 @@ export class EnergyCharts implements AfterViewInit {
this.data.datasets.length = 0; this.data.datasets.length = 0;
const xScale = this.chart?.chart?.options?.scales?.['x']; const xScale = this.chart?.chart?.options?.scales?.['x'];
if (xScale) { if (xScale) {
xScale.min = result ? result.begin.getTime() : undefined; xScale.min = result.begin.getTime();
xScale.max = result ? result.end.getTime() - (this.interval?.inner?.millis || 0) : undefined; xScale.max = result.end.getTime() - (this.interval?.inner?.millis || 0);
}
const yScale = this.chart?.chart?.options?.scales?.['y'];
if (yScale) {
yScale.max = this.maxY;
yScale.min = this.minY;
} }
const energyPurchase = result.series.filter(s => s.series.id === location.energyPurchase?.id)[0] || null; const energyPurchase = result.series.filter(s => s.series.id === location.energyPurchase?.id)[0] || null;
const energyDeliver = result.series.filter(s => s.series.id === location.energyDeliver?.id)[0] || null; const energyDeliver = result.series.filter(s => s.series.id === location.energyDeliver?.id)[0] || null;