mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 04:39:06 +02:00
15d1056b53
When `barThickness: undefined|null` (default), we compute an optimal sample size based on the smallest tick interval reduced to prevent any bar to overlap (bar equally sized). Also added support for a special `barThickness: 'flex'` value (previous default) that globally arranges bars side by side to prevent any gap when percentage options are 1 (variable bar sizes).
44 lines
1.1 KiB
JSON
44 lines
1.1 KiB
JSON
{
|
|
"config": {
|
|
"type": "bar",
|
|
"data": {
|
|
"labels": ["2016", "2018", "2020", "2024", "2030"],
|
|
"datasets": [{
|
|
"backgroundColor": "#FF6384",
|
|
"data": [1]
|
|
}]
|
|
},
|
|
"options": {
|
|
"responsive": false,
|
|
"legend": false,
|
|
"title": false,
|
|
"scales": {
|
|
"xAxes": [{
|
|
"type": "time",
|
|
"display": false,
|
|
"barPercentage": 1,
|
|
"categoryPercentage": 1,
|
|
"ticks": {
|
|
"source": "labels"
|
|
},
|
|
"time": {
|
|
"min": "2013"
|
|
}
|
|
}],
|
|
"yAxes": [{
|
|
"display": false,
|
|
"ticks": {
|
|
"beginAtZero": true
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"canvas": {
|
|
"height": 256,
|
|
"width": 512
|
|
}
|
|
}
|
|
}
|