repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bubble/hover-radius-zero.js
test/fixtures/controller.bubble/hover-radius-zero.js
module.exports = { config: { type: 'bubble', data: { labels: [2, 2, 2, 2], datasets: [{ data: [ [1, 1], [1, 2], [1, 3, 20], [1, 4, 20] ] }, { data: [1, 2, 3, 4] }, { data: [{x: 3, y: 1}, {x: 3, y: 2}, {x: 3, y: 3, r: 15}, {x: 3, y: 4, r: 15}] }] }, options: { events: [], radius: 10, hoverRadius: 0, backgroundColor: 'blue', hoverBackgroundColor: 'red', scales: { x: {display: false, bounds: 'data'}, y: {display: false} }, layout: { padding: 24 } } }, options: { canvas: { height: 256, width: 256 }, run(chart) { chart.setActiveElements([ {datasetIndex: 0, index: 1}, {datasetIndex: 0, index: 2}, {datasetIndex: 1, index: 1}, {datasetIndex: 1, index: 2}, {datasetIndex: 2, index: 1}, {datasetIndex: 2, index: 2}, ]); chart.update(); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bubble/clip.js
test/fixtures/controller.bubble/clip.js
module.exports = { config: { type: 'line', data: { labels: [0, 5, 10, 15, 20, 25, 30, 50, 55, 60], datasets: [{ data: [6, 11, 10, 10, 3, 22, 7, 24], type: 'bubble', label: 'test', borderColor: '#3e95cd', fill: false }] }, options: { scales: { x: {ticks: {display: false}}, y: { min: 8, max: 25, beginAtZero: true, ticks: { display: false } } } } }, options: { canvas: { height: 256, width: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/anglelines-scriptable.js
test/fixtures/scale.radialLinear/anglelines-scriptable.js
module.exports = { config: { type: 'radar', data: { labels: ['A', 'B', 'C', 'D', 'E'] }, options: { responsive: false, scales: { r: { grid: { display: true, }, angleLines: { color: function(context) { return context.index % 2 === 0 ? 'red' : 'green'; }, lineWidth: function(context) { return context.index % 2 === 0 ? 1 : 5; }, }, pointLabels: { display: false }, ticks: { display: false } } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/backgroundColor.js
test/fixtures/scale.radialLinear/backgroundColor.js
module.exports = { threshold: 0.01, config: { type: 'radar', data: { labels: [1, 2, 3, 4, 5, 6], datasets: [ { data: [3, 2, 2, 1, 3, 1] } ] }, options: { plugins: { legend: false, tooltip: false, filler: false }, scales: { r: { backgroundColor: '#00FF00', min: 0, max: 3, pointLabels: { display: false }, ticks: { display: false, stepSize: 1, } } }, responsive: true, maintainAspectRatio: false } }, };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/anglelines-reverse-scale.js
test/fixtures/scale.radialLinear/anglelines-reverse-scale.js
module.exports = { config: { type: 'radar', data: { labels: ['A', 'B', 'C', 'D', 'E'], datasets: [{ data: [1, 1, 2, 3, 5] }] }, options: { responsive: false, scales: { r: { reverse: true, grid: { display: true, }, angleLines: { color: 'red', lineWidth: 5, }, pointLabels: { display: false }, ticks: { display: true, } } } } }, options: { spriteText: true, } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/ticks-below-zero.js
test/fixtures/scale.radialLinear/ticks-below-zero.js
module.exports = { config: { type: 'radar', data: { labels: ['A', 'B', 'C', 'D', 'E'] }, options: { responsive: false, scales: { r: { min: -1, max: 1, grid: { display: true, color: 'blue', lineWidth: 2 }, angleLines: { color: 'rgba(255, 255, 255, 0.5)', lineWidth: 2 }, pointLabels: { display: false }, ticks: { display: true, autoSkip: false, stepSize: 0.2, callback: function(value) { if (value === 0.8) { return 'Strong'; } if (value === 0.4) { return 'Weak'; } if (value === 0) { return 'No'; } } } } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/gridlines-scriptable.js
test/fixtures/scale.radialLinear/gridlines-scriptable.js
module.exports = { config: { type: 'radar', data: { labels: ['A', 'B', 'C', 'D', 'E'] }, options: { responsive: false, scales: { r: { grid: { display: true, color: function(context) { return context.index % 2 === 0 ? 'green' : 'red'; }, lineWidth: function(context) { return context.index % 2 === 0 ? 5 : 1; }, }, angleLines: { color: 'rgba(255, 255, 255, 0.5)', lineWidth: 2 }, pointLabels: { display: false }, ticks: { display: false } } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/circular-backgroundColor.js
test/fixtures/scale.radialLinear/circular-backgroundColor.js
module.exports = { threshold: 0.05, config: { type: 'radar', data: { labels: [1, 2, 3, 4, 5, 6], datasets: [ { data: [3, 2, 2, 1, 3, 1] } ] }, options: { plugins: { legend: false, tooltip: false, filler: false }, scales: { r: { backgroundColor: '#00FF00', min: 0, max: 3, grid: { circular: true }, pointLabels: { display: false }, ticks: { display: false, stepSize: 1, } } }, responsive: true, maintainAspectRatio: false } }, };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/anglelines-indexable.js
test/fixtures/scale.radialLinear/anglelines-indexable.js
module.exports = { config: { type: 'radar', data: { labels: ['A', 'B', 'C', 'D', 'E'] }, options: { responsive: false, scales: { r: { grid: { display: true, }, angleLines: { color: ['red', 'green'], lineWidth: [1, 5] }, pointLabels: { display: false }, ticks: { display: false } } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/pointLabels/padding.js
test/fixtures/scale.radialLinear/pointLabels/padding.js
module.exports = { config: { type: 'radar', data: { labels: [ ['VENTE ET', 'COMMERCIALISATION'], ['GESTION', 'FINANCIÈRE'], 'NUMÉRIQUE', ['ADMINISTRATION', 'ET OPÉRATION'], ['RESSOURCES', 'HUMAINES'], 'INNOVATION' ], datasets: [ { radius: 12, backgroundColor: '#E43E51', label: 'Compétences entrepreunariales', data: [3, 2, 2, 1, 3, 1] } ] }, options: { plugins: { legend: false, tooltip: false, filler: false }, scales: { r: { min: 0, max: 3, pointLabels: { padding: 30 }, ticks: { display: false, stepSize: 1, maxTicksLimit: 1 } } }, responsive: true, maintainAspectRatio: false } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/pointLabels/background.js
test/fixtures/scale.radialLinear/pointLabels/background.js
module.exports = { tolerance: 0.01, config: { type: 'radar', data: { labels: [ ['VENTE ET', 'COMMERCIALISATION'], ['GESTION', 'FINANCIÈRE'], 'NUMÉRIQUE', ['ADMINISTRATION', 'ET OPÉRATION'], ['RESSOURCES', 'HUMAINES'], 'INNOVATION' ], datasets: [ { backgroundColor: '#E43E51', label: 'Compétences entrepreunariales', data: [3, 2, 2, 1, 3, 1] } ] }, options: { plugins: { legend: false, tooltip: false, filler: false }, scales: { r: { min: 0, max: 3, pointLabels: { backdropColor: 'blue', backdropPadding: {left: 5, right: 5, top: 2, bottom: 2}, }, ticks: { display: false, stepSize: 1, maxTicksLimit: 1 } } }, responsive: true, maintainAspectRatio: false } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js
test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js
module.exports = { config: { type: 'radar', data: { labels: ['Too long label 1', 'Too long label 2', 'Too long label 3', 'Too long label 4'], datasets: [ { backgroundColor: '#E43E51', data: [1, 1, 1, 1] } ] }, options: { scales: { r: { max: 1, ticks: { display: false, }, grid: { display: false } } }, } }, options: { spriteText: true, canvas: { width: 256, height: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/pointLabels/scriptable-color-small.js
test/fixtures/scale.radialLinear/pointLabels/scriptable-color-small.js
module.exports = { config: { type: 'radar', data: { labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange', 'Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange', 'Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange', 'Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 1, 3, 12, 19, 3, 5, 1, 3, 12, 19, 3, 5, 1, 3, 12, 19, 3, 5, 1, 3] }] }, options: { scales: { r: { ticks: { display: false, }, angleLines: { color: (ctx) => { return ctx.index % 2 === 0 ? 'green' : 'red'; } }, pointLabels: { display: false, } } }, } }, options: { spriteText: true, width: 300, } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.radialLinear/pointLabels/border-radius.js
test/fixtures/scale.radialLinear/pointLabels/border-radius.js
module.exports = { tolerance: 0.01, config: { type: 'radar', data: { labels: [ ['VENTE ET', 'COMMERCIALISATION'], ['GESTION', 'FINANCIÈRE'], 'NUMÉRIQUE', ['ADMINISTRATION', 'ET OPÉRATION'], ['RESSOURCES', 'HUMAINES'], 'INNOVATION' ], datasets: [ { backgroundColor: '#E43E51', label: 'Compétences entrepreunariales', data: [3, 2, 2, 1, 3, 1] } ] }, options: { plugins: { legend: false, tooltip: false, filler: false }, scales: { r: { min: 0, max: 3, pointLabels: { backdropColor: 'blue', backdropPadding: {left: 5, right: 5, top: 2, bottom: 2}, borderRadius: 10, }, ticks: { display: false, stepSize: 1, maxTicksLimit: 1 } } }, responsive: true, maintainAspectRatio: false } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/box-padding.js
test/fixtures/plugin.tooltip/box-padding.js
const data = []; for (let x = 0; x < 3; x++) { for (let y = 0; y < 3; y++) { data.push({x, y}); } } module.exports = { config: { type: 'scatter', data: { datasets: [{ data, backgroundColor: 'red', radius: 1, hoverRadius: 0 }], }, options: { scales: { x: {display: false}, y: {display: false} }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'point', intersect: true, // spriteText: use white background to hide any gaps between fonts backgroundColor: 'white', borderColor: 'black', borderWidth: 1, callbacks: { label: () => 'label', }, boxPadding: 30 }, }, }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const meta = chart.getDatasetMeta(0); let point, event; for (let i = 0; i < data.length; i++) { point = meta.data[i]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } } }] }, options: { spriteText: true, canvas: { height: 400, width: 500 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/opacity.js
test/fixtures/plugin.tooltip/opacity.js
var patternCanvas = document.createElement('canvas'); var patternContext = patternCanvas.getContext('2d'); patternCanvas.width = 6; patternCanvas.height = 6; patternContext.fillStyle = '#ff0000'; patternContext.fillRect(0, 0, 6, 6); patternContext.fillStyle = '#ffff00'; patternContext.fillRect(0, 0, 4, 4); var pattern = patternContext.createPattern(patternCanvas, 'repeat'); var gradient; module.exports = { config: { type: 'line', data: { datasets: [{ data: [8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8], pointBorderColor: '#ff0000', pointBackgroundColor: '#00ff00', showLine: false }, { label: '', data: [4, 4, 4, 4, 4, 5, 3, 4, 4, 4, 4], pointBorderColor: pattern, pointBackgroundColor: pattern, showLine: false }, { label: '', data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], showLine: false }], labels: ['', '', '', '', '', '', '', '', '', '', ''] }, options: { scales: { x: {display: false}, y: {display: false} }, elements: { line: { fill: false } }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'nearest', intersect: false, callbacks: { label: function() { return '\u200b'; }, } }, }, layout: { padding: 15 } }, plugins: [{ beforeDatasetsUpdate: function(chart) { if (!gradient) { gradient = chart.ctx.createLinearGradient(0, 0, 512, 256); gradient.addColorStop(0, '#ff0000'); gradient.addColorStop(1, '#0000ff'); } chart.config.data.datasets[2].pointBorderColor = gradient; chart.config.data.datasets[2].pointBackgroundColor = gradient; return true; }, afterDraw: function(chart) { var canvas = chart.canvas; var rect = canvas.getBoundingClientRect(); var point, event; for (var i = 0; i < 3; ++i) { for (var j = 0; j < 11; ++j) { point = chart.getDatasetMeta(i).data[j]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.opacity = j / 10; chart.tooltip.draw(chart.ctx); } } } }] }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/corner-radius.js
test/fixtures/plugin.tooltip/corner-radius.js
const data = []; for (let x = 0; x < 3; x++) { for (let y = 0; y < 3; y++) { data.push({x, y}); } } module.exports = { config: { type: 'scatter', data: { datasets: [{ data, backgroundColor: 'red', radius: 1, hoverRadius: 0 }], }, options: { scales: { x: {display: false}, y: {display: false} }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'point', intersect: true, // spriteText: use white background to hide any gaps between fonts backgroundColor: 'white', borderColor: 'black', borderWidth: 1, callbacks: { beforeLabel: () => 'before label', label: () => 'label', afterLabel: () => 'after1\nafter2\nafter3\nafter4\nafter5' }, cornerRadius: { topLeft: 10, topRight: 20, bottomRight: 5, bottomLeft: 0, } }, }, }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const meta = chart.getDatasetMeta(0); let point, event; for (let i = 0; i < data.length; i++) { point = meta.data[i]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } } }] }, options: { spriteText: true, canvas: { height: 400, width: 500 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/positioning.js
test/fixtures/plugin.tooltip/positioning.js
const data = []; for (let x = 0; x < 3; x++) { for (let y = 0; y < 3; y++) { data.push({x, y}); } } module.exports = { config: { type: 'scatter', data: { datasets: [{ data, backgroundColor: 'red', radius: 1, hoverRadius: 0 }], }, options: { scales: { x: {display: false}, y: {display: false} }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'point', intersect: true, // spriteText: use white background to hide any gaps between fonts backgroundColor: 'white', borderColor: 'black', borderWidth: 1, callbacks: { beforeLabel: () => 'before label', label: () => 'label', afterLabel: () => 'after1\nafter2\nafter3\nafter4\nafter5' } } }, }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const meta = chart.getDatasetMeta(0); let point, event; for (let i = 0; i < data.length; i++) { point = meta.data[i]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } } }] }, options: { spriteText: true, canvas: { height: 400, width: 500 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/color-box-border-dash.js
test/fixtures/plugin.tooltip/color-box-border-dash.js
module.exports = { config: { type: 'line', data: { datasets: [{ data: [8, 7, 6, 5], pointBorderColor: '#ff0000', pointBackgroundColor: '#00ff00', showLine: false }], labels: ['', '', '', ''] }, options: { scales: { x: {display: false}, y: {display: false} }, elements: { line: { fill: false } }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'nearest', intersect: false, callbacks: { label: function() { return '\u200b'; }, labelColor: function(tooltipItem) { const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); const options = meta.controller.getStyle(tooltipItem.dataIndex); return { borderColor: options.borderColor, backgroundColor: options.backgroundColor, borderWidth: 2, borderDash: [2, 2] }; }, } }, }, layout: { padding: 15 } }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const point = chart.getDatasetMeta(0).data[1]; const event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } }] }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/color-box-border-radius.js
test/fixtures/plugin.tooltip/color-box-border-radius.js
module.exports = { config: { type: 'line', data: { datasets: [{ data: [8, 7, 6, 5], pointBorderColor: '#ff0000', pointBackgroundColor: '#00ff00', showLine: false }], labels: ['', '', '', ''] }, options: { scales: { x: {display: false}, y: {display: false} }, elements: { line: { fill: false } }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'nearest', intersect: false, callbacks: { label: function() { return '\u200b'; }, labelColor: function(tooltipItem) { const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); const options = meta.controller.getStyle(tooltipItem.dataIndex); return { borderColor: options.borderColor, backgroundColor: options.backgroundColor, borderWidth: 2, borderRadius: { topRight: 5, bottomRight: 5, }, }; }, } }, }, layout: { padding: 15 } }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const point = chart.getDatasetMeta(0).data[1]; const event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } }] }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/caret-position.js
test/fixtures/plugin.tooltip/caret-position.js
const data = []; for (let x = 1; x < 4; x++) { for (let y = 1; y < 4; y++) { data.push({x, y}); } } module.exports = { config: { type: 'scatter', data: { datasets: [{ data, backgroundColor: 'red', radius: 8, hoverRadius: 0 }], }, options: { scales: { x: {display: false, min: 0.96, max: 3.04}, y: {display: false, min: 1, max: 3} }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'point', intersect: true, // spriteText: use white background to hide any gaps between fonts backgroundColor: 'white', borderColor: 'black', borderWidth: 1, callbacks: { label: () => 'label', } }, }, }, plugins: [{ afterDraw: function(chart) { const canvas = chart.canvas; const rect = canvas.getBoundingClientRect(); const meta = chart.getDatasetMeta(0); let point, event; for (let i = 0; i < data.length; i++) { point = meta.data[i]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } } }] }, options: { spriteText: true, canvas: { height: 240, width: 320 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/plugin.tooltip/point-style.js
test/fixtures/plugin.tooltip/point-style.js
const pointStyles = ['circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', 'triangle', false]; function newDataset(pointStyle, i) { return { label: '', data: pointStyles.map(() => i), pointStyle: pointStyle, pointBackgroundColor: '#0000ff', pointBorderColor: '#00ff00', showLine: false }; } module.exports = { config: { type: 'line', data: { datasets: pointStyles.map((pointStyle, i) => newDataset(pointStyle, i)), labels: pointStyles.map(() => '') }, options: { scales: { x: {display: false}, y: {display: false} }, elements: { line: { fill: false } }, plugins: { legend: false, title: false, filler: false, tooltip: { mode: 'nearest', intersect: false, padding: 5, usePointStyle: true, callbacks: { label: function() { return '\u200b'; } } }, }, layout: { padding: 15 } }, plugins: [{ afterDraw: function(chart) { var canvas = chart.canvas; var rect = canvas.getBoundingClientRect(); var point, event; for (var i = 0; i < pointStyles.length; ++i) { point = chart.getDatasetMeta(i).data[i]; event = { type: 'mousemove', target: canvas, clientX: rect.left + point.x, clientY: rect.top + point.y }; chart._handleEvent(event); chart.tooltip.handleEvent(event); chart.tooltip.draw(chart.ctx); } } }] }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/core.datasetController/stacked-initial-render.js
test/fixtures/core.datasetController/stacked-initial-render.js
module.exports = { config: { type: 'line', data: { labels: [0, 1, 2, 3, 4, 5, 6], datasets: [ { // option in dataset data: [9, 13, 15, 25, 22, 15, 21], stack: 'construction_stack', borderWidth: 10, borderColor: 'rgb(54, 162, 235)' }, { data: [9, 13, 15, 25, 22, 15, 21], stack: 'construction_stack', borderWidth: 10, borderColor: 'rgb(255, 99, 132)' } ] }, options: { scales: { x: { ticks: { display: false } }, y: { ticks: { display: false } } }, plugins: { legend: false, title: false, tooltip: false, filler: false } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/mixed/bar+line.js
test/fixtures/mixed/bar+line.js
module.exports = { config: { data: { datasets: [ { type: 'line', data: [6, 16, 3, 19], borderColor: '#0000ff', fill: false }, { type: 'bar', data: [5, 20, 1, 10], backgroundColor: '#00ff00', borderColor: '#ff0000' } ] }, options: { indexAxis: 'y', scales: { x: { position: 'top' }, y: { axis: 'y', labels: ['a', 'b', 'c', 'd'] } } } }, options: { spriteText: true, canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/mixed/bar+line-stacked.js
test/fixtures/mixed/bar+line-stacked.js
module.exports = { config: { data: { datasets: [ { type: 'bar', stack: 'mixed', data: [5, 20, 1, 10], backgroundColor: '#00ff00', borderColor: '#ff0000' }, { type: 'line', stack: 'mixed', data: [6, 16, 3, 19], borderColor: '#0000ff', fill: false }, ] }, options: { scales: { x: { axis: 'y', labels: ['a', 'b', 'c', 'd'] }, y: { stacked: true } } } }, options: { spriteText: true, canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.scatter/showLine/changed.js
test/fixtures/controller.scatter/showLine/changed.js
module.exports = { description: 'showLine option should draw a line if true', config: { type: 'scatter', data: { datasets: [{ data: [{x: 10, y: 15}, {x: 15, y: 10}], pointRadius: 10, backgroundColor: 'red', label: 'dataset1' }], }, options: { scales: { x: { display: false }, y: { display: false } } } }, options: { canvas: { width: 256, height: 256 }, run(chart) { chart.options.showLine = true; chart.update(); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.scatter/showLine/true.js
test/fixtures/controller.scatter/showLine/true.js
module.exports = { description: 'showLine option should draw a line if true', config: { type: 'scatter', data: { datasets: [{ data: [{x: 10, y: 15}, {x: 15, y: 10}], pointRadius: 10, backgroundColor: 'red', showLine: true, label: 'dataset1' }], }, options: { scales: { x: { display: false }, y: { display: false } } } }, options: { canvas: { width: 256, height: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.scatter/showLine/undefined.js
test/fixtures/controller.scatter/showLine/undefined.js
module.exports = { description: 'showLine option should not draw a line if undefined', config: { type: 'scatter', data: { datasets: [{ data: [{x: 10, y: 15}, {x: 15, y: 10}], pointRadius: 10, backgroundColor: 'red', label: 'dataset1' }], }, options: { scales: { x: { display: false }, y: { display: false } } } }, options: { canvas: { width: 256, height: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.category/ticks-from-data.js
test/fixtures/scale.category/ticks-from-data.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { datasets: [{ data: [10, 5, 0, 25, 78], backgroundColor: 'transparent' }], labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5'] }, options: { indexAxis: 'y', scales: { x: {display: false}, y: {display: true} } } }, options: { spriteText: true, canvas: { width: 128, height: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.category/max-ticks-limit-a.js
test/fixtures/scale.category/max-ticks-limit-a.js
const data = Array.from({length: 42}, (_, i) => i + 1); const labels = data.map(v => 'tick' + v); module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/7302', config: { type: 'bar', data: { datasets: [{ data }], labels }, options: { scales: { x: { ticks: { display: false, maxTicksLimit: 7 }, grid: { color: 'red' } }, y: {display: false} }, layout: { padding: { right: 2 } } } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.category/max-ticks-limit-b.js
test/fixtures/scale.category/max-ticks-limit-b.js
const data = Array.from({length: 42}, (_, i) => i + 1); const labels = data.map(v => 'tick' + v); module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/7302', config: { type: 'bar', data: { datasets: [{ data }], labels }, options: { scales: { x: { ticks: { display: false, maxTicksLimit: 6 }, grid: { color: 'red' } }, y: {display: false} }, layout: { padding: { right: 2 } } } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.category/invalid-data.js
test/fixtures/scale.category/invalid-data.js
module.exports = { config: { type: 'line', data: { labels: ['a', 'b', 'c', 'd', 'e', 'f', 'g'], datasets: [{ data: [ {x: 'a', y: 1}, {x: null, y: 1}, {x: 2, y: 1}, {x: undefined, y: 1}, {x: 4, y: 1}, {x: NaN, y: 1}, {x: 6, y: 1} ], backgroundColor: 'red', borderColor: 'red', borderWidth: 5 }] }, options: { scales: { y: { display: false }, x: { grid: { display: false } } } } }, options: { spriteText: true, canvas: { width: 256, height: 256 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/scale.category/max-ticks-limit-norotation.js
test/fixtures/scale.category/max-ticks-limit-norotation.js
const data = Array.from({length: 42}, (_, i) => i + 1); const labels = data.map(v => 'tick' + v); module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/10856', config: { type: 'bar', data: { datasets: [{ data }], labels }, options: { scales: { x: { ticks: { display: true, maxTicksLimit: 6 }, grid: { color: 'red' } }, y: {display: false} }, layout: { padding: { right: 2 } } } }, options: { spriteText: true } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/core.interaction/drawActiveElementsOnTop-false.js
test/fixtures/core.interaction/drawActiveElementsOnTop-false.js
module.exports = { config: { type: 'bubble', data: { datasets: [{ data: [ {x: 1, y: 1, r: 80}, {x: 1, y: 1, r: 20} ], drawActiveElementsOnTop: false, backgroundColor: (ctx) => (ctx.dataIndex === 1 ? 'red' : 'blue'), hoverBackgroundColor: 'yellow', hoverRadius: 0, }] }, options: { scales: { x: { display: false }, y: { display: false }, }, plugins: { tooltip: false, legend: false }, } }, options: { canvas: { width: 256, height: 256 }, async run(chart) { const point = chart.getDatasetMeta(0).data[0]; await jasmine.triggerMouseEvent(chart, 'click', {y: point.y, x: point.x + 25}); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/core.interaction/nearest-partial-bar.js
test/fixtures/core.interaction/nearest-partial-bar.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b', 'c'], datasets: [ { data: [220, 250, 225], }, ], }, options: { events: ['click'], interaction: { mode: 'nearest' }, plugins: { tooltip: true, legend: false }, scales: { y: { beginAtZero: false } } } }, options: { spriteText: true, canvas: { width: 256, height: 256 }, async run(chart) { const point = { x: chart.chartArea.left + chart.chartArea.width / 2, y: chart.chartArea.top + chart.chartArea.height / 2, }; await jasmine.triggerMouseEvent(chart, 'click', point); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/core.interaction/nearest-point-behind-scale.js
test/fixtures/core.interaction/nearest-point-behind-scale.js
module.exports = { config: { type: 'scatter', data: { datasets: [{ data: [{x: 1, y: 1}, {x: 48, y: 1}] }] }, options: { events: ['click'], interaction: { mode: 'nearest', intersect: false }, plugins: { tooltip: true, legend: false }, scales: { x: { min: 5, max: 50 }, y: { min: 0, max: 2 } }, layout: { padding: 50 } } }, options: { spriteText: true, canvas: { width: 256, height: 256 }, async run(chart) { const point = chart.getDatasetMeta(0).data[0]; await jasmine.triggerMouseEvent(chart, 'click', {y: point.y, x: chart.chartArea.left}); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/bar-base-value.js
test/fixtures/controller.bar/bar-base-value.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 3, 4], datasets: [ { data: [5, 20, 10, 11], base: 10, backgroundColor: '#00ff00', borderColor: '#ff0000', borderWidth: 2, } ] }, options: { scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/chart-area-clip.js
test/fixtures/controller.bar/chart-area-clip.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 3, 4], datasets: [ { data: [5, 20, -5, -20], borderColor: '#ff0000' } ] }, options: { layout: { padding: { left: 0, right: 0, top: 50, bottom: 50 } }, elements: { bar: { backgroundColor: '#00ff00', borderWidth: 8 } }, scales: { x: {display: false}, y: {display: false, min: -10, max: 10} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/bar-animation-hide-show.js
test/fixtures/controller.bar/bar-animation-hide-show.js
const canvas = document.createElement('canvas'); canvas.width = 512; canvas.height = 512; const ctx = canvas.getContext('2d'); module.exports = { config: { type: 'bar', data: { labels: [0], datasets: [ { data: [1], backgroundColor: 'rgba(255,0,0,0.5)' }, { data: [2], backgroundColor: 'rgba(0,0,255,0.5)' }, { data: [3], backgroundColor: 'rgba(0,255,0,0.5)' } ] }, options: { animation: { duration: 14000, easing: 'linear' }, events: [], scales: { x: {display: false}, y: {display: false, max: 4} } } }, options: { canvas: { height: 512, width: 512 }, run: function(chart) { const animator = Chart.animator; const anims = animator._getAnims(chart); // disable animator const backup = animator._refresh; animator._refresh = function() { }; return new Promise((resolve) => { window.requestAnimationFrame(() => { // make sure previous animation is finished animator._update(Date.now() * 2); chart.hide(1); let start = anims.items[0]._start; for (let i = 0; i < 8; i++) { animator._update(start + i * 2000); let x = i % 4 * 128; let y = Math.floor(i / 4) * 128; ctx.drawImage(chart.canvas, x, y, 128, 128); } // make sure previous animation is finished animator._update(Date.now() * 2); chart.show(1); start = anims.items[0]._start; for (let i = 0; i < 8; i++) { animator._update(start + i * 2000); let x = i % 4 * 128; let y = Math.floor(2 + i / 4) * 128; ctx.drawImage(chart.canvas, x, y, 128, 128); } Chart.helpers.clearCanvas(chart.canvas); chart.ctx.drawImage(canvas, 0, 0); animator._refresh = backup; resolve(); }); }); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/horizontal-borders.js
test/fixtures/controller.bar/horizontal-borders.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: 2 }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], borderSkipped: false } ] }, options: { indexAxis: 'y', elements: { bar: { backgroundColor: '#AAAAAA80', borderColor: '#80808080', borderWidth: {bottom: 6, left: 15, top: 6, right: 15} } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/bar-default-begin-at-zero.js
test/fixtures/controller.bar/bar-default-begin-at-zero.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 3, 4], datasets: [ { data: [5, 20, 1, 10], backgroundColor: '#00ff00', borderColor: '#ff0000' } ] }, options: { scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/aligned-pixels.js
test/fixtures/controller.bar/aligned-pixels.js
module.exports = { config: { type: 'bar', data: { labels: ['a'], datasets: [{ data: [-1] }, { data: [1] }] }, options: { indexAxis: 'y', events: [], backgroundColor: 'navy', devicePixelRatio: 1.25, scales: { x: {display: false, alignToPixels: true}, y: {display: false, stacked: true} } } }, options: { canvas: { width: 100, height: 500 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/vertical-stacked-no-overlap.js
test/fixtures/controller.bar/minBarLength/vertical-stacked-no-overlap.js
const minBarLength = 50; module.exports = { config: { type: 'bar', data: { labels: [1, 2, 3, 4], datasets: [ { data: [1, -1, 1, 20], backgroundColor: '#bb000066', minBarLength }, { data: [1, -1, -1, -20], backgroundColor: '#00bb0066', minBarLength }, { data: [1, -1, 1, 40], backgroundColor: '#0000bb66', minBarLength }, { data: [1, -1, -1, -40], backgroundColor: '#00000066', minBarLength } ] }, options: { scales: { x: { display: false, stacked: true }, y: { type: 'linear', position: 'left', stacked: true, ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/vertical-stacked.js
test/fixtures/controller.bar/minBarLength/vertical-stacked.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4], datasets: [{ data: [0, 0.01, 30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20, yAxisID: 'y2', }] }, options: { scales: { x: {display: false}, y: { stack: 'demo', ticks: { display: false } }, y2: { type: 'linear', position: 'left', stack: 'demo', stackWeight: 1, ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/vertical-neg.js
test/fixtures/controller.bar/minBarLength/vertical-neg.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2], datasets: [ { data: [0, -0.01, -30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20 } ] }, options: { scales: { x: {display: false}, y: { ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/horizontal-neg.js
test/fixtures/controller.bar/minBarLength/horizontal-neg.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2], datasets: [ { data: [0, -0.01, -30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20 } ] }, options: { indexAxis: 'y', scales: { x: { ticks: { display: false } }, y: {display: false} } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/vertical-pos.js
test/fixtures/controller.bar/minBarLength/vertical-pos.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2], datasets: [ { data: [0, 0.01, 30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20 } ] }, options: { scales: { x: {display: false}, y: { ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/horizontal.js
test/fixtures/controller.bar/minBarLength/horizontal.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4], datasets: [ { data: [0, -0.01, 0.01, 30, -30], backgroundColor: '#00ff00', borderColor: '#000', borderSkipped: ctx => ctx.raw === 0 ? false : 'start', borderWidth: 4, minBarLength: 20 } ] }, options: { indexAxis: 'y', scales: { x: { ticks: { display: false } }, y: {display: false} } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/horizontal-stacked-no-overlap.js
test/fixtures/controller.bar/minBarLength/horizontal-stacked-no-overlap.js
const minBarLength = 50; module.exports = { config: { type: 'bar', data: { labels: [1, 2, 3, 4], datasets: [ { data: [1, -1, 1, 20], backgroundColor: '#bb000066', minBarLength }, { data: [1, -1, -1, -20], backgroundColor: '#00bb0066', minBarLength }, { data: [1, -1, 1, 40], backgroundColor: '#0000bb66', minBarLength }, { data: [1, -1, -1, -40], backgroundColor: '#00000066', minBarLength } ] }, options: { indexAxis: 'y', scales: { x: { display: false, stacked: true }, y: { type: 'linear', position: 'left', stacked: true, ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/horizontal-pos.js
test/fixtures/controller.bar/minBarLength/horizontal-pos.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2], datasets: [ { data: [0, 0.01, 30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20 } ] }, options: { indexAxis: 'y', scales: { x: { ticks: { display: false } }, y: {display: false} } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/horizontal-stacked.js
test/fixtures/controller.bar/minBarLength/horizontal-stacked.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4], datasets: [{ data: [0, 0.01, 30], backgroundColor: '#00ff00', borderColor: '#000', borderWidth: 4, minBarLength: 20, xAxisID: 'x2', }] }, options: { indexAxis: 'y', scales: { x: { stack: 'demo', ticks: { display: false } }, x2: { type: 'linear', position: 'bottom', stack: 'demo', stackWeight: 1, ticks: { display: false } }, y: {display: false}, } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/minBarLength/vertical.js
test/fixtures/controller.bar/minBarLength/vertical.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4], datasets: [ { data: [0, -0.01, 0.01, 30, -30], backgroundColor: '#00ff00', borderColor: '#000', borderSkipped: ctx => ctx.raw === 0 ? false : 'start', borderWidth: 4, minBarLength: 20 } ] }, options: { scales: { x: {display: false}, y: { ticks: { display: false } } } } }, options: { canvas: { height: 512, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/floatBar/data-as-objects-horizontal.js
test/fixtures/controller.bar/floatBar/data-as-objects-horizontal.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b', 'c'], datasets: [ { data: [{y: 'b', x: [2, 8]}, {y: 'c', x: [2, 5]}], backgroundColor: '#ff0000' }, { data: [{y: 'a', x: 10}, {y: 'c', x: [6, 10]}], backgroundColor: '#00ff00' } ] }, options: { indexAxis: 'y', scales: { x: {display: false, min: 0}, y: {display: false, stacked: true} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/floatBar/data-as-objects.js
test/fixtures/controller.bar/floatBar/data-as-objects.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b', 'c'], datasets: [ { data: [{x: 'b', y: [2, 8]}, {x: 'c', y: [2, 5]}], backgroundColor: '#ff0000' }, { data: [{x: 'a', y: 10}, {x: 'c', y: [6, 10]}], backgroundColor: '#00ff00' } ] }, options: { scales: { x: {display: false, stacked: true}, y: {display: false, min: 0} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderColor/border+dpr.js
test/fixtures/controller.bar/borderColor/border+dpr.js
module.exports = { threshold: 0, tolerance: 0, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5, 6], datasets: [ { // option in dataset data: [5, 4, 3, 2, 3, 4, 5], }, ] }, options: { events: [], devicePixelRatio: 1.5, barPercentage: 1, categoryPercentage: 1, backgroundColor: 'black', borderColor: 'black', borderWidth: 8, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 501 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderColor/value.js
test/fixtures/controller.bar/borderColor/value.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderColor: '#ff0000' }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#00ff00', borderWidth: 8 } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderColor/indexable.js
test/fixtures/controller.bar/borderColor/indexable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderColor: [ '#ff0000', '#00ff00', '#0000ff', '#ffff00', '#ff00ff', '#000000' ] }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: [ '#ff88ff', '#888888', '#ff8800', '#00ff88', '#8800ff', '#ffff88' ], borderWidth: 8 } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderColor/scriptable.js
test/fixtures/controller.bar/borderColor/scriptable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderColor: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return value > 8 ? '#ff0000' : value > 0 ? '#00ff00' : value > -8 ? '#0000ff' : '#ff00ff'; } }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5] } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return value > 8 ? '#ff00ff' : value > 0 ? '#0000ff' : value > -8 ? '#ff0000' : '#00ff00'; }, borderWidth: 8 } }, scales: { x: {display: false}, y: { display: false, beginAtZero: true } } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderRadius/no-spacing.js
test/fixtures/controller.bar/borderRadius/no-spacing.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], datasets: [ { data: [9, 25, 13, 17, 12, 21, 20, 19, 6, 12, 14, 20], categoryPercentage: 1, barPercentage: 1, backgroundColor: '#2E5C76', borderWidth: 2, borderColor: '#377395', borderRadius: 5, }, ] }, options: { devicePixelRatio: 1.25, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderRadius/border-radius-stacked-number-mixed-chart.js
test/fixtures/controller.bar/borderRadius/border-radius-stacked-number-mixed-chart.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { backgroundColor: 'red', data: [12, 19, 12, 5, 4, 12], }, { backgroundColor: 'green', data: [12, 19, -4, 5, 8, 3], type: 'line' }, { backgroundColor: 'blue', data: [7, 11, -12, 12, 0, -7], } ] }, options: { elements: { bar: { borderRadius: Number.MAX_VALUE, borderWidth: 2, } }, scales: { x: {display: false, stacked: true}, y: {display: false, stacked: true} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderRadius/border-radius-stacked-number.js
test/fixtures/controller.bar/borderRadius/border-radius-stacked-number.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { backgroundColor: 'red', data: [12, 19, 12, 5, 4, 12], }, { backgroundColor: 'green', data: [12, 19, -4, 5, 8, 3], }, { backgroundColor: 'blue', data: [7, 11, -12, 12, 0, -7], } ] }, options: { elements: { bar: { borderRadius: Number.MAX_VALUE, borderWidth: 2, } }, scales: { x: {display: false, stacked: true}, y: {display: false, stacked: true} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderRadius/border-radius-stacked-number-with-order.js
test/fixtures/controller.bar/borderRadius/border-radius-stacked-number-with-order.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { backgroundColor: 'red', data: [12, 19, 12, 5, 4, 12], order: 2, }, { backgroundColor: 'green', data: [12, 19, -4, 5, 8, 3], order: 1, }, { backgroundColor: 'blue', data: [7, 11, -12, 12, 0, -7], order: 0, } ] }, options: { elements: { bar: { borderRadius: Number.MAX_VALUE, borderWidth: 2, } }, scales: { x: {display: false, stacked: true}, y: {display: false, stacked: true} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderRadius/border-radius.js
test/fixtures/controller.bar/borderRadius/border-radius.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: 2, borderRadius: 5 }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], borderSkipped: false, borderRadius: Number.MAX_VALUE } ] }, options: { indexAxis: 'y', elements: { bar: { backgroundColor: '#AAAAAA80', borderColor: '#80808080', borderWidth: {bottom: 6, left: 15, top: 6, right: 15} } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderSkipped/middle.js
test/fixtures/controller.bar/borderSkipped/middle.js
module.exports = { threshold: 0.01, config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { backgroundColor: 'red', data: [12, 19, 12, 5, 4, 12], }, { backgroundColor: 'green', data: [12, 19, -4, 5, 8, 3], }, { backgroundColor: 'blue', data: [7, 11, -12, 12, 0, -7], } ] }, options: { borderRadius: Number.MAX_VALUE, borderSkipped: 'middle', borderWidth: 2, scales: { x: {display: false, stacked: true}, y: {display: false, stacked: true} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderSkipped/value.js
test/fixtures/controller.bar/borderSkipped/value.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3], datasets: [ { // option in dataset data: [0, 5, -10, null], borderSkipped: 'top' }, { // option in dataset data: [0, 5, -10, null], borderSkipped: 'right' }, { // option in dataset data: [0, 5, -10, null], borderSkipped: 'bottom' }, { // option in element (fallback) data: [0, 5, -10, null], }, { // option in dataset data: [0, 5, -10, null], borderSkipped: false } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderSkipped: 'left', borderWidth: 8 } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderSkipped/indexable.js
test/fixtures/controller.bar/borderSkipped/indexable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderSkipped: [ 'top', 'top', 'right', 'right', 'bottom', 'left' ] }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderWidth: 8, borderSkipped: [ 'bottom', 'bottom', 'left', 'left', 'top', 'right' ] } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderSkipped/scriptable.js
test/fixtures/controller.bar/borderSkipped/scriptable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderSkipped: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return value > 8 ? 'left' : value > 0 ? 'right' : value > -8 ? 'top' : 'bottom'; } }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5] } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderSkipped: function(ctx) { var index = ctx.dataIndex; return index > 4 ? 'left' : index > 3 ? 'right' : index > 1 ? 'top' : 'bottom'; }, borderWidth: 8 } }, scales: { x: {display: false}, y: { display: false, beginAtZero: true } } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/skipNull/bar-skip-null.js
test/fixtures/controller.bar/skipNull/bar-skip-null.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 3, 4], datasets: [ { data: [5, 20, 1, 10], backgroundColor: '#00ff00', borderColor: '#ff0000' }, { data: [10, null, 1, undefined], backgroundColor: '#ff0000', borderColor: '#ff0000' } ] }, options: { skipNull: true, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/skipNull/combinations.js
test/fixtures/controller.bar/skipNull/combinations.js
module.exports = { config: { type: 'bar', data: { labels: ['0', '1', '2', '3', '4', '5', '6', '7'], datasets: [ { data: [null, 1000, null, 1000, null, 1000, null, 1000], backgroundColor: '#00ff00', borderColor: '#ff0000' }, { data: [null, null, 1000, 1000, null, null, 1000, 1000], backgroundColor: '#ff0000', borderColor: '#ff0000' }, { data: [null, null, null, null, 1000, 1000, 1000, 1000], backgroundColor: '#0000ff', borderColor: '#0000ff' } ] }, options: { skipNull: true, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/skipNull/bar-skip-null-object-data.js
test/fixtures/controller.bar/skipNull/bar-skip-null-object-data.js
module.exports = { config: { type: 'bar', data: { datasets: [ { data: {0: 5, 1: 20, 2: 1, 3: 10}, backgroundColor: '#00ff00', borderColor: '#ff0000' }, { data: {0: 10, 1: null, 2: 1, 3: NaN}, backgroundColor: '#ff0000', borderColor: '#ff0000' } ] }, options: { skipNull: true, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/backgroundColor/loopable.js
test/fixtures/controller.bar/backgroundColor/loopable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 2, 3, 4, 5, 6], backgroundColor: [ '#ff0000', '#00ff00', '#0000ff' ] }, { // option in element (fallback) data: [6, 5, 4, 3, 2, 1], } ] }, options: { elements: { bar: { backgroundColor: [ '#000000', '#888888' ] } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/backgroundColor/value.js
test/fixtures/controller.bar/backgroundColor/value.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], backgroundColor: '#ff0000' }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: '#00ff00' } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/backgroundColor/indexable.js
test/fixtures/controller.bar/backgroundColor/indexable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], backgroundColor: [ '#ff0000', '#00ff00', '#0000ff', '#ffff00', '#ff00ff', '#000000' ] }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: [ '#ff88ff', '#888888', '#ff8800', '#00ff88', '#8800ff', '#ffff88' ] } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/backgroundColor/scriptable.js
test/fixtures/controller.bar/backgroundColor/scriptable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], backgroundColor: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return value > 8 ? '#ff0000' : value > 0 ? '#00ff00' : value > -8 ? '#0000ff' : '#ff00ff'; } }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5] } ] }, options: { elements: { bar: { backgroundColor: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return value > 8 ? '#ff00ff' : value > 0 ? '#0000ff' : value > -8 ? '#ff0000' : '#00ff00'; } } }, scales: { x: {display: false}, y: { display: false, beginAtZero: true } } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/not-grouped/on-time.js
test/fixtures/controller.bar/not-grouped/on-time.js
const data1 = [ { x: '2017-11-02T20:30:00', y: 27 }, { x: '2017-11-03T20:53:00', y: 30 }, { x: '2017-11-06T05:46:00', y: 19 }, { x: '2017-11-06T21:03:00', y: 28 }, { x: '2017-11-07T20:49:00', y: 29 }, { x: '2017-11-08T21:52:00', y: 33 } ]; const data2 = [ { x: '2017-11-03T13:07:00', y: 45 }, { x: '2017-11-04T04:50:00', y: 40 }, { x: '2017-11-06T12:48:00', y: 38 }, { x: '2017-11-07T12:28:00', y: 42 }, { x: '2017-11-08T12:45:00', y: 51 }, { x: '2017-11-09T05:23:00', y: 57 } ]; const data3 = [ { x: '2017-11-03T16:30:00', y: 32 }, { x: '2017-11-04T11:50:00', y: 34 }, { x: '2017-11-06T18:30:00', y: 28 }, { x: '2017-11-07T15:51:00', y: 31 }, { x: '2017-11-08T17:27:00', y: 36 }, { x: '2017-11-09T06:53:00', y: 31 } ]; module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/5139', config: { type: 'bar', data: { datasets: [ { data: data1, backgroundColor: 'rgb(0,0,255)', }, { data: data2, backgroundColor: 'rgb(255,0,0)', }, { data: data3, backgroundColor: 'rgb(0,255,0)', }, ] }, options: { barThickness: 10, grouped: false, scales: { x: { bounds: 'ticks', type: 'time', offset: false, position: 'bottom', display: true, time: { isoWeekday: true, unit: 'day' }, grid: { offset: false } }, y: { beginAtZero: true, display: false } }, } }, options: { spriteText: true, canvas: { width: 1000, height: 300 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/not-grouped/mixed.js
test/fixtures/controller.bar/not-grouped/mixed.js
module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/9281', config: { type: 'bar', data: { labels: [0, 1, 2], datasets: [ { label: 'data 1', data: [1, 2, 2], backgroundColor: 'rgb(255,0,0,0.7)', grouped: true }, { label: 'data 2', data: [4, 4, 1], backgroundColor: 'rgb(0,255,0,0.7)', grouped: true }, { label: 'data 3', data: [2, 1, 3], backgroundColor: 'rgb(0,0,255,0.7)', grouped: false } ] }, options: { scales: { x: {display: false}, y: {display: false} } } }, };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/scriptable-object.js
test/fixtures/controller.bar/borderWidth/scriptable-object.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderSkipped: false, borderWidth: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return {top: Math.abs(value)}; } }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5] } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#80808080', borderSkipped: false, borderWidth: function(ctx) { return {left: ctx.dataIndex * 2}; } } }, scales: { x: {display: false}, y: { display: false, beginAtZero: true } } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/object.js
test/fixtures/controller.bar/borderWidth/object.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderSkipped: false, borderWidth: {bottom: 1, left: 2, top: 3, right: 4} }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderSkipped: false, borderWidth: {bottom: 4, left: 3, top: 2, right: 1} } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/negative.js
test/fixtures/controller.bar/borderWidth/negative.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: -2 }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], }, { data: [0, 5, 10, null, -10, -5], borderWidth: {left: -5, top: -5, bottom: -5, right: -5}, borderSkipped: false }, { data: [0, 5, 10, null, -10, -5], borderWidth: {} }, ] }, options: { elements: { bar: { backgroundColor: '#888', borderColor: '#f00', borderWidth: -4 } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/value.js
test/fixtures/controller.bar/borderWidth/value.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: 2 }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderWidth: 4 } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/indexable-object.js
test/fixtures/controller.bar/borderWidth/indexable-object.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderSkipped: false, borderWidth: [ {}, {bottom: 1, left: 1, top: 1, right: 1}, {bottom: 1, left: 2, top: 1, right: 2}, {bottom: 1, left: 3, top: 1, right: 3}, {bottom: 1, left: 4, top: 1, right: 4}, {bottom: 1, left: 5, top: 1, right: 5} ] }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#80808080', borderSkipped: false, borderWidth: [ {bottom: 1, left: 5, top: 1, right: 5}, {bottom: 1, left: 4, top: 1, right: 4}, {bottom: 1, left: 3, top: 1, right: 3}, {bottom: 1, left: 2, top: 1, right: 2}, {bottom: 1, left: 1, top: 1, right: 1}, {} ] } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/indexable.js
test/fixtures/controller.bar/borderWidth/indexable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: [ 0, 1, 2, 3, 4, 5 ] }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5], } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderWidth: [ 5, 4, 3, 2, 1, 0 ] } }, scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/borderWidth/scriptable.js
test/fixtures/controller.bar/borderWidth/scriptable.js
module.exports = { config: { type: 'bar', data: { labels: [0, 1, 2, 3, 4, 5], datasets: [ { // option in dataset data: [0, 5, 10, null, -10, -5], borderWidth: function(ctx) { var value = ctx.dataset.data[ctx.dataIndex] || 0; return Math.abs(value); } }, { // option in element (fallback) data: [0, 5, 10, null, -10, -5] } ] }, options: { elements: { bar: { backgroundColor: 'transparent', borderColor: '#888', borderWidth: function(ctx) { return ctx.dataIndex * 2; } } }, scales: { x: {display: false}, y: { display: false, beginAtZero: true } } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/top.js
test/fixtures/controller.bar/baseLine/top.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [-1, -2] }] }, options: { scales: { x: { display: false }, y: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, borderWidth: 0, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/left.js
test/fixtures/controller.bar/baseLine/left.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, 2] }] }, options: { indexAxis: 'y', scales: { y: { display: false }, x: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/mid-x.js
test/fixtures/controller.bar/baseLine/mid-x.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, -1] }] }, options: { indexAxis: 'y', scales: { y: { display: false }, x: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/bottom.js
test/fixtures/controller.bar/baseLine/bottom.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, 2] }] }, options: { scales: { x: { display: false }, y: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/value-x.js
test/fixtures/controller.bar/baseLine/value-x.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, 3] }] }, options: { base: 2, indexAxis: 'y', scales: { y: { display: false }, x: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 2 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/right.js
test/fixtures/controller.bar/baseLine/right.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [-1, -2] }] }, options: { indexAxis: 'y', scales: { y: { display: false }, x: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0, borderWidth: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/mid-y.js
test/fixtures/controller.bar/baseLine/mid-y.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, -1] }] }, options: { scales: { x: { display: false }, y: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 0 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/baseLine/value-y.js
test/fixtures/controller.bar/baseLine/value-y.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b'], datasets: [{ backgroundColor: '#AAFFCC', borderColor: '#0000FF', borderWidth: 1, data: [1, 3] }] }, options: { base: 2, scales: { x: { display: false }, y: { ticks: { display: false }, grid: { color: function(context) { return context.tick.value === 2 ? 'red' : 'transparent'; }, lineWidth: 5, tickLength: 0 }, } }, maintainAspectRatio: false } }, options: { canvas: { width: 128, height: 128 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/data/object-index-axis-y.js
test/fixtures/controller.bar/data/object-index-axis-y.js
module.exports = { config: { type: 'bar', data: { datasets: [{ label: '# of Votes', data: {a: 1, b: 3, c: 2} }] }, options: { indexAxis: 'y' } }, options: { spriteText: true, canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/data/parsing.js
test/fixtures/controller.bar/data/parsing.js
const data = [{x: 'Jan', net: 100, cogs: 50, gm: 50}, {x: 'Feb', net: 120, cogs: 55, gm: 75}]; module.exports = { config: { type: 'bar', data: { labels: ['Jan', 'Feb'], datasets: [{ label: 'Net sales', backgroundColor: 'blue', data: data, parsing: { yAxisKey: 'net' } }, { label: 'Cost of goods sold', backgroundColor: 'red', data: data, parsing: { yAxisKey: 'cogs' } }, { label: 'Gross margin', backgroundColor: 'green', data: data, parsing: { yAxisKey: 'gm' } }] }, options: { scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/data/object.js
test/fixtures/controller.bar/data/object.js
module.exports = { config: { type: 'bar', data: { labels: ['a', 'b', 'c'], datasets: [ { data: {a: 10, b: 2, c: -5}, backgroundColor: '#ff0000' }, { data: {a: 8, b: 12, c: 5}, backgroundColor: '#00ff00' } ] }, options: { scales: { x: {display: false}, y: {display: false} } } }, options: { canvas: { height: 256, width: 512 } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/remove-dataset.js
test/fixtures/controller.bar/stacking/remove-dataset.js
var barChartData = { labels: [0, 1, 2, 3, 4, 5, 6], datasets: [ { backgroundColor: 'red', data: [ // { x: 0, y: 0 }, {x: 1, y: 5}, {x: 2, y: 5}, {x: 3, y: 5}, {x: 4, y: 5}, {x: 5, y: 5}, {x: 6, y: 5} ] }, { backgroundColor: 'blue', data: [ {x: 0, y: 5}, // { x: 1, y: 0 }, {x: 2, y: 5}, {x: 3, y: 5}, {x: 4, y: 5}, {x: 5, y: 5}, {x: 6, y: 5} ] }, { backgroundColor: 'green', data: [ {x: 0, y: 5}, {x: 1, y: 5}, // { x: 2, y: 0 }, {x: 3, y: 5}, {x: 4, y: 5}, {x: 5, y: 5}, {x: 6, y: 5} ] }, { backgroundColor: 'yellow', data: [ {x: 0, y: 5}, {x: 1, y: 5}, {x: 2, y: 5}, // {x: 3, y: 0 }, {x: 4, y: 5}, {x: 5, y: 5}, {x: 6, y: 5} ] }, { backgroundColor: 'purple', data: [ {x: 0, y: 5}, {x: 1, y: 5}, {x: 2, y: 5}, {x: 3, y: 5}, // { x: 4, y: 0 }, {x: 5, y: 5}, {x: 6, y: 5} ] }, { backgroundColor: 'grey', data: [ {x: 0, y: 5}, {x: 1, y: 5}, {x: 2, y: 5}, {x: 3, y: 5}, {x: 4, y: 5}, // { x: 5, y: 0 }, {x: 6, y: 5} ] } ] }; module.exports = { config: { type: 'bar', data: barChartData, options: { scales: { x: { display: false, stacked: true }, y: { display: false, stacked: true } } } }, options: { run(chart) { chart.data.datasets.splice(0, 1); chart.update(); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/logarithmic-strings.js
test/fixtures/controller.bar/stacking/logarithmic-strings.js
module.exports = { config: { type: 'bar', data: { datasets: [{ data: ['10', '100', '10', '100'], backgroundColor: '#ff0000' }, { data: ['100', '10', '0', '100'], backgroundColor: '#00ff00' }], labels: ['label1', 'label2', 'label3', 'label4'] }, options: { datasets: { bar: { barPercentage: 1, } }, scales: { x: { type: 'category', display: false, stacked: true, }, y: { type: 'logarithmic', display: false, stacked: true } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/issue-9105.js
test/fixtures/controller.bar/stacking/issue-9105.js
module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/9105', config: { type: 'bar', data: { labels: ['January', 'February', 'March', 'April', 'May', 'June'], datasets: [ { backgroundColor: 'rgba(255,99,132,0.8)', label: 'Dataset 1', data: [12, 19, 3, 5, 2, 3], stack: '0', yAxisID: 'y' }, { backgroundColor: 'rgba(54,162,235,0.8)', label: 'Dataset 2', data: [13, 19, 3, 5, 8, 3], stack: '0', yAxisID: 'y' }, { backgroundColor: 'rgba(75,192,192,0.8)', label: 'Dataset 3', data: [13, 19, 3, 5, 8, 3], stack: '0', yAxisID: 'y' } ] }, options: { plugins: false, scales: { x: { display: false, }, y: { display: false } } } }, options: { run(chart) { chart.data.datasets[1].stack = '1'; chart.update(); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/logarithmic.js
test/fixtures/controller.bar/stacking/logarithmic.js
module.exports = { config: { type: 'bar', data: { datasets: [{ data: [10, 100, 10, 100], backgroundColor: '#ff0000' }, { data: [100, 10, 0, 100], backgroundColor: '#00ff00' }], labels: ['label1', 'label2', 'label3', 'label4'] }, options: { datasets: { bar: { barPercentage: 1, } }, scales: { x: { type: 'category', display: false, stacked: true, }, y: { type: 'logarithmic', display: false, stacked: true } } } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/replace-data.js
test/fixtures/controller.bar/stacking/replace-data.js
var barChartData = { labels: ['January', 'February', 'March'], datasets: [ { label: 'Dataset 1', backgroundColor: 'red', data: [5, 5, 5] }, { label: 'Dataset 2', backgroundColor: 'blue', data: [5, 5, 5] }, { label: 'Dataset 3', backgroundColor: 'green', data: [5, 5, 5] } ] }; module.exports = { description: 'https://github.com/chartjs/Chart.js/issues/8614', config: { type: 'bar', data: barChartData, options: { scales: { x: { display: false, stacked: true }, y: { display: false, stacked: true } } } }, options: { run(chart) { chart.data.datasets[1].data = [ {x: 'January', y: 5}, // Februay missing {x: 'March', y: 5} ]; chart.update(); } } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false
chartjs/Chart.js
https://github.com/chartjs/Chart.js/blob/a153556861074e827358446ec937555ac58c3d11/test/fixtures/controller.bar/stacking/stacked-and-multiple-axis.js
test/fixtures/controller.bar/stacking/stacked-and-multiple-axis.js
module.exports = { config: { type: 'bar', data: { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [ { label: 'Dataset 1', data: [100, 90, 100, 50, 99, 87, 34], backgroundColor: 'rgba(255,99,132,0.8)', stack: 'a', xAxisID: 'x' }, { label: 'Dataset 2', data: [20, 25, 30, 32, 58, 14, 12], backgroundColor: 'rgba(54,162,235,0.8)', stack: 'b', xAxisID: 'x2' }, { label: 'Dataset 3', data: [80, 30, 40, 60, 70, 80, 47], backgroundColor: 'rgba(75,192,192,0.8)', stack: 'a', xAxisID: 'x3' }, { label: 'Dataset 4', data: [80, 30, 40, 60, 70, 80, 47], backgroundColor: 'rgba(54,162,235,0.8)', stack: 'a', xAxisID: 'x3' }, ] }, options: { plugins: false, barThickness: 'flex', scales: { x: { stacked: true, display: false, }, x2: { labels: ['January 2024', 'February 2024', 'March 2024', 'April 2024', 'May 2024', 'June 2024', 'July 2024'], stacked: true, display: false, }, x3: { labels: ['January 2025', 'February 2025', 'March 2025', 'April 2025', 'May 2025', 'June 2025', 'July 2025'], stacked: true, display: false, }, y: { stacked: true, display: false, } } } }, options: { } };
javascript
MIT
a153556861074e827358446ec937555ac58c3d11
2026-01-04T14:56:49.667758Z
false