dc.js

how to filter data in dcjs/crossfilter on selection of datatable row?

泪湿孤枕 提交于 2019-12-08 10:42:12
问题 I have seen most of the examples of dc.js which filters the data using brushes. How should i filter the data using the row element selected from datatable?? I am not sure of exact solution but some workaround may be done as dimension.filter(value) where value updated onclick? Am I going in right direction or is there a better way? Edit 1 If i draw a row chart of the same thing with the then I don't have to handle onlcick event or anything but for datatable why is it comparatively so much

dc.js rowChart - make entire row clickable?

守給你的承諾、 提交于 2019-12-08 10:40:14
问题 I've got a dc.js rowChart (using the current stable release). It's beautiful. I need it to be more touch-friendly though. In particular, rows with small values have very tiny bars and are very hard to tap. What I'd like to do it make it such that the user can click anywhere on a row to select/deselect that row rather than having to click directly on the bar. Is this possible? 回答1: As a very hacky solution, I was able to add a bunch of non-breaking spaces after the label and get this effect:

Year over Year Stats from a Crossfilter Dataset

五迷三道 提交于 2019-12-08 06:24:12
问题 Summary I want to pull out Year over Year stats in a Crossfilter-DC driven dashboard Year over Year (YoY) Definition 2017 YoY is the total units in 2017 divided by the total units in 2016. Details I'm using DC.js (and therefore D3.js & Crossfilter ) to create an interactive Dashboard that can also be used to change the data it's rendering. I have data, that though wider (has ~6 other attributes in addition to date and quantity: size, color, etc...sales data), boils down to objects like: [ {

dc.js calculate averages with multi column rowchart

三世轮回 提交于 2019-12-08 05:53:58
问题 I am using working with the code from How to create a row chart from multiple columns. However I need to get the averages of the data. I normally do this via value accessor but am unsure of how to do this with this functionality. function regroup(dim, cols) { var _groupAll = dim.groupAll().reduce( function(p, v) { // add cols.forEach(function(c) { p[c] += v[c]; }); return p; }, function(p, v) { // remove cols.forEach(function(c) { p[c] -= v[c]; }); return p; }, function() { // init var p = {}

dc.js - rangeChart bars disappearing when filtered out

三世轮回 提交于 2019-12-08 05:38:00
问题 I'm new to dc.js and trying to implement a something like the "Monthly Index Abs Move" graph in the demo at https://dc-js.github.io/dc.js/ (see document source at https://dc-js.github.io/dc.js/docs/stock.html). ie. I'm trying to implement a line chart for "zoom in" view with a bar chart for the "zoomed out" view (rangeChart). My problem is that when I filter a date range (eg. by using the "brushOn" the bar chart) then the bars that are filtered out disappear The demo has this working

.on function for dc.js charts showing error

守給你的承諾、 提交于 2019-12-08 04:50:44
问题 I am stuck at a point dcCharts = d3.selectAll("div.mychart") .attr("class", "yourchart") .each(function (d, i) { return d ; }); I retrieve the divs and do this: ` _.each(dcCharts, function (dcChart) { dcChart.on("filtered", function (chart, filter) { map.eachLayer(function (layer) { map.removeLayer(layer) }); drawMap(); }); dc.renderAll(); }); I am getting this error: Uncaught TypeError: dcChart.on is not a function at updateFile:229 at Function.m.each.m.forEach (underscore-min.js:5) at

dc.js dataTable Conditional formatting using jquery dataTable

巧了我就是萌 提交于 2019-12-08 03:58:19
问题 I have a dashboard which is built using dc.js and i'm using the chart types dc.rowChart and dc.dataTables. Working Scenario with without conditional formatting: dc.rowChart - displays Top 50 Customers dc.dataTable - displays all the fields required and filters the data based on the rowChart. Working Scenario with conditional Formatting (on datatable rows) In my HTML, i'm calling the jquery plugin for DataTable (for conditioanl formatting) and here is the code below: <script> $(document).ready

How to create interaction with selectMenu in dc.js

心已入冬 提交于 2019-12-08 03:12:22
问题 I'm trying to create a dashboard with a date chooser. I did it for other figures, but it doesn't work here. I'm quite new with dc and I can't figure out if it's a problem of the group or a problem of the date format (or something else). Here is my code : d3.csv("data/saccr_realloc_test.csv", function (error, saccr) { var parser = d3.time.format("%d.%m.%Y"); //var formatter=d3.time.format("%d.%m.%Y"); saccr.forEach(function(d) { d.date = parser.parse(d.date); d.ead = +d.ead; }); var cptyChart

Add “Zoomability” function to a d3.js map processing data from dc.js/crossfilter

a 夏天 提交于 2019-12-08 02:22:06
问题 I'm working with this map. Here is the file used to render it. I want add the click-to-zoom via transform functionality demonstrated in that mbostock example. In the map I'm using, this is the code that draws the map: //This is the data for the Map d3.json("data/europe5.json", function (error, eu) { console.log('map', eu) usChart.width(590) .height(500) .dimension(countries) .group(countriesJobsdSum) .projection(d3.geo.mercator() .scale((1200 + 1) / 2 ) .translate([660 / 4, 3360 / 4])

dc.js - dynamically change valueAccessor of a stacked layer in a lineChart and redraw it

▼魔方 西西 提交于 2019-12-08 00:46:27
问题 I am trying to realize a dashboard to display basic data. I am actually completely stuck on an issue. Strangely enough, I couldn't find anything even similar to it online, so I don't have many leads on how to move forward. I have mainly two charts: a lineChart called "stackChart" that displays consumption as a base layer with its valueAccessor function dispalys production as a stacked layer with its value Accessor function a barChart called "volumeChart" that is simply the rangeChart for the