c3js / c3js/c3

bad scaling for stacked charts with onlyPositive values or only negative values

Open
#1,523 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

Hi,
1. sometimes the chart cuts off some datapoints. so you cant see the full chart.
![bad-scaling-01](https://cloud.githubusercontent.com/assets/11871137/12052933/676da968-af14-11e5-98d7-fd7dc18d41ea.png)
2. sometimes it does not scale well when one data have high values and the other data very low. there is so much space spend for nothing.
![bad-scaling-03](https://cloud.githubusercontent.com/assets/11871137/12053099/fa2976dc-af15-11e5-8963-e5118175cb96.png)
so you would expect to have an autoscaling so your min is about the values of the inner data (the data which is displayed over x-axis).
for case 1.
![bad-scaling-02](https://cloud.githubusercontent.com/assets/11871137/12053158/96fe4f50-af16-11e5-8916-a846ea3ff6db.png)
for case 2.
![bad-scaling-04](https://cloud.githubusercontent.com/assets/11871137/12053162/9f4755bc-af16-11e5-8475-a93338b0c297.png)
I know user who want to use min max to determine the range which will probably change if data is refreshed or changed. min max is also bad because it does not let show the animation when data is hidden or show over the legend. The beautiful dynamic C3 becomes static.

so i have a solution, which is only two line, that provides the behaviour seen in the lower screenshoots. I dont want to spam with pull requests, but I want to share my enchanchements. If someone is interested in this just write comment

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two stacked-chart cases shown in the issue: only-positive or only-negative values, and one series with much larger values than another. Compare the current scaling with the expected ranges in the screenshots, then verify that dynamic scaling still works when data is hidden or shown through the legend. No source file or test is identified, so the chart-scaling entry point must first be located.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.