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 using dc.js:
Here is what I tried:
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 do I display the columns export_value
and import_value
as slices of the pie chart?