dc.js

Dual Y axis line chart in dc.js

本秂侑毒 提交于 2019-11-28 08:59:47
问题 I have a composite chart of three line charts. One of the charts is using a "fake" group as suggested here. As you can see in the snapshot below though the scale of the 3rd chart is very different from the other two. The solution I would like is to have a dual axis chart as shown here in pure d3. I think it can be done using a .renderlet() on the main composite chart but I was wondering if there was a "sexier" solution with pure dc.js? Here is a snapshot: and here is my code. (in coffeescript

Crossfilter reduce :: find number of uniques

微笑、不失礼 提交于 2019-11-28 07:51:25
I am trying to create a custom reduce function for a dataset attribute group that would sum a number of unique values for another attribute. For example, my dataset looks like a list of actions on projects by team members: { project:"Website Hosting", teamMember:"Sam", action:"email" }, { project:"Website Hosting", teamMember:"Sam", action:"phoneCall" }, { project:"Budjet", teamMember:"Joe", action:"email" }, { project:"Website Design", teamMember:"Joe", action:"design" }, { project:"Budget", teamMember:"Sam", action:"email" } So, team members work on a variable number of projects by

Color code a data table in dc.js

£可爱£侵袭症+ 提交于 2019-11-28 06:04:28
问题 I have a vary basic question and very little understanding of dc.js. I am trying to create a score card using the data that i have and display it as a data table using dc.js.I am processing the data through crossfilter. How can i color code the entries in the data table . Say my table will have values from -1 to 1 and i want to color the cells as follows: -1 to 0 : decreasing gradient of red 0 : white 0 to 1 : increasing gradient of green I know i am not able to provide any code but thats

dc.js compatibility with v4 of d3.js

我怕爱的太早我们不能终老 提交于 2019-11-28 05:50:16
问题 Version 4.x of d3.js , which is not backward compatible, came out end of June16. The bower.json for dc.js includes: "dependencies": { "d3": "3.x", "crossfilter2": "~1.3" } which explicitly requires v3 (not higher) of d3.js . Is dc.js currently compatibility with version 4.x of d3.js ? If not, is this planned? 回答1: It's definitely not compatible. d3 v4 has breaking api changes. As far as plans go, there's a lively discussion about this on dc.js' github acount: So what is the plan then? Use

storing dc.js filters in URI and restoring them

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 22:38:26
Here i selected 3 filters 1 from each chart and pasted that encoded url in url param. but when i press decode url button it is redrawing only middle chart filters but not the remaining once.. what should i do? thanks function encodeFunction() { var filters = []; for (var i = 0; i < dc.chartRegistry.list().length; i++) { var chart = dc.chartRegistry.list()[i]; for (var j = 0; j < chart.filters().length; j++) { filters.push({ChartID: chart.chartID(), Filter: chart.filters()[j]}); } } var urlParam = encodeURIComponent(JSON.stringify(filters)); alert(urlParam); } function decodeFunction() { /

Export Data from dc.js dataTable into CSV

≯℡__Kan透↙ 提交于 2019-11-27 19:24:26
问题 I have a data table done by dc.js and crossfilter.js, and i want to export that table to CSV file.. dataTable.width(960).height(800) .dimension(by_id) .group(function(d) { return "" }) .size(data.length) .columns([ function(d) { return d.id; }, function(d) { return d.name; }, function(d) { return d.gender; }, function(d) { return parseFloat(d.GPA).toFixed(2); }, function(d) { return parseFloat(d.Major_GPA).toFixed(2); }, function(d) { return parseFloat(d.Math_GPA).toFixed(2); }, function(d) {

Show values on top of bars in a barChart

霸气de小男生 提交于 2019-11-27 15:12:23
I have a bar chart with ordinal scale for the x-axis. I want to display the y-values on the top of each bar or in the bottom of each bar. It would be also acceptable to display the y-values when one hovers over the bar. Is there a function or a way in a dc.js to do that? Here is the jsfiddle and my code is below the pic> Edit: Here is my code: HTML <body> <div id='Chart'> </div> </body> JS var data = [{ Category: "A", ID: "1" }, { Category: "A", ID: "1" }, { Category: "A", ID: "1" }, { Category: "A", ID: "2" }, { Category: "A", ID: "2" }, { Category: "B", ID: "1" }, { Category: "B", ID: "1" },

dc.js - Stacked bar chart with empty bin filter displaying in strange way

女生的网名这么多〃 提交于 2019-11-27 08:58:14
问题 I'm trying to have a stacked bar chart and remove empty bins, the bar chart doesn't seem to display properly. It's adding whitespace within the bars themselves. The filtering is working fine. Probably best explained by having a look at this fiddle - http://jsfiddle.net/northside45/xdcvr2kf/ My filters look like this var personDim = ndx.dimension(function (d) {return d.person;}); var personDimGroup = personDim.group().reduceSum(function (d) { return d.amount; }); var personDimGroup2 =

How to color code rows in a table dc.datatable?

梦想与她 提交于 2019-11-27 07:04:50
问题 On the DC.js github, Stock Market Selection Strategy by Lon Riesberg is listed as an example of using the dc.js library. He was able to color code the rows, as shown in the image below, which I'm trying to mimic. See here for my code: http://codepen.io/chriscruz/pen/myaWvR?editors=101 In particular, how would I change the color of the rows so that all rows with the name 'Red' are red, with the name 'Blue' are Blue, and the name 'White' are white. Javascript: items = [ {Id: "01", Name: "Red",

dc.js - data table using jquery data-table plugin

爷,独闯天下 提交于 2019-11-27 03:28:07
问题 I'm using dc.js to create charts and data table. I wanted to add some pagination styles and search option in the table. jQuery Data table script : $(document).ready(function() { $('#data-table').DataTable(); }) problem is - i get all the jquery data table options displayed like search box, number of entries. But none of them work. Some one please help. Found this post. But nothing useful. 回答1: I like to use DynaTable for this - http://www.dynatable.com/ 1) Define your table html: <table id=