0

Here's the fiddle.

I've plotted a line graph with the average of values using dc.js.

And for the data table I've successfully created it using jquery data table.

Now in the data table, entire data is getting displayed according the selection.

Is there any possibilities that I can show unique records grouped under the label column.

Tried grouping and passed it to aaData column. But when i do any selection nothing appears.

Any help will be very much pleased.

user3206082
  • 431
  • 9
  • 18

1 Answers1

0

You should use one of your group variables to feed the data to the table:

http://jsfiddle.net/djmartin_umich/3v68c/

var datatable = $('.table').dataTable({
        "aaData" : dateDimTotal.top(Infinity),
        "bDestroy": true,
        "aoColumns": [
            { "mData": function(d) { return d.key; }, "sDefaultContent": ""},
            { "mData": function(d) { return d.value.count; }, "sDefaultContent": ""}
        ]
    })
DJ Martin
  • 2,579
  • 20
  • 24
  • Can't I do it for multiple columns? Also when i do some selection. Nothing is changing the table. – user3206082 Feb 11 '14 at 09:18
  • Here is an answer about making a data table responsive to the dc chart filters: http://stackoverflow.com/questions/21596616/dc-js-data-table-using-jquery-data-table-plugin/21691767#21691767 – DJ Martin Feb 11 '14 at 20:43
  • That question was asked my be only. But here I'm looking to display the count of something when a selection is done. What you've provided me in the fiddle here is absolutely correct. But I want to add more columns to it and make those data responsive to the selection of the chart range. Please help. – user3206082 Feb 12 '14 at 04:51
  • Here is a jsfiddle that shows how that could work with dynatable: http://jsfiddle.net/djmartin_umich/5jweT/2/ – DJ Martin Feb 13 '14 at 00:46
  • Martin - Is there any possibilities of adding multiple column? – user3206082 Feb 14 '14 at 06:01
  • It's nor changing on selection. Anyways I'll give a try usin `dynatable` and I may seek for your help if it's required again. Thank you very much. And i don't know how did it work you used a `valueAccessor`. It didn't work when i used :) – user3206082 Feb 15 '14 at 12:50
  • Correct - the answer as submitted above will not change when other filters are selected. The answer at http://stackoverflow.com/questions/21596616/dc-js-data-table-using-jquery-data-table-plugin/21691767#21691767 shows how to make it responsive to other filters. – DJ Martin Feb 15 '14 at 16:14
  • One more help please. I've updated the [**`fiddle`**](http://jsfiddle.net/3v68c/3/) with one more column named label. I wanted to display another column in the table with what you've given me already. But the problem is I won't be able to add another column in the dimension. Give me a suggestion please. – user3206082 Feb 17 '14 at 06:43
  • Try to think through how the grouping is happening. You currently have a dimension built on the date and a grouping that sums and averages the value. If you want your table to have label listed next to these grouping values, you probably need to change your dimension to group by both date and label. – DJ Martin Feb 17 '14 at 14:36
  • Yes you are right. I need to build a dimension with multi columns. I searched all over stackoverflow and google too. But i didn't even a single link for that. I guess there is no possibilities of building dimension on multi columns using crossfilter. Please help me if you know how to build dimension on multi columns. – user3206082 Feb 17 '14 at 16:25
  • Do you mind opening up a new question for that? A multi-column dimension seems like a good stand alone topic for StackOverflow and if you can't find a good reference we should have a specific question for it – DJ Martin Feb 17 '14 at 19:53
  • [**`Link`**](http://stackoverflow.com/questions/21844704/dc-js-create-multiple-column-dimension) - please check. – user3206082 Feb 18 '14 at 07:03