-
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
composite chart always uses elasticY() #1056
Comments
You need to set it for the composite chart. Everything is top-down in the composite chart. |
I've done that too. Forgot to set that in the code above. |
Or, more precisely, the domain is shared between the charts of a composite: calculated on the parent based on the children, and then passed down to the children. |
Nope, no globals. If you can share a full example I can help you track it down. I'm pretty sure it's not a bug in dc.js. |
I'm afraid the site is password protected |
If all charts already have an domain set, what's to be calculated? |
Can't help you without working code to look at, sorry. Sorry, but the issue tracker is for reporting bugs and making enhancement requests, not for general support questions. Please ask on Stack Overflow with the dc.js tag, or on the user group, and we will be glad to help you there. I am closing this. |
Apologies, I closed this too fast. I created a test case using the composite example and indeed, the domain is overwritten by the elasticY even when elasticY is not enabled. It's a bug I introduced in beta 20 (2dd561f) when working on resizing issues. The y scale domain should not be set when resizing, only the range. |
Fixed on master; will be fixed in beta 23 later today. |
as part of fix for dc-js#1056
I cannot convince my composite chart NOT to use an elastic Y-axis
I've got a composite chart. 2 charts use the left y-axis, which should have a domain([0,10]), the right-axis is preferably elastic, but the issue occurs also when I give it a domain
in short:
chart1 = dc.lineChart( _chart )
.y( d3.scale.linear().domain([0,10])
.elasticY( false )
chart2 = dc.lineChart( _chart )
.y( d3.scale.linear().domain([0,10])
.elasticY( false )
chart3 = dc.lineChart( _chart )
.y( d3.scale.linear().domain([0, maxValue])
.elasticY( false )
.useRightYAxis(true)
combo = dc.compositeChart( element )
.compose( [chart1,chart2,chart3])
Still both axes are elastic.
After some debugging I found this (line 2459 in dc.2.0.0-beta.5)
_chart._prepareYAxis = function (g) {
if (_y === undefined || _chart.elasticY())
_y always is undefined, even though I've set .y() for all charts
The text was updated successfully, but these errors were encountered: