Hi David,
well in javascript I would put in the gradient as a fillstyle with a variable like so:
var gradientStroke = ctx.createLinearGradient(500, 0, 100, 0);
gradientStroke.addColorStop(0, "#80b6f4");
gradientStroke.addColorStop(1, "#f49080");
annotations: [{
...
backgroundColor: gradientStroke,
...
},
}...
But because this is not possible with koolreport, I am wondering how I can achieve that. I saw in the documentation (https://github.com/chartjs/chartjs-plugin-annotation) that in js there are eventhook possible and would maybe be something like this:
"onload" => "function (context) {
var ctx = document.getElementById('GET-ID-FROM-CONTEXT-OBJECT').getContext('2d');
var gradient = ctx.createLinearGradient(0, 0, 0, 100);
gradient.addColorStop(0, 'rgba(250,174,50,1)');
gradient.addColorStop(1, 'rgba(250,174,50,0)');
ctx.background.fillstyle = gradient;
}",
Koolreport is a really great tool, which we are planing to use for a long time, but it is hard for me to understand how to achieve this kind of tasks.
This would also solve the problem from the other post (https://www.koolreport.com/forum/topics/1846#p9844) because I would just fill in a annotation box in the background. That's why I posted this. A solution to this would solve multiple problems for me. Hope you can help.