dc.js

Removing 0 values from dc js aggregated data table

核能气质少年 提交于 2019-12-11 04:11:50
问题 I have a table with aggregated data that groups on two columns and gets its data from a fake crossfilter dimension: var groupedDimension = ndx.dimension(function(d) {return d.date + "/./" +d.Supplier}) .group().reduceSum(function (d) {return +d.total;}); I cannot get the table to hide rows with 0-values when it is crossfiltered, though. For example, I have tried to tack another fake group onto the fake dimension to get rid of the 0's but that threw an error. Here is the jsfiddle: https:/

dc.js - reduce function selected from radio button

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:03:52
问题 In the last few weeks I have been playing a lot with dc.js while trying to create a simple personal dashboard. I managed to implement a pop-up menu to select the time granularity I want to use for grouping the time dimension of my lineChart and thank to the help from the community I managed to boost performances drastically. Now I am trying to dynamically change the type of aggregation I perform on my grouped data (sum, average, mode, min and max). I found this example incredibly helpful but,

Simplifying a line before rendering on chart in d3

我们两清 提交于 2019-12-11 03:47:27
问题 I am trying to plot data collected live from bee hives. We plan to collect data every 5 minutes, so in a year there will be on the order of 100,000 data points. I want to set up a chart to plot the data, and have new data enter the chart everytime the database changes (using Meteor). I have a simple mockup at datacomb.meteor.com These charts were made using dc.js, a d3 wrapper. Is there a way to use the topojson.simplify (http://bost.ocks.org/mike/simplify/) functionality to pre-process the

How to show scatter plot on specific condition which I set using dc.js

丶灬走出姿态 提交于 2019-12-11 02:45:33
问题 I want a scatter plot composed with a line chart, but I only want the scatter plot to show when the value is not zero. I have data as below, range of val1 is 0~100, range of val2 is -1, 0, 1 [ { val1: 10, val2: 0 }, { val1: 20, val2: 1 }, { val1: 30, val2: -1 }, { val1: 40, val2: -1 }, { val1: 50, val2: 1 }, { val1: 60, val2: 0 }, { val1: 70, val2: 0 }, { val1: 80, val2: 1 }, { val1: 90, val2: 1 }, { val1: 100, val2: 1 } ] I want to show the line chart of val1 every tick and I want to put a

dc.js x axis ordinal chart issue

梦想的初衷 提交于 2019-12-11 02:19:19
问题 I am trying to draw a simple bar chart using crossfilter, dc.js and angular-dc. The piechart works fine. The barchart does not render the bars. In Chrome, if I inspect, I see the values are there. and if I force focus, I do see the charts. I have tried all the suggestions but it seems that there are 3 issues: Bars are starting at 0 The width is 1 px Bars are not rendering on the screen Any pointers? Here is the code: <!DOCTYPE html> <html lang="en"> <head> <title>dc.js - Pie Chart Example<

dc.js - add drop down to select date range

橙三吉。 提交于 2019-12-11 02:19:14
问题 I'm using dc.js to display some info, I would like to add a drop down to select the date range as - All, last 7 days, last 30 days, last 90 days. How would I add that to the following? var dataTable = dc.dataTable("#dc-table-graph"); var data = [ {date: "2014-08-15T06:30:43Z", amount: 10}, {date: "2014-08-12T10:30:43Z", amount: 10 }, {date: "2014-08-1T16:28:54Z", amount: 100 }, {date: "2014-07-28T18:48:46Z", amount: 100 }, {date: "2014-07-26T20:53:41Z", amount: 11 }, {date: "2014-07-16T10:53

dc.js pie chart sum example

百般思念 提交于 2019-12-11 02:11:20
问题 I have records like this : { {"Pass": "10", "Fail": "20", "Untested": "40"} {"Pass": "20", "Fail": "40", "Untested": "50"} {"Pass": "30", "Fail": "50", "Untested": "60"} ... } Obviously, total = pass + fail + untested. I want to sum up each of these values and then finally show a pie chart using dc.js that shows total Pass, total Fail, total Untested. I couldnt find a good example. In the example below, each record is converted to a binary loss/gain value. Then the pie chart shows the

dc.js: Reducing rows in data table

一个人想着一个人 提交于 2019-12-11 02:07:02
问题 So I have a data.table object that is being outputed like this: gender hair-color pets group1.totals group2.totals group3.totals F black Y 10 0 0 F black Y 0 7 0 F black Y 0 0 8 How do I collapse it so that it will be like this? gender hair-color pets group1.totals group2.totals group3.totals F black Y 10 7 8 I have tried reducing the dimensions but it doesn't seem to work. My code is below: ndx = crossfilter(data); dataTable = dc.dataTable('#data-table'); var tableDim = ndx.dimension

How can I use 2 range sliders at the same time?

筅森魡賤 提交于 2019-12-11 01:52:40
问题 I want to filter data in the table based on the age and height at the same time using 2 range sliders. I have implemented 2 range sliders (Age and Height) using d3.slider.js and a dc.dataTable . I want to use these 2 range sliders at the same time, but it seems that they are not working properly. Also, under the table, there is the text "49 selected out of 49 records". The numbers are not changing while using the sliders. Code: var dataTable = dc.dataTable("table#list"); var dispatch = d3

How to filter multiple values in a dc/crossfilter dimension?

試著忘記壹切 提交于 2019-12-11 01:50:00
问题 Let me say that I have this data and dimension: var data = [ {"fruit": "apple", "amount": "12"}, {"fruit": "orange", "amount": "6"}, {"fruit": "grape", "amount": "11"}, {"fruit": "melon", "amount": "26"}, {"fruit": "lemon", "amount": "15"} ] var ndx = crossfilter(data); var fruitDimension = ndx.dimension(function (d) { return d.fruit; }); ...and now, I want to filter just "apple","lemon" and "orange" just by using code. By now, I am trying to do something like. fruitDimension.filter(["apple",