Chart with categories and rotated axis does not display correctly
See original GitHub issueExample:
chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250, 50, 100, 250]
]
},
axis: {
x: {
type: 'categorized',
categories: ['category 1', 'category 2', 'category 3', 'this is another category', 'cat5', 'cat6', 'cat7', 'cat8', 'cat9']
},
rotated: true
}
});
In the following screnshot, see how the category ‘ticks’ are clipped on the left (not shown is how the tooltips are pushed to the right as well):
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Change the display of chart axes - Microsoft Support
In a chart, right-click the axis that displays the labels that you want to format. On the Home toolbar, click the formatting options...
Read more >Excel Chart not showing SOME X-axis labels - Super User
On the sidebar, click on "CHART OPTIONS" and select "Horizontal (Category) Axis" from the drop down menu. Four icons will appear below the...
Read more >Rotate charts in Excel - spin bar, column, pie and line charts
You can rotate your chart based on the Horizontal (Category) Axis. ... screenshot below, you can see that the chart doesn't fit correctly....
Read more >Graph category axis labels not displaying correctly - Telerik
Hi, Ive got a graph which is very small but has a lot of bars on it, using a category scale. Obviously theres...
Read more >X Axis does not display correctly date and time intervals
I don't know why the min value for the Y axis is so low, assuming you left it as "auto" in the chart...
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 have found an error with the calculation where if we have two labels and the longest one is second on the chart, the padding isn’t calculated correctly:
However, when the longest label is first, it works just fine:
Note that this only happens when there are 2 categories, and if we add 3 or more it works fine.
Here’s the c3 code to reproduce the issue:
I’ve created a jsfiddle to illustrate the point
+1 … only happens with 2 entries.