I have this problem that my linechart has an black background while barchart works fine.
Here is my code:
let colors = getGradientColors(...colorPalette[key]);
let gradient = ctx.createLinearGradient(0, 0, 0, gradientHeight);
console.log(gradient, colors.full, colors.transparent, gradientHeight);
gradient.addColorStop(0, colors.full);
gradient.addColorStop(1, colors.transparent);
let dataset: ChartDatasetExtended = {
label: t("community.group." + key) || "",
//@ts-ignore
//TODO: Check later TS error
data: data[key],
borderColor: colors.line,
fill: true,
backgroundColor: gradient,
borderWidth,
cubicInterpolationMode: "monotone",
tension: 0.4,
gradientColor: colors,
};
The console.log output you can see inside the image.
Barchart works fine with this code, while this linechart is just black.