[Chartjs]-Chart.js with Angular component – Type 'string' is not assignable to type 'ChartTitleOptions | undefined'

1πŸ‘

βœ…

The title property does not take a string for the options. Instead it takes an object where you can configure things about the title including the string.
So your config will look like this:

options: {
  title:{
    display: true,
    text: 'TitleText to display'
  }
}

Documentation: https://www.chartjs.org/docs/2.9.4/configuration/title.html

Leave a comment