I have a Angular 13 Chartjs 3.6 application that's given the above error in the following:
this.cryptoChart = new Chart(this.ctx, {
type: 'treemap', //'treemap',
data: {
datasets: [{
tree: this.treeData,
key: 'value',
groups: ['coin'],
spacing: 0.5,
borderWidth: 1.5,
*fontColor: 'Black',*
borderColor: "grey"
}],
},
options: {
maintainAspectRatio: false,
*legend: { display: false },*
tooltips: { enabled: false }
}
});
This is the full error message:
Type '{ tree: any; key: string; groups: string[]; spacing: number; borderWidth: number; fontColor: string; borderColor: string; }' is not assignable to type 'ChartDataset<"treemap", TreemapDataPoint[]>'.
Object literal may only specify known properties, and 'fontColor' does not exist in type 'ChartDataset<"treemap", TreemapDataPoint[]>'.ts(2322)
A similar error occurs on options..legend property.
I also have: import Chart from 'chart.js/auto'; import {TreemapController, TreemapElement} from 'chartjs-chart-treemap'; AND in
ngOnInit(){
Chart.register(TreemapController, TreemapElement);
this.coinChart = document.getElementById('coinChart');
this.ctx = this.coinChart.getContext("2d");
.......
.......
}
apparently I a missing a step in the integration....will appreciate any help.