Skip to content

Commit

Permalink
Strict bar config type
Browse files Browse the repository at this point in the history
  • Loading branch information
santam85 committed Feb 1, 2024
1 parent 156a16c commit 9fb84df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MatButton } from '@angular/material/button';
imports: [MatButton, BaseChartDirective],
})
export class BarChartComponent {
@ViewChild(BaseChartDirective) chart: BaseChartDirective | undefined;
@ViewChild(BaseChartDirective) chart: BaseChartDirective<'bar'> | undefined;

constructor() {
Chart.register(DataLabelsPlugin);
Expand All @@ -42,7 +42,7 @@ export class BarChartComponent {
},
},
};
public barChartType: ChartType = 'bar';
public barChartType = 'bar' as const;

public barChartData: ChartData<'bar'> = {
labels: ['2006', '2007', '2008', '2009', '2010', '2011', '2012'],
Expand Down

0 comments on commit 9fb84df

Please sign in to comment.