Chartjs-ChartConfiguration missing 'time' parameter in 'options.scales.x'

0👍

Not a perfect solution because it uses a cast to any but as a quick fix, you can try the following:

import { ChartConfiguration, TimeScaleOptions } from 'chart.js';

...

ngOnInit() {
  const xScaleOptions: TimeScaleOptions = <any>this.chartConfig.options.scales.x;
  xScaleOptions.time.unit = 'week';
}

Leave a comment