Skip to content

Commit

Permalink
fix(admin-ui): Allow options to be passed to ChartComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jun 19, 2023
1 parent 36fe1a5 commit 161b757
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SimpleChanges,
ViewChild,
} from '@angular/core';
import { easings, LineChart, LineChartData } from 'chartist';
import { easings, LineChart, LineChartData, LineChartOptions } from 'chartist';
import { tooltipPlugin } from './tooltip-plugin';

export interface ChartFormatOptions {
Expand All @@ -32,6 +32,7 @@ export interface ChartEntry {
})
export class ChartComponent implements OnInit, OnChanges, OnDestroy {
@Input() entries: ChartEntry[] = [];
@Input() options?: LineChartOptions = {};
@ViewChild('chartDiv', { static: true }) private chartDivRef: ElementRef<HTMLDivElement>;
private chart: LineChart;

Expand All @@ -55,6 +56,7 @@ export class ChartComponent implements OnInit, OnChanges, OnDestroy {
offset: 1,
},
plugins: [tooltipPlugin()],
...this.options,
},
);

Expand Down

0 comments on commit 161b757

Please sign in to comment.