I am using PrimeNG version 12 (with Angular 12 in tow) and chart.js version 3.3.2. I had gotten it to work with PrimeNG 11, but now it seems broken over there too. Any pointers as to what I could be missing?
component.ts
Code: Select all
totalViews = {
labels: ['Sept', 'Oct', 'Nov'],
datasets: [
{
type: 'bar',
label: 'Map',
backgroundColor: '#007EFF',
data: [1113239, 1335761, 1810865],
},
{
type: 'bar',
label: 'Search',
backgroundColor: '#78B7F8',
data: [5583419, 5397682, 6008726],
}
]
};
stackOptions = {
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true,
}]
},
};
Code: Select all
<p-chart
type="bar"
[data]="totalViews"
[options]="stackOptions"
></p-chart>