Cannot align bar charts to left
See original GitHub issueHi, thank you for the library!
Expected Behavior
The API should provide an align
property that specifies the overall alignment of the (bar) chart.
Current Behavior
No way to align the bar chart to the left instead of the center.
Steps to Reproduce
new Chart(document.getElementById("foo"), {
type: "bar",
options: {
scales: {
yAxes: [{
display: false,
}],
xAxes: [{
display: false,
}]
},
elements: {
bar: {
borderWidth: 2,
borderColor: "#D2DDEC"
},
point: {
hoverRadius: 0
},
},
legend: {
display: false,
},
},
data: {
labels: Object.keys(values),
datasets: [{
data: Object.values(values),
}]
}
})
Context
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to align ChartJS bars to the left? - Stack Overflow
I want to create a bar chart on ChartJS but I'm not having success when trying to remove this "gap" between the Y-axis...
Read more >Unable to left align text label on bar chart - Tableau Community
I have an issue with aligning the text label for a bar chart. Without any dimensions on the mark shelf, I can get...
Read more >Right or left align text on Y axis of an Excel chart/graph
What to do: Paste the chart in Word or PowerPoint and select the Y axis labels (click on any part of the text)....
Read more >Left align headers on bar charts - Microsoft Power BI Community
Could someone tell me how to left align column headers on bar charts, like. ... I can only seem to have it right...
Read more >How to Fix Long Axis Labels in Excel Charts [PART II] - YouTube
Here's a trick to break your horizontal bar chart's axis labels onto two or more lines. Create your bar chart, copy and paste...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kurkle , apologies, I was not aware of the function of labels in chartjs. The solution was amazingly simple:
@hazod what issue do you think I was suggesting it would solve? https://codepen.io/kurkle/pen/MWeVXYB