dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.41k stars 1.81k forks source link

ScatterPlot - x axis on top #1815

Closed aberenyi closed 3 years ago

aberenyi commented 3 years ago

Hi there,

I've tried to implement a workaround based on this similar issue https://github.com/dc-js/dc.js/issues/1433 for the scatter series example (fiddle).

It looks like the initial position of the axis is fine, but then it's overwritten resulting in an animated movement.

Something like the useRightYAxis for the x axis would be really useful, e.g useTopXAxis, but a workaound would also do for now.

Cheers

gordonwoodhull commented 3 years ago

Good idea. I think it would be fairly easy to add useTopXAxis to CoordinateGridMixin - just search for useRightYAxis and make the corresponding changes for the X axis. It's only used in four methods, one of them the getter/setter.

It is technically possible to add event handlers on both pretransition and renderlet as a way to override both initial and animated position. But it's probably easier just to add the functionality instead.

I'd be glad to help if you want to give it a try!

aberenyi commented 3 years ago

@gordonwoodhull sound like a plan!

Will give this a go ASAP and will get back to you.