1

In dc.js examples, everywhere I see dimensions being created based on a column value. But can we create dimension based on column name itself?

What I am trying to do is: I have 3 columns - time stamp, column-A, column-B, column C. I want to create a pie chart (3 slices) where each slice represents total of the values in Column A,B and C respectively.

Gordon
  • 19,811
  • 4
  • 36
  • 74
Andy897
  • 6,915
  • 11
  • 51
  • 86
  • 1
    That's not really how crossfilter works, but you can fake it, with some limitations, as I explained in my answer here: http://stackoverflow.com/questions/24737277/dc-js-how-to-create-a-row-chart-from-multiple-columns – Gordon Dec 01 '14 at 08:14
  • Hi Gordon, Thanks a lot for replying. I am trying to understand why "this is not the way crossfilter works"... not able to understand yet .. any pointers will be a great help. Secondly , is there any way to make the clicking of the rows work too ? In my case, my row chart will be based on days . (Mon, Tue ...) .. so ideally on clicking on Monday I would like pie chart to show data of Monday only .. (my pie chart - each slice represents total of each column by default) – Andy897 Dec 01 '14 at 12:22
  • Looks like you got some good explanations [on the user group](https://groups.google.com/forum/#!topic/dc-js-user-group/zBiRLM1yzEo). Let's continue there. – Gordon Dec 01 '14 at 16:28
  • You definitely could filter on any dimension that is spread across rows, so you could filter by timestamp, days, sure. What you could not do without splitting the data is filter by household A,B,C. Because crossfilter only filters rows in or out. If you don't care about filtering by household then the solution I linked to should work. – Gordon Dec 02 '14 at 06:28
  • Thanks a ton everyone. I got all I needed on group as well as here. Thanks Gordon. I will close this. But I do have another trivial Question :( .. I should probably post it on group – Andy897 Dec 02 '14 at 06:50

0 Answers0