/
githubmirror
/
Chart.js
Обзор
Документация
Войти
/
githubmirror
/
Chart.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixtures/controller.line/segments/spanGaps.js
31 строка
778 B
Jukka Kurkela
Fix segment styling with gaps (#9644)
13 сен 2021, 23:31
Не верифицирован
13 сен 2021, 23:31
183a1a9
Код
Авторство
О чём код?
module.exports = { config: { type: 'line', data: { labels: ['a', 'b', 'c', 'd', 'e', 'f'], datasets: [{ data: [1, 3, null, null, 2, 1], segment: { borderColor: ctx => ctx.p1.parsed.x > 2 ? 'red' : undefined, borderDash: ctx => ctx.p1.parsed.x > 3 ? [6, 6] : undefined, }, spanGaps: true }, { data: [0, 2, null, null, 1, 0], segment: { borderColor: ctx => ctx.p1.parsed.x > 2 ? 'red' : undefined, borderDash: ctx => ctx.p1.parsed.x > 3 ? [6, 6] : undefined, }, spanGaps: false }] }, options: { borderColor: 'black', radius: 0, scales: { x: {display: false}, y: {display: false} } } } };