Skip to content

Y Axes alignment option: addendum#1033

Closed
gazal-k wants to merge 4 commits into
dc-js:developfrom
gazal-k:composite-chart-enh2
Closed

Y Axes alignment option: addendum#1033
gazal-k wants to merge 4 commits into
dc-js:developfrom
gazal-k:composite-chart-enh2

Conversation

@gazal-k

@gazal-k gazal-k commented Oct 31, 2015

Copy link
Copy Markdown
Contributor

Follow up to #985

separated the code for aligning axes into function alignYAxisRanges to
reduce cyclomatic complexity
@gordonwoodhull

Copy link
Copy Markdown
Contributor

Just as a progress report, I'm merging this in the hotfix/2.0.0-beta.32 branch. Here is a matrix of the 25 cases which I'm adding as an example and visual test case.

(There are at least 25 cases because left and right can each be all positive, mostly positive, even positive/negative, mostly negative, or all negative.)

image

Looks like the current heuristic gets many cases well, but severely squishes one series or the other in about 8 cases, and loses one or the other in two cases.

I'm going to try a more comprehensive approach.

gordonwoodhull added a commit that referenced this pull request Jul 17, 2016
this closes #1033 - a very simple, clear implementation
will revisit when we implement #667 allowing stack charts to depart
from the y axis.
gordonwoodhull added a commit that referenced this pull request Jul 18, 2016
gordonwoodhull added a commit that referenced this pull request Jul 19, 2016
this closes #1033 - a very simple, clear implementation
will revisit when we implement #667 allowing stack charts to depart
from the y axis.
gordonwoodhull added a commit that referenced this pull request Jul 19, 2016
gordonwoodhull added a commit that referenced this pull request Jul 28, 2016
@gordonwoodhull

Copy link
Copy Markdown
Contributor

Improved algorithm:
image
image
http://dc-js.github.io/dc.js/examples/align-axes.html

@gordonwoodhull

Copy link
Copy Markdown
Contributor

Live in 2.0 beta 32. Thanks @gazal-k!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants