dc.js

crossfilter “double grouping” where key is the value of another reduction

折月煮酒 提交于 2020-01-05 06:42:10
问题 Here is my data about mac address. It is recorded per minute. For each minute, I have many unique Mac addresses. mac_add,created_time 18:59:36:12:23:33,2016-12-07 00:00:00.000 1c:e1:92:34:d7:46,2016-12-07 00:00:00.000 2c:f0:ee:86:bd:51,2016-12-07 00:00:00.000 5c:cf:7f:d3:2e:ce,2016-12-07 00:00:00.000 ... 18:59:36:12:23:33,2016-12-07 00:01:00.000 1c:cd:e5:1e:99:78,2016-12-07 00:01:00.000 1c:e1:92:34:d7:46,2016-12-07 00:01:00.000 5c:cf:7f:22:01:df,2016-12-07 00:01:00.000 5c:cf:7f:d3:2e:ce,2016

Customize dc.js date x-axis

不问归期 提交于 2020-01-05 04:05:35
问题 Using bar chart: actionsChart /* dc.barChart('#volume-month-chart', 'chartGroup') */ .width(actionsWidth) .height(240) .margins({top: 10, right: 50, bottom: 30, left: 40}) .dimension(dateDimension) //... .elasticX(true) .elasticY(true) .gap(1) .alwaysUseRounding(true) .x(d3.time.scale().domain( [ minDate, maxDate ] ) ) .round(d3.time.day.round) .xUnits(d3.time.days) .renderHorizontalGridLines(true) //.xAxisLabel( 'Dan') //.xAxisPadding(2) .xAxisLabel( "Datum") //.yAxisLabel( "Akcije" ) // OK,

Customize dc.js date x-axis

半世苍凉 提交于 2020-01-05 04:05:24
问题 Using bar chart: actionsChart /* dc.barChart('#volume-month-chart', 'chartGroup') */ .width(actionsWidth) .height(240) .margins({top: 10, right: 50, bottom: 30, left: 40}) .dimension(dateDimension) //... .elasticX(true) .elasticY(true) .gap(1) .alwaysUseRounding(true) .x(d3.time.scale().domain( [ minDate, maxDate ] ) ) .round(d3.time.day.round) .xUnits(d3.time.days) .renderHorizontalGridLines(true) //.xAxisLabel( 'Dan') //.xAxisPadding(2) .xAxisLabel( "Datum") //.yAxisLabel( "Akcije" ) // OK,

show additional data properties on mouseover in dc.js

不想你离开。 提交于 2020-01-04 05:10:48
问题 I would like to display additional data labels and values (other than x-axis and y-axis) on mouseover in dc.js. Below are data and the charting code. var people = [ { "id": 1, "name": "Damaris", "gender": "Female", "DOB": "1973-02-18", "MaritalStatus": "false", "CreditCardType": "visa-electron" }, { "id": 2, "name": "Barbe", "gender": "Female", "DOB": "1969-04-10", "MaritalStatus": "true", "CreditCardType": "americanexpress" }, { "id": 3, "name": "Belia", "gender": "Female", "DOB": "1960-04

show additional data properties on mouseover in dc.js

帅比萌擦擦* 提交于 2020-01-04 05:10:09
问题 I would like to display additional data labels and values (other than x-axis and y-axis) on mouseover in dc.js. Below are data and the charting code. var people = [ { "id": 1, "name": "Damaris", "gender": "Female", "DOB": "1973-02-18", "MaritalStatus": "false", "CreditCardType": "visa-electron" }, { "id": 2, "name": "Barbe", "gender": "Female", "DOB": "1969-04-10", "MaritalStatus": "true", "CreditCardType": "americanexpress" }, { "id": 3, "name": "Belia", "gender": "Female", "DOB": "1960-04

Is there a way to attach callback what fires whenever a crossfilter dimension filter changes?

故事扮演 提交于 2020-01-03 15:29:26
问题 I have several charts built with dc.js. I can achieve the desired functionality by attaching a callback to each dc.js chart's .on("filterted", function(chart) {}) but this is annoying because I have to attach the same callback to each chart. And error prone because as new charts are added, someone has to remember to attach an event hander. I would prefer to just attach a callback to the underlying crossfilter. Is that possible? Is there a way to optimize this... var ndx = crossfilter(data);

How to generate svg client-side with d3 without attaching it to the DOM (using with React.js)

狂风中的少年 提交于 2020-01-03 08:38:19
问题 I'm using React.js to build an app, which includes quite a few svg charts. I'm using d3 functions that help in chart creation, such as scales, but then using React to generate the svg elements. Here's a great writeup on the approach: http://10consulting.com/2014/02/19/d3-plus-reactjs-for-charting/ Part of why I'm going down this road was for performance - the first version of the app was too slow. It has a lot of elements and a lot of user-interactivity, all client-side. I'm trying to

How to generate svg client-side with d3 without attaching it to the DOM (using with React.js)

这一生的挚爱 提交于 2020-01-03 08:38:08
问题 I'm using React.js to build an app, which includes quite a few svg charts. I'm using d3 functions that help in chart creation, such as scales, but then using React to generate the svg elements. Here's a great writeup on the approach: http://10consulting.com/2014/02/19/d3-plus-reactjs-for-charting/ Part of why I'm going down this road was for performance - the first version of the app was too slow. It has a lot of elements and a lot of user-interactivity, all client-side. I'm trying to

Exporting dc.js chart from SVG to PNG

99封情书 提交于 2020-01-03 03:32:12
问题 I have a dc.js chart and I want to export it as a PNG image, using exupero's saveSvgAsPng: function save() { var options = {}; options.backgroundColor = '#ffffff'; options.selectorRemap = function(s) { return s.replace(/\.dc-chart/g, ''); }; var chart = document.getElementById('chart').getElementsByTagName('svg')[0]; saveSvgAsPng(chart, 'chart.png', options) } var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7,

Apply Filter from one Crossfilter dataset to another Crossfilter

余生颓废 提交于 2020-01-02 06:48:28
问题 I have two datasets that have similar columns/dimensions but are grouped differently by row and contain different measures. Ex: Dataset 1 Year Category SubCategory Value01 Value02 2000 Cars Sport 10 11 2000 Cars Family 15 16 2000 Boats Sport 20 21 2000 Boats Family 25 26 ... Dataset 2 Year Category ValueA ValueB 2000 Cars 100 101 2000 Boats 200 201 ... Dataset 1 has its own crossfilter object, Dataset 2 has a separate crossfilter object. I have multiple dc.js charts, some tied to the dataset