dc.js

how to roll up dc stacked-bar example into single bar?

寵の児 提交于 2020-02-25 07:14:18
问题 "http://dc-js.github.io/dc.js/examples/stacked-bar.html" I want to roll this kind of dataset into a single bar stacked-bar chart. I changed the speedSumGroup = runDimension.group().reduce(function(p, v) { p[v.Expt] = (p[v.Expt] || 0) + v.Speed; return p; }, function(p, v) { p[v.Expt] = (p[v.Expt] || 0) - v.Speed; return p; }, function() { return {}; }); to speedSumGroup2 = runDimension.groupAll().reduce(function(p, v) { and inspecting the group shows the data rolled up to the single expected.

Different colours for dc.js barchart

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-25 05:48:26
问题 I am trying to create a barchart (not rowchart) using d3.js and dc.js. I can create the bars ok, but they are all the same colour. I have tried : ordinalColors() scaleOrdinal.range() Renderlet colorAccessor but they all give the one colour for all bars, except colorAccessor which displays no bars at all. I am using dc.js (version 3.0.2) and d3.js (version 5.4.0) and crossfilter (version 1.3.5). Could someone please tell me an approach that will work to get different colours on each of my bars

dc.js: Adding a Legend to Pie Chart

让人想犯罪 __ 提交于 2020-02-23 04:06:46
问题 I'm trying to add a legend to my pie chart but I keep getting the error TypeError: dc.legend is not a function . I'm not sure where to begin on fixing this. I've tried the solution here and here, but no luck. Any help would be greatly appreciated! var geoValue = facts.dimension(function (d) { return d.geo; }); var geoGroup = geoValue.group(); geoChart .width(480) .radius(100) .innerRadius(90) .dimension(geoValue) .group(geoGroup) .transitionDuration(500) .legend(dc.legend().x(250).y(100)) /

dc.js: Adding a Legend to Pie Chart

我的未来我决定 提交于 2020-02-23 04:05:00
问题 I'm trying to add a legend to my pie chart but I keep getting the error TypeError: dc.legend is not a function . I'm not sure where to begin on fixing this. I've tried the solution here and here, but no luck. Any help would be greatly appreciated! var geoValue = facts.dimension(function (d) { return d.geo; }); var geoGroup = geoValue.group(); geoChart .width(480) .radius(100) .innerRadius(90) .dimension(geoValue) .group(geoGroup) .transitionDuration(500) .legend(dc.legend().x(250).y(100)) /

How to remove empty rows in tables when they are zero, and how to allow selection in only one table at a time?

≯℡__Kan透↙ 提交于 2020-02-05 14:56:31
问题 I created two tables that relate. When I select one or more items from Table A, Table B is resized according to that selection and vice versa. However, I need to lock the selection of the two tables at the same time. For example, if I click on the sellers Miguel and Sede , in Table B the values and cities corresponding to these two sellers will be rendered. And if in Table B I click on the cities of Faro and Loulé , automatically the sellers Miguel and Sede should be deselected. What happens

How to remove empty rows in tables when they are zero, and how to allow selection in only one table at a time?

笑着哭i 提交于 2020-02-05 14:55:16
问题 I created two tables that relate. When I select one or more items from Table A, Table B is resized according to that selection and vice versa. However, I need to lock the selection of the two tables at the same time. For example, if I click on the sellers Miguel and Sede , in Table B the values and cities corresponding to these two sellers will be rendered. And if in Table B I click on the cities of Faro and Loulé , automatically the sellers Miguel and Sede should be deselected. What happens

Simple way to add raw data to dc.js composite chart via Ajax

浪子不回头ぞ 提交于 2020-02-05 07:11:05
问题 I have a composite chart of 2 line charts however I need to add a third chart to it. This third chart will have these unique properties: The data will come in via an ajax call and be available as a two dimensional array [[timestamp,value],[timestamp,value]...] Every new ajax call needs to replace the values of the previous one It does not need to respect any of the filters and will not be used on any other charts It will however need to use a differently scaled Y axis.. (and labeled so on the

Simple way to add raw data to dc.js composite chart via Ajax

别说谁变了你拦得住时间么 提交于 2020-02-05 07:10:17
问题 I have a composite chart of 2 line charts however I need to add a third chart to it. This third chart will have these unique properties: The data will come in via an ajax call and be available as a two dimensional array [[timestamp,value],[timestamp,value]...] Every new ajax call needs to replace the values of the previous one It does not need to respect any of the filters and will not be used on any other charts It will however need to use a differently scaled Y axis.. (and labeled so on the

How to create graph with two tables being all dynamic?

十年热恋 提交于 2020-02-05 02:11:10
问题 I need to complete a sales history test that the company where I work passed me. Where they already get sales data through power bi, and I need to do the same thing but in D3. Here is the image of the graph and tables at the moment: This image shows a graph and two tables, all three of which are directly related. In the graph, the sales value is rendered according to the item (line) that is selected in the table. The default Initial value is the Total line. I'll explain one by one, so I can

dc.js Box plot reducer using two groups

谁说我不能喝 提交于 2020-02-04 20:56:13
问题 I'm trying to produce a box plot which will show the total number of networks single devices have connected to grouped by their vendor. Data Format: { "SSID": "eduroam", "identifier": "Client", "latitude": 52.4505, "longitude": -1.9361, "mac": "dc:d9:16:##:##:##", "packet": "PR-REQ", "timestamp": "2018-07-10 12:25:26", "vendor": "Huawei Technologies Co.Ltd" } Fiddle with data https://jsfiddle.net/v4a8g2bo/ I have managed to get a sum of the networks a single device has connected to using the