Jukka Kurkela 4eb59454be
Allow styling of line segments (#8844)
Allow styling of line segments

* docs & sample
* Types
* update sample
2021-04-08 18:02:12 -04:00

23 lines
503 B
JavaScript

module.exports = {
config: {
type: 'line',
data: {
labels: ['a', 'b', 'c', 'd', 'e', 'f'],
datasets: [{
data: [1, 3, NaN, NaN, 2, 1],
borderColor: 'black',
segment: {
borderColor: ctx => ctx.p0.skip || ctx.p1.skip ? 'red' : undefined,
borderDash: ctx => ctx.p0.skip || ctx.p1.skip ? [5, 5] : undefined
}
}]
},
options: {
scales: {
x: {display: false},
y: {display: false}
}
}
}
};