dc.js

Brush filter behaves irrationally on stacked bar chart

痴心易碎 提交于 2019-12-11 20:38:25
问题 I'm seeing a weird filtering issue in using dc.js to draw stacked bar charts. Selecting a filtering area by brushing the chart sometimes starts the selection outside of the axis (figure b), or only lets me select the brush on steps that are integers (i.e. in figure a&b I can only select for example range 2.0-3.0 and or 2.0-4.0 etc). On sub-integer x-axis scales no brushing selection is seen. Basically scope.datasetNames = ['DATASET1','DATASET2', 'DATASET3]; For figure b the reducing functions

Enable default selection in bar-chart of dc

…衆ロ難τιáo~ 提交于 2019-12-11 19:52:50
问题 So, I have two bar charts plotted using cross-filter and dc. This is how my code looks like: var barChart2 = dc.barChart("#dc-mv-chart"); var depValue = facts.dimension(function(d) {return d.d;}); var depValueGroupSum = depValue.group().reduceSum(function(d) {return +d.g;}); var mvValue = facts.dimension(function(d,i) {return d.b;}); var mvValueGroupSum = mvValue.group().reduceSum(function(d) {return +d.g;}); barChart1.width(1200) .height(200) .margins({top: 10, right: 10, bottom: 20, left:

Performance issue using dc.js

一笑奈何 提交于 2019-12-11 17:53:47
问题 I'm trying to make a simple dashboard using dc.js and bootstrap. The charts I'm showing are a simple series chart with three different series taken from a csv with approximately 9000 lines, a pie chart to select from those series and a bar chart to act as a date range selector. It all works correctly but the performance is horrible. I assume it must be due to my lack of experience with crossfilter, as the example (http://nickqizhu.github.io/dc.js/) uses 6000 records and performs really fast.

dc js - Create Multiple Column Dimension

喜你入骨 提交于 2019-12-11 13:53:31
问题 I'm trying to summarize the data table using dc.js and I'm using dynaTable plugin for for pagination and other options. Normally in the dc.js data table we get the entire data displayed in the data. But I'm trying to summarize the data like a pivot table and display it on the web and when the selection happens the data table needs to change. I've done it by creating a dimension and group and i passed that group to dynaTable . And it's working fine. Suppose I have 5 columns of data. I can

Creating stacked charts in dc js with panel dataset

≯℡__Kan透↙ 提交于 2019-12-11 13:17:57
问题 I'm having trouble creating a stacked barchart, I cannot figure out how to properly apply the dimensions to a panel dataset My data looks like this: Date name value 12/1/15 name1 5 12/1/15 name2 6 12/1/15 name3 2 13/1/15 name1 2 13/1/15 name2 7 13/1/15 name3 8 14/1/15 name1 2 14/1/15 name2 5 14/1/15 name3 10 Stored in JSON format I would like to create stacked charts that plot the values associated with the different names over time. As I understand dc-js I need to provide a chart with the

Hide Specified Row in dc.js rowchart

大兔子大兔子 提交于 2019-12-11 13:15:01
问题 Does anyone know a good hack to hide a row from a row chart in crossfilter/dc.js, that is do not chart a particular key. I want to show some relevantly small %s and hide the 99% which fits in the other category (and prevent a user from filtering on the row). This doesn't work...as it filters the data function remove_bins(source_group) { return { all:function () { return source_group.all().filter(function(d) { return d.key = 1; }); } } }; var filtered_group = remove_bins(myGroup); Where I just

dc.js x-axis will not display ticks as months, shows decimals instead

吃可爱长大的小学妹 提交于 2019-12-11 12:32:03
问题 I'm building a bar chart using dc.js, and want the x-axis to list the 12 months of the year. So far, I have it rendering showing the first tick as a time of day (06 PM), and all subsequent ticks as decimals (thousandths). I saw a similar question (https://stackoverflow.com/questions/21392997/dc-js-x-axis-hour-labels-appear-as-thousandths#=), but the answer involved converting milliseconds to larger units, which isn't possible with months (that I know of). Here is my code. Thanks in advance

Reference errors using dc.js, d3.js and crossfilter

有些话、适合烂在心里 提交于 2019-12-11 11:41:55
问题 I'm attempting to generate a test dc.js graph but I can't get rid of reference errors, no matter what I do and how I change my source files. Specifically, I'm trying to replicate the example from this tutorial which should result in this graph. However, when I do the exact same code, I get two reference errors; ReferenceError: d3 is not defined, and ReferenceError: dc is not defined. Here's my html page: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <script type="text

Pie chart legend in dc.js 1.7 not showing up

孤者浪人 提交于 2019-12-11 11:15:16
问题 I'm trying to create a pie chart legend in dc.js. However, there is no legend. It just... doesn't show up. Everything appears the same as before I used the legend command. Here is the JSBin Here is the legend code: .legend(dc.legend().x(80).y(70).itemHeight(13).gap(5)); Here is the rest of the relevant code: var companyDimension = data.dimension(function(d) {return d.company;}); var totalSalesByCompany = companyDimension.group().reduceSum(function(d) {return d.total;}); var

Hide group rows of dc.dataTable

假装没事ソ 提交于 2019-12-11 11:09:59
问题 I am using the JavaScript library dc.js to dynamically generate a table of records using the dc.dataTable() . The data is rather simple, so I actually want to show it as a plain list of rows without any grouping. However, dc.dataTable() requires a .group() attribute. Each such group is then shown with an extra row in the resulting table before its data rows. var datatable = dc.dataTable("#category-table"); datatable .dimension(categoryDim) .group(function(d) {return "Categories";}) //just 1