I try to move the legend of a pie chart(created with Chart.js 2.0) to left or right, but I always get an error. The bottom and top option works.
var myChart = new Chart(ctx, {
type: 'pie',
data: {
labels: optionLabels,
datasets: [{
label: '# of Resources',
data: optionData,
backgroundColor: optionColor,
borderColor: "white",
borderWidth: 1,
}]
},
options: {
legend: {
position: 'left'
}
}
});
Is there a library bug or something similar?
Seems like you are using an old version of ChartJS (which might have this bug).
Make sure you use the latest version of ChartJS, which is
2.7.0
at-the-moment.see a working example.