c3js / c3js/c3

Legend step is not working when change legend text font-size

Open
#2,840 0 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.20
* **D3 version**:
* **Browser**: Chrome
* **OS**: Windows

There is dependency of font-size to calculate step in updateValues(). It should not be depend on font-size of legend text.
Default is 12px and when I changed it to 10px, steps did not work as expected.

![image](https://user-images.githubusercontent.com/40557245/122866837-3c42eb00-d2ee-11eb-87c0-fd1e3564afa8.png)

```
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25],
['data3', 30, 34, 100, 440, 100, 220],
['data4', 50, 20, 9, 40, 75, 30],
['data5', 150, 18, 9, 40, 75, 30],
]
},
legend: {
position: 'inset',
inset: {
step: 3
}
}
});
```

To fix this I have made below changes to work step as expected.
![image](https://user-images.githubusercontent.com/40557245/122867137-acea0780-d2ee-11eb-815c-bb7bf2e8d5b5.png)
![image](https://user-images.githubusercontent.com/40557245/122867171-b70c0600-d2ee-11eb-9910-1ef6792b283c.png)

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.