0👍
I was able to solve my issue with the chart-dataset-override attribute.
I updated the color setting for the array. In the example below I just overwrote the colors with red.
I plan to for loop through the array and set the values per the condition being true.
techid.datasetOverride = [
{
fill: true,
backgroundColor: [
"#D7D7D7",
"#D7D7D7",
"#D7D7D7",
"#D7D7D7",
"#D7D7D7",
"#D7D7D7",
"#D7D7D7"
]
},
{
fill: true,
backgroundColor: [
"#0169B4",
"#0169B4",
"#0169B4",
"#0169B4",
"red",
"#0169B4",
"red"
],
hoverBackgroundColor: [
"#0169B4",
"#0169B4",
"#0169B4",
"#0169B4",
"red",
"#0169B4",
"red"
],
borderColor: [
"#0169B4",
"#0169B4",
"#0169B4",
"#0169B4",
"red",
"#0169B4",
"red"
],
hoverBorderColor: [
"#0169B4",
"#0169B4",
"#0169B4",
"#0169B4",
"red",
"#0169B4",
"red"
]
}];
- Chartjs-Chart.js time series showing empty plot
- Chartjs-Chart.js: How to display object data types on line graph correctly?
Source:stackexchange.com