Labels cut off in chart
See original GitHub issueI have a bar chart with rotated axes. The labels are a little long and are getting cut off. Here is a live demo:
https://dl.dropboxusercontent.com/spa/juxddtvfvlf51yv/Sample/test.html
Here is the code:
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250, 30, 200, 100, 400, 150, 250, 50, 50, 50, 50]
],
type: 'bar'
},
bar: {
width: {
ratio: 0.25 // this makes bar width 50% of length between ticks
}
// or
//width: 100 // this makes bar width 100px
},
axis: {
x: {
type: 'categorized',
categories: ['City: Police and Fire', 'City: General Fund', 'City: Public Library', 'Board of Liquidation', 'Sewerage and Water Board', 'Audubon Zoo', 'Audubon Aquarium', 'Board of Assessors', 'School Board', 'Levee Board', 'Law Enforcement', 'Economic Development','Parkway and Recreation Department', 'Capital Improvement', 'Street and Traffic Control', 'Police and Fire']
},
rotated: true
}
});
Issue Analytics
- State:
- Created 9 years ago
- Comments:27 (6 by maintainers)
Top Results From Across the Web
Solved: Chart Text Getting Cut off - Power Platform Community
Solved: all my chart text texts get cut off. ... Option 1 - Increase height of chart control until all the labels fit...
Read more >Solved: Y axis labels cut off in barchart
Solved: Of course I have limited space on my dashboard but I'd like to see the axis of my barchart. Can I adjust...
Read more >X-axis labels not completely showing in chart - Mr. Excel
Hello, I have a chart that I am trying to create but my x-axis labels will not completely show up. It works perfectly...
Read more >Report labels cut off in bar chart - ServiceNow Community
Hi, We have bar chart that we are creating but the issue is that the report labels cut off in bar chart ,...
Read more >python - How to stop the x-axis labels from getting cut off from ...
You can try plt.tight_layout() . · Neither of them have any effect on the final graph. Mar 12, 2020 at 16:43 · When...
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
I had the same problem:
Simply add
to your chart config. To set a dynamic value, I’m using a little jQuery Plugin that gets the length of a text-string:
Any update in this issue ? I am still getting this.