dc.js

Crossfilter filters not filtering (dc.js)

╄→гoц情女王★ 提交于 2019-12-20 06:03:43
问题 I'm trying to use filters in crossfilter, but nope. Here's the JSBin Here's the most relevant code: var userDimension = data.dimension(function(d) {return d.user;}).filter(['John', 'Paul']); var totalSalesByUser = userDimension.group(); var pieChartUserSales = dc.pieChart("#pie-chart-sales-by-user"); pieChartUserSales .width(150).height(150) .dimension(userDimension) .group(totalSalesByUser); dc.renderAll(); The pie chart looks the same with and without the filter, but the effect I'm looking

dc.js - Creating a row chart from multiple columns and enabling filtering

时光总嘲笑我的痴心妄想 提交于 2019-12-20 05:11:34
问题 This is similar to dc.js - how to create a row chart from multiple columns but I want to take it a step further and enable filtering when the rows are clicked. To answer the question "What is it supposed to filter?" - Only show records with value > 0. For example when Row 'a' is clicked it will only show records with value for a > 0. Hence, the Type pie chart will change to foo:1, bar:2 I guess I have to overwrite onClick method? But I am not sure how. chart.onClick = function(d) {} jsfiddle

DC.js - deselect feature or filter all but the ones that are clicked

旧城冷巷雨未停 提交于 2019-12-20 04:23:33
问题 I'm not sure if this is possible and no luck on researching this. I'm working on a dashboard using DC.js charts and crossfilter.js. I'm going to use a Row chart as an example. Instead of clicking on the items to filter, is it possible to do that opposite? For example. When I click on an item from a row chart, instead of filtering on that selected item, it will deselect that item and filter the rest of the other items. And then I will keep clicking on other items to deselect. Pretty much my

create multiple charts from data groups of the same column

我与影子孤独终老i 提交于 2019-12-20 02:59:05
问题 How to make this dashboard from this data time,group_name,value 15/10/2017 15:36:15,group-1,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:16,group-1,1 15/10/2017 15:36:16,group-3,1 15/10/2017 15:36:16,group-1,1 15/10/2017 15:36:16,group-3,1 15/10/2017 15:36:17,group-3,1 15/10/2017 15:36:17,group-3,1 15/10/2017 15:36:17,group-1,1 15/10/2017 15:36:17,group-2,1 15/10/2017 15:36:18,group-1,1 15/10/2017 15:36:18,group-1,1 15/10/2017 15

Can I filter data based on an intersection (and) in crossfilter/dc.js?

流过昼夜 提交于 2019-12-20 02:47:05
问题 I have the following example on jsfiddle: https://jsfiddle.net/woolycew65/bp5eavxy/ and am curious if I can select pie slices TP-0 and TP-2 to mean find the patients that have both timepoint 0 and timepoint 2, not 0 or 2. A sample of the dataset is shown below: let data = [ {patientId: 101, site: "AAA", timepoints: [0, 2, 4, 6, 8, 12, 18, 24]}, {patientId: 102, site: "AAA", timepoints: [0, 2, 4, 6]}, {patientId: 103, site: "AAA", timepoints: [8, 12, 18, 24]}, {patientId: 104, site: "AAA",

Dc cross-filter not working

两盒软妹~` 提交于 2019-12-19 11:42:35
问题 Building a grails application using dc & cross-filter js libraries here, but facing an extremely weird issue in the visualization somehow. My visualization is of 5 bar charts, which are interconnected to each other using dc and cross-filter js libraries. So, there are simple metrics , calculated metrics (%) and lastly calculated metrics (without %) . For these three types, there are three different types of if-else in each part of code (for 5 bar charts) But, the problem lies in the last if

Dc cross-filter not working

自作多情 提交于 2019-12-19 11:42:09
问题 Building a grails application using dc & cross-filter js libraries here, but facing an extremely weird issue in the visualization somehow. My visualization is of 5 bar charts, which are interconnected to each other using dc and cross-filter js libraries. So, there are simple metrics , calculated metrics (%) and lastly calculated metrics (without %) . For these three types, there are three different types of if-else in each part of code (for 5 bar charts) But, the problem lies in the last if

Updating dc.js data and reapplying original filters

懵懂的女人 提交于 2019-12-19 08:12:49
问题 I'm trying to build a reproducible example of this question about how to replace a crossfilter data restoring dimensions and groups - i.e. reapplying any filters created by the user before data is updated. Here's my stab at implementing the accepted answer. Here's a working jsfiddle. The script refreshes after 3 seconds to switch from data1 to data2 . If you apply a filter before then (e.g. click Mr A ), the filter is 'remembered' when the graphs update as the right element is highlighted

dc.js/crossfilter -> How to sort data in dc.js chart (like row) - Ascending x Descending

只愿长相守 提交于 2019-12-18 18:39:35
问题 How to sort data in dc.js chart (like row) - Ascending x Descending I want to reorder the chart (row/column) by specified attribute (like 'avg' -> ascending) I'm trying to use ".top()"... but unsuccessfully Thanks draft below jsfiddle -> ewr5Z/2/ 回答1: You can use the ordering method: chart.ordering(function(d){ return -d.value }) If you write a custom reduce, you can have more flexibility: priceDimension = ndx.dimension(function(d) {return d.part_number; }); priceGroup = priceDimension.group(

dc.js/crossfilter -> How to sort data in dc.js chart (like row) - Ascending x Descending

五迷三道 提交于 2019-12-18 18:39:11
问题 How to sort data in dc.js chart (like row) - Ascending x Descending I want to reorder the chart (row/column) by specified attribute (like 'avg' -> ascending) I'm trying to use ".top()"... but unsuccessfully Thanks draft below jsfiddle -> ewr5Z/2/ 回答1: You can use the ordering method: chart.ordering(function(d){ return -d.value }) If you write a custom reduce, you can have more flexibility: priceDimension = ndx.dimension(function(d) {return d.part_number; }); priceGroup = priceDimension.group(