barChart hover over values

12 views
Skip to first unread message

Robert James Liguori

unread,
Jul 27, 2017, 9:49:38 AM7/27/17
to dc-js user group
When hovering over the barChart... my value is "2015-01 1000.123214124".

I would like this to be displayed simply as... "1000.12" instead of "2015-01 1000.123214124".

How may I do this?

Thanks,
Robert

Gordon Woodhull

unread,
Jul 27, 2017, 9:56:13 AM7/27/17
to dc-js-us...@googlegroups.com
--
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/e1b35548-bd8b-4e49-bb3a-d92b7b53a10b%40googlegroups.com.

Robert James Liguori

unread,
Jul 27, 2017, 10:16:09 AM7/27/17
to dc-js user group
Thanks... .title does it!

  .title(function(d) { return Math.round(d.value *100)/100 }) 

Robert

Robert James Liguori

unread,
Jul 27, 2017, 10:41:35 AM7/27/17
to dc-js user group
Why does label need data? and title does not?

.label(function(d) { return Math.round(d.data.value *100)/100 }) 
.title(function(d) { return Math.round(d.value *100)/100 })

Gordon Woodhull

unread,
Jul 27, 2017, 11:08:50 AM7/27/17
to dc.js user group
dc.js has had contributions from a lot of people and the interface is not always consistent. 
(As we've learned, being a maintainer doesn't just mean merging stuff, it means intensive, in-depth reviews, and that did not always happen.)

This particular issue is documented here: https://github.com/dc-js/dc.js/issues/755
Of course, when we fix it, we'll break absolutely everyone's code!


Reply all
Reply to author
Forward
0 new messages