score:0

Accepted answer

note: this is how i do it without ng2-charts,

i create the chart as explained on the charts.js documentation :

 this.chart =  new chart(
        "canvas",
        {...
        }

and then, after that, i add the gradient

const ctx = this.chart.ctx;
const height = this.chart.height;
const gradient = ctx.createlineargradient(0, 0, 0, height);
gradient.addcolorstop(1, "rgba(128, 182, 244, 0.6)");
gradient.addcolorstop(0, "rgba(255, 255, 255, 0.6)");
this.chart.data.datasets[0].backgroundcolor = gradient;

Related Query

More Query from same tag