Line chart data points not coming at the center of bar chart in compose chart

18 views
Skip to first unread message

Nitesh Nagpal

unread,
Aug 11, 2017, 2:51:35 AM8/11/17
to dc-js user group

Hello Sir,

I am working compose chart for making line chart and bar chart on right axis, but the problem is, the line starts from the start of bar chart,not at the center of bar chart, which makes the chart difficult to understand.

I tried using ._rangeBandPadding(1) in compose chart and .gap(1).centerBar(true).barPadding(2) in bar chart, but it makes the bar chart very thin, width equal to line chart, which is again difficult to understand.

I have searched this at many places, but I got nothing, please help me with this.

Hoping to solve my query as soon as possible.

Thanks

Gordon Woodhull

unread,
Aug 11, 2017, 7:23:58 AM8/11/17
to dc-js-us...@googlegroups.com
Can you share an example, e.g. a jsfiddle or block?

I think you're on the right track with centerBar; it's probable that your xUnits is incorrect - that's usually what screws up bar width. rangeBands and gap are incompatible and I don't knew what happens when you specify one on the child and the other on the composite.
--
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/bec2245d-d30e-41ba-9c66-f54b51e2f75d%40googlegroups.com.

Gordon Woodhull

unread,
Aug 14, 2017, 10:16:42 PM8/14/17
to dc-js-us...@googlegroups.com
Ah, I see it may have been me that came up with the screwy idea of mixing rangeBands and gap in a composite chart. :-S


It's really complicated to implement all these features so they automatically "align" geometrically and methodologically. dc.js gets a lot of these cases right, but misses a lot more. At least it's tweakable.
Reply all
Reply to author
Forward
0 new messages