dc.js pie-chart combine 2 columns

49 views
Skip to first unread message

spec...@gmail.com

unread,
Feb 9, 2017, 6:46:26 AM2/9/17
to dc-js user group

I have a table.


year,continent,state,export_value,import_value,all 

2013,Африка,Angola,94061754,220518.54,94282272.54 

2013,Африка,Burundi,4136818,1239175.91,5375993.91 

2013,Африка,Benin,3251643.49,65421.6,3317065.09


I need to make a pie chart enter image description here using dc.js


Problem at this point code.

    impexDim            = ndx.dimension(function (d) {return ((d.export_value > 0 ? 'Export' : 'Import') 
                                        && (d.import_value > 0 ? 'Import' : 'Export')) ;}),

    groupeimpexDim      = impexDim.group().reduceSum(function(d) {return +d.all}),


How to combine columns export_value and import_value?

Gordon Woodhull

unread,
Feb 9, 2017, 9:58:26 AM2/9/17
to dc-js-us...@googlegroups.com
I'll respond to this on SO

(please don't cross-post)
--
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/2ef4cdd1-721e-43b4-93db-5064e683cc0b%40googlegroups.com.
Message has been deleted

spec...@gmail.com

unread,
Feb 9, 2017, 12:15:56 PM2/9/17
to dc-js user group
Thanks, ok.

четверг, 9 февраля 2017 г., 17:58:26 UTC+3 пользователь Gordon Woodhull написал:
Reply all
Reply to author
Forward
0 new messages