dc.js

responsive dc.js chart is taking over the whole window

喜你入骨 提交于 2021-02-08 06:11:29
问题 I'm having trouble making my chart responsive, I'm trying to apply the same example with DC.js and Crossfilter that is at this link: resizing-series. The chart is responsive, however, there are some bugs when interacting with the tables I have. For example, when I click on either the graph or any of the tables, the graph becomes very large, occupying the entire screen. As shown in the image below: When I leave the screen split with Console , the graph is rendered responsively, as I change the

click in datatable to filter other charts (dc.js)

喜夏-厌秋 提交于 2021-02-07 19:49:51
问题 I need to filter other charts when I click a row in the datatable. I did my_table.on('pretransition', function (table) { table.selectAll('td.dc-table-column') .on('click',function(d){ table.filter(d.key) dc.redrawAll(); }) }); but nothing happens in the other charts. Can you help me, please? 回答1: If the table dimension is a dimension... The data that ordinarily populates a data table is the raw rows from the original data set, not key/value pairs. So it is likely that d.key is undefined. I'd

click in datatable to filter other charts (dc.js)

别说谁变了你拦得住时间么 提交于 2021-02-07 19:49:48
问题 I need to filter other charts when I click a row in the datatable. I did my_table.on('pretransition', function (table) { table.selectAll('td.dc-table-column') .on('click',function(d){ table.filter(d.key) dc.redrawAll(); }) }); but nothing happens in the other charts. Can you help me, please? 回答1: If the table dimension is a dimension... The data that ordinarily populates a data table is the raw rows from the original data set, not key/value pairs. So it is likely that d.key is undefined. I'd

Display original (conditional) brushed unbrushed crossfilter bars with dc.js with different colors

梦想的初衷 提交于 2021-02-07 09:34:24
问题 Say we have the following crossfilter / dc.js app: While this is nice, the user loses "reference" the population when brushing. I would like for charts x , y , z , and a to keep the "underlying" bars when other charts are brushed. Perhaps in a different color like so: I believe this may require updating the dc.renderAll() function, but I am not sure even how to start. Here is all the code to reproduce this app with the .csv data hosted as a gist. <!DOCTYPE html> <html lang="en"> <head> <title

dc.js lineChart - fill missing dates and show zero where no data

最后都变了- 提交于 2021-02-04 08:07:43
问题 I have a dc.js lineChart that is showing the number of events per hour. I would like rather than joining the line between two known values the value should be shown as zero. So for the data below I would like to have the line drop to zero for 10AM {datetime: "2018-05-01 09:10:00", event: 1} {datetime: "2018-05-01 11:30:00", event: 1} {datetime: "2018-05-01 11:45:00", event: 1} {datetime: "2018-05-01 12:15:00", event: 1} var eventsByDay = facts.dimension(function(d) { return d3.time.hour(d

dc.js heatmap colour range not getting updated after filter applied

牧云@^-^@ 提交于 2021-01-28 14:20:17
问题 I'm using dc.js to create a dashboard, the dataset contains 3 types of reading from 1 year in a 24 hour basis. (in the example fiddle, i only use 15 days just for demonstration purpose) Here is the link to a JSFiddle to better illustrate my problem http://jsfiddle.net/table315/hLzLzhss/ I've used a row chart to show the total of each reading, and a heatmap to show the total reading of each day at each time. When 1 type of reading from the row chart has selected, the heatmap doesn't seems to

dc.js heatmap colour range not getting updated after filter applied

十年热恋 提交于 2021-01-28 14:20:17
问题 I'm using dc.js to create a dashboard, the dataset contains 3 types of reading from 1 year in a 24 hour basis. (in the example fiddle, i only use 15 days just for demonstration purpose) Here is the link to a JSFiddle to better illustrate my problem http://jsfiddle.net/table315/hLzLzhss/ I've used a row chart to show the total of each reading, and a heatmap to show the total reading of each day at each time. When 1 type of reading from the row chart has selected, the heatmap doesn't seems to

How to add row in datatable - DC.js

那年仲夏 提交于 2021-01-28 11:33:56
问题 I have a json file that loads sales data for salespeople based on the current year and the previous year. I created a table in which I show the total sales for each year for each salesperson and, in the last row, I need to load the total for all salespeople added up. As shown in the image below: I am using dc.dataTable to create my table. Can you tell me if there is any way in DC.js to create a row in my table to put the total sales? Here is my code, thank you in advance. var vendedorTable =

Unable to reset the focus ordinal bar chart

送分小仙女□ 提交于 2021-01-28 08:32:12
问题 I am trying to reset after choosing some of the individual's bar. index.html: (line no. 62) <span> <a href="javascript:focus.filterAll(); dc.redrawAll();" class="reset">reset</a> </span> This seems not to work. I was able to reset all the graphs pie chart, line chart, etc but not this one. Those two ordinal graphs are created in index.js like this: var focus = new dc.barChart('#focus'); var range = new dc.barChart('#range'); https://blockbuilder.org/ninjakx/483fd69328694c6b6125bb43b9f7f8a7

Uniformly-spaced histogram bins with dc.js?

不问归期 提交于 2021-01-27 06:38:25
问题 Mike Bostock uses the following snippet to generate uniformly-spaced bins for a histogram: var data = d3.layout.histogram() .bins(x.ticks(20)) (values); source Is there any way to adapt this to a project that uses dc.js and crossfilter.js? Essentially, I want to dynamically generate the bins and then use the chart to filter on a particular attribute. Total newbie to this. Any guidance would be appreciated! 回答1: dc.js supports histograms via crossfilter. Use a group for your bar chart that