dc.js

Can you add a legend to a dc.js Bubble Chart?

爷,独闯天下 提交于 2019-12-11 06:02:24
问题 Is it possible to make a legend for Bubble Chart? Somebody asked this question a few years ago, but I cannot find a good answer for it. Does anybody have an example of where they made a legend for a bubble chart using dc.js? 回答1: You can manually add legend support to any chart which does not have it already by defining the .legendables() function. Although many charts (e.g. pie, line, bar, scatter, sunburst) support it, the default is to return an empty array. One reason why it might not be

numberDisplay - filter by max key

…衆ロ難τιáo~ 提交于 2019-12-11 05:59:19
问题 I have a dc.js dashboard that has historical Headcount, Sickness etc information that is grouped by Month / Period. The users of the Dashboards want to see the most recent Month's data in number displays across the top (e.g Headcount, Sickness rate etc). My data: var data= [ { "Month": "01/02/2014","Period": 201402,"Heads": 15123,"SchedHours":146000,"Sickness": 0,}, { "Month": "01/03/2014","Period": 201403,"Heads": 15100,"SchedHours": 146000,"Sickness": 0,}, { "Month": "01/04/2014","Period":

dc.js add multiple filters at once

谁都会走 提交于 2019-12-11 05:53:27
问题 Is it possible to add a set of filters at once on a dc chart? For instance, say I have a pieChart, and an array of filter values to apply. var osChart = dc.pieChart('#oschart'); And an input set of filters, say var filters = ["linux", "mac osx", "windows", "solaris"] How can I apply filters so that only one "filtered" event is generated? I can do something like for (var i=0; i < filters.length; i++) { osChart.filter(filters[i]); } However that would generate 4 filtered event. I am applying

DC.js Choropleth filtering Issue

蓝咒 提交于 2019-12-11 05:48:24
问题 I am trying to filter data on my choropleth chart from a bargraph. Strange thing is that it is not showing correct value on selecting a bar from the accompanying bar chart. Here is the jsfiddle: https://jsfiddle.net/anmolkoul/jk8LammL/ The script code begins from line 4794 If i select WIN004 from the bar chart, it should highlight only five states and the tooltip should reflect the values for the data. Some states are highlighted for whom WIN004 does not exist. I changed the properties of the

Splitting and grouping records into daily sets using d3.js and dc.js

安稳与你 提交于 2019-12-11 05:29:53
问题 I am new to d3.js and dc.js and I have spend the best part of a week reading through the tutorials and API. It has a relatively steep learning curve however I am (slowly) becoming familiar with the individual manipulations. That said I still lack the practical experience to construct what I need. I have a JSON file that contains the following data structure (The record set is relatively large ~2 million objects): [ { "index": "device_1", "state": -1, "frequencies": [ "800PS" ], "events": [ {

Crossfilter and DC.js: reduce to unique number

二次信任 提交于 2019-12-11 05:18:08
问题 In the example below, I am trying to sum by unique occurence of Respond_Id . eg. in this case, it should be in total 3 , "Respond_Id" being 258,261 and 345 . This is my data: {"Respond_Id":258,"Gender":"Female","Age":"18-21","Answer":424}, {"Respond_Id":258,"Gender":"Female","Age":"18-21","Answer":428}, {"Respond_Id":261,"Gender":"Male","Age":"22-26", "Answer":427}, {"Respond_Id":261,"Gender":"Male","Age":"22-26", "Answer":432}, {"Respond_Id":345,"Gender":"Female","Age":"27-30","Answer":424},

dc.js rowChart topN without zeros

大城市里の小女人 提交于 2019-12-11 05:05:33
问题 I need to display the top20 alarms out of a large dataset. The standard dc.js works great and using .rowsCap(20) in a rowChart gives me the top20. I am now trying to remove the zero rows when the data is filtered below 20 entries. Several similar posted questions pointed to the remove_empty_bins() from https://github.com/dc-js/dc.js/wiki/FAQ#filter-the-data-before-its-charted which works correctly if I remove the .rowsCap(20) but fails I combine the two. Using dc.js-2.0.0-beta.1 it fails on

draw extra line in row line with dc.js

淺唱寂寞╮ 提交于 2019-12-11 05:04:04
问题 I try to draw extra line parallel to the Y axis in a row line with dc.js, but I do not know how to set the line_data ,it seemes that it differ with draw extra line in a line chart or bar chart. (http://dc-js.github.io/dc.js/examples/bar-extra-line.html). My code is as follows. var datasetA = [{"Name":"A","Value":"100"}, {"Name":"B","Value":"80"}, {"Name":"C","Value":"60"}, {"Name":"D","Value":"40"}, {"Name":"E","Value":"20"}]; var oeChart = dc.rowChart("#subjectA"); var ndx = crossfilter

How to show values stacked bar chart utilizing dc.js and d3.js?

时光怂恿深爱的人放手 提交于 2019-12-11 04:16:24
问题 Based on this question, I was able to create a bar chart using dc.js and d3.js with labels. However, I turned the bar chart into a stacked bar chart (based on this documentation), and I'm having difficulty showing the labels for each of the stacks. For example each stack in the below chart should show the number, but it's showing [object Object] See below for code and here for codepen Javascript var data = [{Category: "A", ID: "1A"}, {Category: "A", ID: "1A"}, {Category: "A", ID: "1A"},

Geo choropleth map and pie chart crossfiltering using dc.js

允我心安 提交于 2019-12-11 04:14:03
问题 With the code I want to be able to click on any state and the pie chart should depict the number of males and females in that state. gender.csv is of the following pattern gender,age,state Male,9,1 Male,10,1 Male,18,2 Male,20,0 Male,22,1 Male,30,1 Male,40,1 Male,45,2 Male,50,2 Male,55,2 Male,70,0 Male,80,0 Male,90,0 Male,100,0 Male,101,0 Female,11,0 Female,15,0 Female,20,0 us-states.json is of the following pattern {"type":"FeatureCollection","features":[ {"type":"Feature","id":"01",