How can I create a long tail chart with chart.js

👍:0

From my experience you would have to create a plugin since Chart.js does not have to my knowledge that functionality for the line chart, i.e. you can pass multiple background colors but they seem to be ignored.

A quicker perhaps more convenient option, is to use the bar chart which does allow you to specify the background colors along with a logarithmic scale.

👍:0

I found that I can pass a null value to create a similar effect with line chart:

datasets: [{
label: “My First dataset”,
backgroundColor: window.chartColors.blue,
borderColor: window.chartColors.blue,
data: [
null,
2000,
1000,
800,
380,
200,
0,
],
fill: true,
}, {
label: “My Second dataset”,
fill: true,
backgroundColor: window.chartColors.red,
borderColor: window.chartColors.red,
data: [
3000,
2000,
0,
0,
0,
0,
0
],

Leave a comment