mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-08 05:09:08 +02:00
ae0c8dd457
* align text inside chart for far-aligned labels * added fix for failing test on suggestion of @kurkle Co-authored-by: Marcel Samyn <marcel.samyn@lab900.com>
33 lines
470 B
JavaScript
33 lines
470 B
JavaScript
module.exports = {
|
|
config: {
|
|
type: 'bar',
|
|
data: {
|
|
datasets: [{
|
|
data: [1, 2, 3],
|
|
}],
|
|
labels: ['Long long long long label 1', 'Label 2', 'Less more longer label 3']
|
|
},
|
|
options: {
|
|
indexAxis: 'y',
|
|
scales: {
|
|
y: {
|
|
position: 'left',
|
|
ticks: {
|
|
crossAlign: 'far',
|
|
},
|
|
afterFit: axis => {
|
|
axis.width = 64;
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
options: {
|
|
spriteText: true,
|
|
canvas: {
|
|
height: 256,
|
|
width: 512
|
|
}
|
|
}
|
|
};
|