0

Using this fake dataset:

Data

I want to make a row chart that has two rows, one for the savings_1 total and one for savings_2 total.

Something like:

savings_1 [            1970            ]
savings_2 [   258   ]

I am pretty new to dc.js and d3.js so I am not sure how to structure the group/dimension to make this possible.

var savingsDimension = ndx.dimension(function(d) {
  return 'Savings 1'
}), savingsDimensionGroup = noDimension.group().reduceSum(function(d) {
  return d.savings_1
});

Using that dimension and group, it gives me the total for just one of the savings. I feel like there is a way to get both groupings with the same group/dimension.

hlee
  • 239
  • 3
  • 13
  • See also this follow up: http://stackoverflow.com/q/34299017/676195 – Gordon Dec 22 '15 at 12:02
  • Awesome! Thank you for linking those questions. The first one was definitely what I was looking for and it worked perfectly. – hlee Dec 22 '15 at 16:23

0 Answers0