I am working on a code where I need to fill the datasets with the property isProjected set to 1. There are 3 datasets - lower estimate, projected, and upper estimate. The goal is to fill the Lower Estimate and Upper Estimate with a background color of rgba(252, 0, 47, 0.2) while leaving the Projected dataset unfilled (fill: false). However, the current code fills all 3 datasets. "Upper Estimate" should be filled with -1, "Lower Estimate" with +1, and "Projected" left unfilled.
This is what I have attempted so far. Here is the buildChart config code:
buildChartConfig(data: DataConfig): ChartConfiguration {
const newData: ChartData = { ... }
...
This is the dataset defaults code:
export const datasetDefaults = (value, index, colorType) => {
...
And this is the code snippet that assigns the isProjected property a value of 1:
[...datasets, { ... }]