[Bug 865378] Add support for multiple Y axises.#1333
[Bug 865378] Add support for multiple Y axises.#1333mythmon wants to merge 5 commits intomozilla:masterfrom
Conversation
This uses "axis groups". Each axis group's maximum is calculated, and then the entire group is scaled so that the maximum is 1.0. Then the axises and the hover tool tips are adjusted to show the correct numbers. The scaling is adjusted as the zoom is changed and as acises are toggled on and off. This is kind of hacky, and the more I do this, the more I want to just use d3 directly.
There was a problem hiding this comment.
Divs like this are automatically added now.
There was a problem hiding this comment.
at some point I thought you had all these divs added from js?
There was a problem hiding this comment.
Not all of them, just some. I tried to do all of them, but ran into some issues and decided not to spend more time on it.
|
Oh, and now you can turn multiple sets on and off, with the assumption that they are different axis groups. ie: They are checkboxes instead of radio buttons. |
There was a problem hiding this comment.
so this sets the max of the axis group to the max of all the series' maxes?
There was a problem hiding this comment.
Yes. I'll add a comment, but can you think of a cleaner way to do this?
There was a problem hiding this comment.
You can use _.max. I think something like:
_.max(this.data.series, function(series){ return series.max; });
That should replace this entire for loop?
There was a problem hiding this comment.
Not quite, since this is grouping by the name of the axisGroup. Leaving it for now.
|
This is intense! I can't see it in action yet, can I? |
|
You can see it in action! Check out the history charts, like at |
|
Alphabetized CSS based on feedback ^ |
|
yay it worked! let's |
This uses "axis groups". Each axis group's maximum is calculated, and then the entire group is scaled so that the maximum is 1.0. Then the axises and the hover tool tips are adjusted to show the correct numbers. The scaling is adjusted as the zoom is changed and as axises are toggled on and off. I updated the question stats graph to make use of these features
initDataandmakeSeriesmodified to calculate scales for each axis group, and use them when drawing.r?