dc.js

Custom timeline tick with d3 and dc.js

蓝咒 提交于 2019-12-24 06:01:51
问题 I have next chart: scrollChart ... .x(d3.time.scale().domain([startDate, endDate])) .round(d3.time.minutes) .alwaysUseRounding(true) .xUnits(d3.time.minutes); How can I change my .xUnits and .round to use each 5/10/15 minutes as an time interval? Update: Gordon's answer helped, but I have new problem after zooming. This is 5 mins interval: And after my zooming I have bad chart :( How can I 'reGroup' all to 1 min interval after filtering? Is it real? 回答1: Thanks Gordon for help. I used d3.js

remove empty bins with reduce Add Remove function not working

南笙酒味 提交于 2019-12-24 05:54:10
问题 I'm looking for a solution in how I can remove empty bins when using a reduce Add/Remove function. I have a jsfiddle here Empty bins are removed when I want to provide a simple sum of 'Points', but not when I want to use an average calculation and using the valueAccessor in the charts. My data is set up as follows: {Season:"2016/17", Manager:"Alan Curtis", Points:1, Formation:"4231", date:"01 February 2017"}, {Season:"2016/17", Manager:"Paul Clement", Points:1, Formation:"442", date:"01

How can I color my scatter using a vector with values?

☆樱花仙子☆ 提交于 2019-12-24 03:53:05
问题 Well, I want to color my scatter using a vector with values. Actually, I want to use other dimension than the one used for creating the scatter. Using these lines it gives a color to my scatter using the values given by the dimension that scatter is built on. .colorAccessor(function(d) {return d.key[1]}) .colors(d3.scaleSequential(d3.interpolateOranges)) .colorDomain(y_range) y_range = [y_min, y_max] I tried to include the column for color in the dimension of the scatter, but it slows down

How can I color my scatter using a vector with values?

狂风中的少年 提交于 2019-12-24 03:52:25
问题 Well, I want to color my scatter using a vector with values. Actually, I want to use other dimension than the one used for creating the scatter. Using these lines it gives a color to my scatter using the values given by the dimension that scatter is built on. .colorAccessor(function(d) {return d.key[1]}) .colors(d3.scaleSequential(d3.interpolateOranges)) .colorDomain(y_range) y_range = [y_min, y_max] I tried to include the column for color in the dimension of the scatter, but it slows down

Ignore subset of data when filtering

牧云@^-^@ 提交于 2019-12-24 03:51:46
问题 I use dc.js for analyzing results of a classification algorithm and would like to filter on the confidence (additional metrics like precision, recall and f-measure are calculated on the whole filtered dataset). Example: https://jsfiddle.net/bse7rfdy/6/ var conf = dc.barChart('#conf'); conf .dimension(ConfidenceDimension) .group(ConfidenceGroup) .x(d3.scaleLinear().domain([0.0,1.05])) .xAxisLabel("confidence") .xUnits(function(){return 20;}) .yAxisLabel(""); Since the false negatives always

DC.js composite chart not updating when filter is applied

◇◆丶佛笑我妖孽 提交于 2019-12-24 03:29:44
问题 I am working with DC.js and crossfilter. I am trying to use a composite chart to house a bar chart and a line chart. However, when I apply a filter to the data, the bars and line don't update. If I have the charts as standalone bar/line charts, they do update properly. Here are the chart properties Composite Chart var chartScorecardComposite = dc.compositeChart("#regionMarketChart") .width(1002) .height(300) .margins({top: 30, right: 50, bottom: 50, left: 40}) .dimension

d3 onclick to get the specific path/bar reference

对着背影说爱祢 提交于 2019-12-24 02:28:22
问题 if I have a d3/dc chart, and I set a click event handler like so: var data = [{ "city": "New York", "neighborhood": "N/A", "hits": 200 }, { "city": "New York", "neighborhood": "Brooklyn", "hits": 225 }, { "city": "New York", "neighborhood": "Queens", "hits": 1 }, { "city": "San Francisco", "neighborhood": "Chinatown", "hits": 268 }, { "city": "San Francisco", "neighborhood": "Downtown", "hits": 22 }, { "city": "Seattle", "neighborhood": "N/A", "hits": 2 }, { "city": "Seattle", "neighborhood":

dc.js piechart legend - hide if result is 0

家住魔仙堡 提交于 2019-12-24 01:47:33
问题 Is it possible to remove/hide the legends for a piechart if the result is 0? I have a piechart that has quite a few items in the legend, when there has been some filtering it would be great to remove the legends that are not available. Any help would be appreciated. 回答1: Legends do render when their charts are redrawn, but the problem here is that the legend is drawn from the data, and crossfilter doesn't automatically eliminate empty groups. It would be really great if legends were a chart

How can i remove empty bars from dc.js row chart, whenever the dimension is null or empty, there appears an empty bar on row chart

青春壹個敷衍的年華 提交于 2019-12-24 00:53:42
问题 How can i remove empty bars from dc.js row chart, whenever the dimension is null or empty, there appears an empty bar on row chart. 回答1: You have to use fake group const remove_empty_bins = (source_group) => { return { all: () => { return source_group.all().filter(function(d) { // here your condition return d.key !== null && d.key !== '' && d.value !== 0; // etc. }); } }; } let myFilteredGroup = remove_empty_bins(myGroup); 来源: https://stackoverflow.com/questions/44587863/how-can-i-remove

dc js select menu and styling with bootstrap

本秂侑毒 提交于 2019-12-24 00:17:46
问题 I have started with this example from the docs, and attempted to style the selects with bootstrap. In order to get consistent results for testing I have used LCG from answer 8 on this SO Post, to seed the RNG. For styling purposes I have added bootstrap-select.min.css bootstrap-select.min.js Full code available here: http://jsfiddle.net/r7e2cnyx/60/ If I don't attempt to enable the select picker all works as expected: when enabling the styling in document ready like this $( document ).ready