score:0

Accepted answer

the chart constructor expects a valid config (of type chartconfiguration).

use this type and try to meet the conditions (typescript will know the config type is a union).

import { chartconfiguration } from "chart.js";

const config: chartconfiguration = {
  type: 'line',
  data: datasets,
  options: { }
}

Related Query

More Query from same tag