c3js / c3js/c3

stanford chart legend axis without any ticks values

Open
#2,635 3 comments 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

* **C3 version**: 0.7.1
* **D3 version**: 4.13.2
* **Browser**: Chrome/Firefox
* **OS**: Windows

#2595

Hi all,

I'm using the new stanford chart feature and it works pretty well !

I just encounter an issue with the **legendAxis**, I will try to explain it. Here is an image of the charts that generate :

![charts-data](https://user-images.githubusercontent.com/5701109/60606548-d8028600-9dbb-11e9-902e-89c459e588d8.png)

Problem is that on the right chart, the legendAxis don't have any ticks values. It is due to the values of **scaleMin** and **scaleMax** of my chart but I does not understand enough D3 to know why ?!

**left chart** : scaleMin = 3.614 and scaleMax = 21.74
**right chart** : scaleMin = 34.935 and scaleMax = 35.834

I've tried to implement a custom format function for **scaleFormat** attribut with some logs but nothing pop in the console for the right chart :
```
const functFormat = (value) => {
console.log(value);
return d3.format("d")(value);
}
```

I've created a JSFiddle with the issue on a simpler dataset if someone want to manipulate :

https://jsfiddle.net/grxcdvLq/

As an example, if you replace _scaleMin: 34.985_ by _scaleMin: 1_ in the JSFiddle the ticks values of the legend axis appears.

Any idea of how to solve my issue ? Thanks for you help !

Brest regards,
Leo.

Contributor guide

Open the contributing guide

Research direction

Start with the linked JSFiddle using C3 0.7.1 and D3 4.13.2, focusing on the Stanford chart legendAxis with the reported scaleMin and scaleMax values. Compare tick generation for the narrow range against the working range, then verify that the legend axis displays tick values without breaking the existing chart behavior.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.