-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidirectional two-stack row chart #510
Comments
Seems like this would be a good candidate for using a renderlet (instead of a unique chart type). Here is an example of using a renderlet to create a stacked row chart from a bar chart: |
I am currently using a stacked bar chart similar to your example, but it doesn't allow centered bars with a two-way axis from the origin (e.g. +10..0...+10, with no negative values). See the image in the first post for an example chart. Additionally it's less straightforward with bar charts to do things like stacked top 10 charts with an ordinal x (e.g. top 10 car manufacturers by total quantity = sedans + trucks), as the ordinals have to be manually dynamically generated whereas the row chart generates them automatically. |
It occurs to me that this is a variety of "facet" or "small multiple" #160. Currently dc.js only supports composites for multiple graphs in one - the charts usually share one or both scales and are superimposed in the z dimension. If instead they were offset in x or y, we are halfway there. The other part would be having the same scale for the two halves, only mirrored. |
@jefffriesen Your jsfiddle doesn't work anymore I've created a working version http://jsfiddle.net/moshequ/RWs67/111/ |
@moshequ cool, thanks for updating it. |
See this image for an example.
These charts are similar to stacked charts for paired data (e.g. male/female). Whereas a usual stacked chart is good at showing the aggregate of two or more stacks (or the composition of the total i.e. a + b + c = total), a bi-directional chart more effectively shows the difference between two stacks across different bins.
An ideal implementation would use the same scale on both halves and be implemented as a stacked row chart (issue #397) with 2 and only 2 stacks, with an option 'bi-directional' which only takes effect if there are only 2 stacks.
In the meantime, it may be simulated by firstly allowing the regular row chart to be flipped horizontally (i.e. vertical axis and origin move to the right side of the graph) and then displaying the graph adjacent to a regular row chart.
The text was updated successfully, but these errors were encountered: