RangeChart is filtered as well when the scale is declared as a var

16 views
Skip to first unread message

Sofia Rodrigues

unread,
Jan 19, 2017, 10:55:27 AM1/19/17
to dc-js user group
For the reference, never store the x scale in a var and then feed it to a bar chart that is serving as range chart. It freaks out and filters its own x domain as well o_o I thought I was going mad >_>

Gordon Woodhull

unread,
Jan 19, 2017, 11:55:04 AM1/19/17
to dc.js user group
Good point! Yeah, you almost never want to share scales between charts - dc.js is setting the domain (and range) all the time. It's easy to run into this problem because objects are passed by reference in JavaScript.

If you do need to share scale parameters between charts, you can use scale.copy():


On Jan 19, 2017, at 10:55 AM, Sofia Rodrigues <kuro...@gmail.com> wrote:

For the reference, never store the x scale in a var and then feed it to a bar chart that is serving as range chart. It freaks out and filters its own x domain as well o_o I thought I was going mad >_>

--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on  the web visit https://groups.google.com/d/msgid/dc-js-user-group/bfdeb32c-b554-4449-bba2-b1ac6290a246%40googlegroups.com.

Sofia Rodrigues

unread,
Jan 19, 2017, 1:08:05 PM1/19/17
to dc-js user group
Yep and I found out the hard way xD
Reply all
Reply to author
Forward
0 new messages