Browse Source

fix(ui): improve type safety of line chart data

pull/8050/head
KenTandrian 2 weeks ago
parent
commit
b473c0f2e7
  1. 5
      libs/ui/src/lib/line-chart/line-chart.component.ts

5
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -27,6 +27,7 @@ import {
import {
type AnimationsSpec,
Chart,
type ChartData,
Filler,
LinearScale,
LineController,
@ -167,7 +168,7 @@ export class GfLineChartComponent
gradient.addColorStop(1, getBackgroundColor(this.colorScheme));
}
const data = {
const data: ChartData<'line', (number | null)[]> = {
labels,
datasets: [
{
@ -208,7 +209,7 @@ export class GfLineChartComponent
this.chart.update();
} else {
this.chart = new Chart(this.chartCanvas.nativeElement, {
this.chart = new Chart<'line'>(this.chartCanvas.nativeElement, {
data,
options: {
animations: this.isAnimated ? animations : undefined,

Loading…
Cancel
Save