dc.js

dc datatable without grouping the rows

£可爱£侵袭症+ 提交于 2020-01-02 02:43:07
问题 Is it possible to have a dc data table without showing the data in groups? I just want to show all the data across all groups! My code is as follows: dc.dataTable(".dc-data-table") .dimension(dateDimension) .group(function (d) { return '' }) .size(10) // (optional) max number of records to be shown, :default = 25 .columns([ function (d) { return getFormattedDate(d.dd); }, function (d) { return d.referredfor; }, function (d) { return numberFormat(d.cost); }, function (d) { return d.gender; } ]

How to filter views with an opacity range in d3/dc.js?

寵の児 提交于 2020-01-01 19:51:30
问题 I don't know if this is possible in dc.js and crossfilter.js , but I decided to ask anyways. I combined a scatterplot and a barChart example from dc to make an interactive dashboard: var chart1 = dc.scatterPlot("#test1"); var chart2 = dc.scatterPlot("#test2"); d3.csv("output.csv", function(error, data) { data.forEach(function (x) { x.x = +x.x; x.y = +x.y; x.z = +x.z; }); var ndx = crossfilter(data), dim1 = ndx.dimension(function (d) { return [d.x, d.y]; }), dim2 = ndx.dimension(function (d) {

How to filter views with an opacity range in d3/dc.js?

只愿长相守 提交于 2020-01-01 19:50:07
问题 I don't know if this is possible in dc.js and crossfilter.js , but I decided to ask anyways. I combined a scatterplot and a barChart example from dc to make an interactive dashboard: var chart1 = dc.scatterPlot("#test1"); var chart2 = dc.scatterPlot("#test2"); d3.csv("output.csv", function(error, data) { data.forEach(function (x) { x.x = +x.x; x.y = +x.y; x.z = +x.z; }); var ndx = crossfilter(data), dim1 = ndx.dimension(function (d) { return [d.x, d.y]; }), dim2 = ndx.dimension(function (d) {

Losing data when rendering rowchart using dc.js

≯℡__Kan透↙ 提交于 2019-12-31 04:06:05
问题 I lose data when creating a dc.js rowchart. var ndx = crossfilter(data); var emailDimemsion = ndx.dimension(function(d) { return d.email; }); var emailGroup = emailDimemsion.group().reduce( function(p, d) { ++p.count; p.totalWordCount += +d.word_count; p.studentName = d.student_name; return p; }, function(p, d) { --p.count; p.totalWordCount -= +d.word_count; p.studentName = d.student_name; return p; }, function() { return { count: 0, totalWordCount: 0, studentName: "" }; }); leaderRowChart

Dc.js: Scrollable rowChart with no gap?

梦想的初衷 提交于 2019-12-31 03:07:05
问题 It seems like the height and fixedBarHeight cant both be used in a rowChart . Ids like to use fixedBarHeight so all the bars have the size I want, and the chart to be in a scrollable div so that the numbers of bars define the height of the chart. Is this possible? 回答1: @ialarmedalien made this block, which introduces a dc.axisChart to separate the axis of the row chart from the actual chart. Then you can use conventional overflow-y: auto on the row chart div . Here is a related issue on dc.js

Add legend to pie chart in dc.js

房东的猫 提交于 2019-12-30 09:35:17
问题 I'm building a dc.js-based visualization where one of the charts is a pie chart. See: http://jsfiddle.net/luiseth/t8we6/ The peculiarity of my case is that the labels that this chart will display are usually rather long, so much that usually get clipped by the chart's container (the <div> ). So I thought of having them appear on a legend, but I haven't been able to figure how to have the legend appear to the right of the chart. How can I do that? Playing around with the width has not helped

Properly display bin width in barChart using dc.js and crossfilter.js

拥有回忆 提交于 2019-12-30 00:51:07
问题 I'm making a bar chart using the Dimensional Charting javascript library dc.js, which is based on d3 and crossfilter. All I want to do is display a histogram with a specified number of bins, this should be easy using the barChart function. I have an array called data which contains floating-point values between 0 and 90000, and I just want to display the distribution using a histogram with 10 bins. I use the following code to produce the histogram below: var cf = crossfilter(data); var dim =

dc.js and crossfilter second level aggregation to average count per hour

白昼怎懂夜的黑 提交于 2019-12-25 09:28:37
问题 I am trying to slightly extend the problem described in this question: dc.js and crossfilter reduce average counts per day of week I would like to chart average counts per hour of the day. I have followed the solution above, counting the values by day in the custom reduce with the only change being to dimension by hour of day. This seems to work well and can be seen in the following fiddle: http://jsfiddle.net/dolomite/6eeahs6z/73/ The top bar chart shows the average counts by hour, the lower

Disable resize of brush on range chart from focus charts (dc.js, d3.js) - Solved

二次信任 提交于 2019-12-25 09:26:59
问题 Please note - there is a solution for part of this problem by Gordon Woodhull in Disable brush on range chart before selecting a scale from the dropdown/on page load(dc.js,d3.js) In addition,there is a partial solution at the end this question. Furthermore there are two fiddles: 1) https://jsfiddle.net/dani2011/4dsjjdan/1/ 2) https://jsfiddle.net/dani2011/uzg48yk7/1/ (with partial solution) Need to disable resize of the brush on range chart (timeSlider) by dragging the line within the focus

display the number of distinct items with data count widget

醉酒当歌 提交于 2019-12-25 04:12:37
问题 I have a list of items, some of them have several rows for the same item (different variants of the same item). I want to count how many items exists in total, and how many are selected. however, when I'm using the data count widget, it only works with the number of rows by default, but can't figure out how to change that behaviour. var data=[{"item":"Category A","color":"blue"}, {"item":"Category B","color":"blue"}, {"item":"Category A","color":"pink"}]; var ndx = crossfilter(data); var