Skip to content
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

scatterPlot ordinal axis tick position #1135

Open
alexnb opened this issue May 4, 2016 · 9 comments
Open

scatterPlot ordinal axis tick position #1135

alexnb opened this issue May 4, 2016 · 9 comments
Labels
Milestone

Comments

@alexnb
Copy link
Contributor

alexnb commented May 4, 2016

How can I position the value points directly above the ticks (or the ticks directly under the points), using DC.js. I could not manage that, DC.js (or D3.js) positions the value points shifted to the left of the ticks, although the X-value is exactly the tick value.

See jsfiddle: http://jsfiddle.net/bourbert/59Lmt98w/

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented May 7, 2016

That is so wrong.

image

I think the scatter plot has not been used all that much with an ordinal axis.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone May 7, 2016
@rrameshkumar76
Copy link
Contributor

rrameshkumar76 commented Dec 6, 2016

I am also facing this same issue. For now I just use a composite chart with a scatter chart as a single compose and this fixes the issue with ordinals data for me.

@AbhiramE
Copy link

Is this issue fixed?

@alexnb
Copy link
Contributor Author

alexnb commented May 23, 2018

I updated my original jsfiddle to work with dc.js 3.0.1, the issue is still there.

@rrameshkumar76
Copy link
Contributor

Looks like there is a new PR #1361 for scatter plots. I will also check if this works with the above PR.

@gordonwoodhull
Copy link
Contributor

You can work around this by setting

scatter._rangeBandPadding(1);

Not sure why this would happen automatically for a composite chart. I'm also not entirely sure why it works - I'd be hesitant to "fix" the scatter plot this way without understanding why.

@alexnb
Copy link
Contributor Author

alexnb commented May 23, 2018

@gordonwoodhull @rrameshkumar76 Thank you for quick replies.

I could test that calling

scatter._rangeBandPadding(1);

fixes this issue for scatterPlot, lineChart displayed alone as well as in composite / series chart (there it must be called on the composite/series parent chart)

@rrameshkumar76 BTW, I also could not fix the issue by just using the composite chart, see http://jsfiddle.net/bourbert/buy69azc/3/

@gordonwoodhull
Copy link
Contributor

I can see how putting a blank line chart in a composite with a scatter plot could fix this, since a composite chart and all of its children share the same scale. This ends up calling scaleBand.paddingInner on the scale.

Why the axis does not appear to use the same scale (or same scale, different settings) still confuses me.

@rrameshkumar76
Copy link
Contributor

rrameshkumar76 commented May 23, 2018

@alexnb Just checked I use ._rangeBandPadding(1) in compose chart. Please see http://jsfiddle.net/rrameshkumar76/fjrozda3/2/ Same as mentioned by @gordonwoodhull and confirmed by you. But now realizing that I can remove compose chart and set this setting on Scatter itself based on above comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants