-
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
Ordinal series sorting #156
Comments
Interesting idea. I think you can do that with the existing implementation though probably not as usable. Sort your group in crossfilter then use sorted keys to generate the domain for your x scale. Does that solve your problem? |
Yes, I have already been able to produce ordered ordinal charts with something like that:
However, when this chart react to a selection made on another chart, this solution shows its limits. It is not possible to reorganise dynamically the ordinal axis. I wondered if a solution based on d3 scales would allows to handle this use case. |
What if you resets the x domain in .on("filtered", function(chart, filter){...}) hook, will that give you the desired effect? |
Great, thank you, it seems to be a good start. The bars are well sorted, however the legends remains at the same place. Any idea? |
It seem's to work when I call the render method that reset the chart completely. |
Thank you very much, dc.js is a fantastic tool. It's even possible to use the redraw function to render the chart. The only requirement is to make the x axis elastic and everything works perfectly. |
Glad you have found to way to make it work :-) If you want to force a x axis re-render you can use the following code in postRedraw hook: chart.renderXAxis(chart.g()); |
It would be great to add ordinal chart sorting. This could probably be achieved by creating a custom D3 scale based on the ordinal one that use a crossfilter group to manage the order of the absis.
May become:
The main application could be the creation of Pareto Charts.
The text was updated successfully, but these errors were encountered: