"#949FB1",
"#4D5360",
],
+ label: 'Dataset 1'
}, {
hidden: true,
data: [
"#949FB1",
"#4D5360",
],
+ label: 'Dataset 2'
}, {
data: [
randomScalingFactor(),
"#949FB1",
"#4D5360",
],
+ label: 'Dataset 3'
}],
labels: [
"Red",
position: 'top',
title: {
display: true,
- text: 'Our 2 Favorite Datasets'
+ text: 'Our Favorite Datasets'
}
},
}
var newDataset = {
backgroundColor: [],
data: [],
+ label: 'New dataset ' + config.data.datasets.length,
};
for (var index = 0; index < config.data.labels.length; ++index) {
beforeBuildLabels: helpers.noop,
buildLabels: function() {
- // Convert ticks to strings
this.labels = this.chart.data.datasets.map(function(dataset) {
return this.options.labels.callback.call(this, dataset.label);
}, this);
if (dataset.hidden) {
// Strikethrough the text if hidden
ctx.beginPath();
+ ctx.lineWidth = 2;
ctx.moveTo(this.options.labels.boxWidth + (this.options.labels.fontSize / 2) + cursor.x, cursor.y + (this.options.labels.fontSize / 2));
ctx.lineTo(this.options.labels.boxWidth + (this.options.labels.fontSize / 2) + cursor.x + textWidth, cursor.y + (this.options.labels.fontSize / 2));
ctx.stroke();