c3js / c3js/c3

When x tick count set, only show 2 ticks for categories

Open
#1,638 2 comments 0 reactions 0 assignees View on GitHub
C-bug
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

When categories array is large, trying to show just show 10 of them by setting tick_count = 10, but only two ticks shows.
Here are the jsfiddle: [https://jsfiddle.net/Dekai/ysdaha7o/6/](https://jsfiddle.net/Dekai/ysdaha7o/6/)

Sample code Snippet:
var dataCategories = ["01 Jan 2016", "02 Jan 2016", "03 Jan 2016", "04 Jan 2016", "05 Jan 2016", "06 Jan 2016", "07 Jan 2016", "08 Jan 2016", "09 Jan 2016", "10 Jan 2016", "11 Jan 2016", "12 Jan 2016", "13 Jan 2016", "14 Jan 2016", "15 Jan 2016", "16 Jan 2016", "17 Jan 2016", "18 Jan 2016", "19 Jan 2016", "20 Jan 2016", "21 Jan 2016", "22 Jan 2016", "23 Jan 2016", "24 Jan 2016", "25 Jan 2016", "26 Jan 2016", "27 Jan 2016", "28 Jan 2016", "29 Jan 2016", "30 Jan 2016", "31 Jan 2016", "01 Feb 2016", "02 Feb 2016", "03 Feb 2016", "04 Feb 2016", "05 Feb 2016", "06 Feb 2016", "07 Feb 2016", "08 Feb 2016", "09 Feb 2016", "10 Feb 2016", "11 Feb 2016", "12 Feb 2016", "13 Feb 2016", "14 Feb 2016", "15 Feb 2016", "31 Mar 2016"];

```
axis: {
x: {
type: 'category',
categories: dataCategories,
tick: {
count: 11
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior using the linked JSFiddle and the axis.x category configuration with tick.count set to 11. Trace the category x-axis tick-count handling and verify that the requested number of category ticks is rendered for the sample data.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.