chart 3.9.1 - bar - left space #10961
enricodeveloper
started this conversation in
General
Replies: 1 comment 1 reply
-
@enricodeveloper I have answered you in SO. Anyway let me highlight there are some issues on the configuration you provided: var options = {
categoryPercentage: 1, // <-- must be defined here
tooltips: { // <-- wrong name and position. must be "tooltip" and move in "plugins" node (below with other plugins)
enabled: false
},
plugins:
{
datalabels:
{
color: 'white'
},
legend: {
position: 'top',
labels:
{
font: {size: 10},
usePointStyle: true
}
}
},
scales:
{
x: {
barPercentage: 6.5, // wrong, to be removed
categoryPercentage: 0.1 // wrong, to be removed
},
y: {
barPercentage: 1, // wrong, to be removed
categoryPercentage: 1, // wrong, to be removed
beginAtZero: true,
grace: '3%',
ticks: {
beginAtZero: true // wrong, to be removed
}
}
}
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
how do i reduce the space between the bar and the y scale? I tried with padding but it doesn't work
Thanks
This is my config
`var options = {
tooltips: {
enabled: false
},
plugins:
{
datalabels:
{
color: 'white'
},
legend: {
position: 'top', labels:
{
font: {size: 10},
usePointStyle: true
}
}
},
scales:
{
x: {
barPercentage: 6.5,
categoryPercentage: 0.1
},
y: {
barPercentage: 1,
categoryPercentage: 1,
beginAtZero: true,
grace: '3%',
ticks: {
beginAtZero: true
}
}
}
};
var barChart = new Chart(document.getElementById("chart3"), {
type: 'bar',
data:
{
labels: [""]
},
options:options
});
for (i = 0; i < parsed[0].length; i++)
{
barChart.data.datasets.push({ label: parsed[0][i].label, backgroundColor: parsed[0][i].backgroundColor, data: ["" + parsed[0][i].data + ""], pointStyle:'circle' });
}
barChart.update();`
Beta Was this translation helpful? Give feedback.
All reactions