score:6

Accepted answer

i've found a solution by myself. i wasn't aware that there are different versions of chart.js

i am using v2.0 and there exists a property named pointbackgroundcolor

var ctxline = document.getelementbyid("linechart").getcontext('2d');
linechart = new chart(ctxline, {
type: 'line',
data: {
     labels: dates,
     datasets: [{
           data: ['...'],
           backgroundcolor: "rgba(52,152,219,0.4)",
           pointbackgroundcolor: "#fff"
       }]
}
});

score:1

it looks like chart.defaults.global.elements.point.backgroundcolor only takes a single color string.

i don't believe would be possible to have different colored points. here is the documentation page for it.

i tried to plug in an array into that backgroundcolor property but it defaulted to a different color. have a look at this fiddle, if you want to play around.

you could always submit a feature request.


Related Query

More Query from same tag