c3js / c3js/c3

Category x-axis tick width is incorrect with 2 categories if longest category name isn't first

Open
#1,232 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

I've discovered a bizarre issue where if there are only two categories for a rotated x-axis and the option for axis.x.tick.multiline = false, then the longest category name has to come first in the data provided to the chart, otherwise the width of the ticks will be calculated incorrectly.

As you can see in this first example, the tick content is cut off if the longer category name is not first:
http://jsfiddle.net/b096feng/

But in this second example, where I re-ordered the categories so that the longer category name comes first, the width is calculated correctly:
http://jsfiddle.net/aLhkhbuw/1/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.