dc.js

DC.js Composite chart Align points of Line chart in center of bars

眉间皱痕 提交于 2019-12-02 05:31:52
问题 I am trying to create a composite chart and my requirements are to draw a bar chart, a line chart and a dotted line chart. For that I draw a composite chart. Now I am having problem that points of line chart starts from start of bar chart, but I need that to start from center of line. You can see the problem in this JSFiddle. I got some help from Stackoverflow that is: Align points in centre of bars (DC.JS composite chart) Seems like a workaround is to assign ._rangeBandPadding(1) the

Custom legend based on color of bars in a dc.js composite chart

那年仲夏 提交于 2019-12-02 04:24:27
I implemented a composite chart with two bar charts in which one bar chart consists of bars with different colored bars. Now, I want to create a custom legend that represents each color bar (similar to https://dc-js.github.io/dc.js/examples/pie-external-labels.html used for pie chart). Below is the code snippet of what I've done so far: var buttonPress = dc.barChart(composite) .dimension(joyTimeDimension) //.renderlet(colorRenderlet) //.colors('red') .colors(colorbrewer.Set1[5]) .colorDomain([101, 105]) .colorAccessor(function (d) { return d.value; }) .group(btnGroup, "Button Press")

DC.js - deselect feature or filter all but the ones that are clicked

孤者浪人 提交于 2019-12-02 03:33:57
I'm not sure if this is possible and no luck on researching this. I'm working on a dashboard using DC.js charts and crossfilter.js. I'm going to use a Row chart as an example. Instead of clicking on the items to filter, is it possible to do that opposite? For example. When I click on an item from a row chart, instead of filtering on that selected item, it will deselect that item and filter the rest of the other items. And then I will keep clicking on other items to deselect. Pretty much my goal is to implement a feature where a user can hold the 'CTRL key' and 'left click' the items in the Row

How to filter precisely on date?

懵懂的女人 提交于 2019-12-02 02:26:41
I'm using a lineChart to show created date (one field in my data), it works fine and I can select, but I need a more precise filter: only for items created today, this week, last week, this month, last month Is there already an example of how it's done? I'm struggling on how to apply a daterange filter Gordon Since this question comes up now and then and it would be nice to have a decent example, I went back to NorthSide's question from a while back and fixed up the fiddle. dc.js - add drop down to select date range We'll define a second time dimension so that the charts are affected by it. In

create multiple charts from data groups of the same column

我们两清 提交于 2019-12-02 00:45:10
How to make this dashboard from this data time,group_name,value 15/10/2017 15:36:15,group-1,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:15,group-2,1 15/10/2017 15:36:16,group-1,1 15/10/2017 15:36:16,group-3,1 15/10/2017 15:36:16,group-1,1 15/10/2017 15:36:16,group-3,1 15/10/2017 15:36:17,group-3,1 15/10/2017 15:36:17,group-3,1 15/10/2017 15:36:17,group-1,1 15/10/2017 15:36:17,group-2,1 15/10/2017 15:36:18,group-1,1 15/10/2017 15:36:18,group-1,1 15/10/2017 15:36:18,group-2,1 15/10/2017 15:36:18,group-1,1 15/10/2017 15:36:19,group-3,1 15/10/2017 15:36:19,group

Can I filter data based on an intersection (and) in crossfilter/dc.js?

非 Y 不嫁゛ 提交于 2019-12-01 22:25:32
I have the following example on jsfiddle: https://jsfiddle.net/woolycew65/bp5eavxy/ and am curious if I can select pie slices TP-0 and TP-2 to mean find the patients that have both timepoint 0 and timepoint 2, not 0 or 2. A sample of the dataset is shown below: let data = [ {patientId: 101, site: "AAA", timepoints: [0, 2, 4, 6, 8, 12, 18, 24]}, {patientId: 102, site: "AAA", timepoints: [0, 2, 4, 6]}, {patientId: 103, site: "AAA", timepoints: [8, 12, 18, 24]}, {patientId: 104, site: "AAA", timepoints: [0, 4, 8, 18]}, {patientId: 105, site: "AAA", timepoints: [2, 6, 12, 24]}, {patientId: 501,

Dc cross-filter not working

 ̄綄美尐妖づ 提交于 2019-12-01 13:02:06
Building a grails application using dc & cross-filter js libraries here, but facing an extremely weird issue in the visualization somehow. My visualization is of 5 bar charts, which are interconnected to each other using dc and cross-filter js libraries. So, there are simple metrics , calculated metrics (%) and lastly calculated metrics (without %) . For these three types, there are three different types of if-else in each part of code (for 5 bar charts) But, the problem lies in the last if-else , here the cross-filter goes wrong and we get negative values after a couple of selections and all

dataCount graph filtered by a dimension

会有一股神秘感。 提交于 2019-12-01 08:53:42
I have a list of participants to various events as the data source eventid,participant_name 42,xavier 42,gordon 11,john ... by default, dataCount will say they are 3 participants, I need to display the number of events (so 2) I tried creating a dimension var event = ndx.dimension(function(d) { return d.eventid; }) but can't manage to use it in dataCount dc.dataCount(".dc-data-count") //.dimension(ndx) //working, but counts participants .dimension(event) // not working How do I do that? It sounds to me like you are trying to use the data count widget to count group bins rather than rows. The

dc.js sort ordinal line chart by y axis/value

孤人 提交于 2019-12-01 07:18:27
问题 I have a dc.js ordinal chart whose x-axis consists of things like 'Cosmetics' and the y-axis is the number of sales. I want to sort the chart by sales decreasing, however when I use .ordering(function(d){return -d.value.ty}) the path of the line chart is still ordered by the x-axis. var departmentChart = dc.compositeChart('#mystore_department_chart'), ndx = crossfilter(response.data), dimension = ndx.dimension(function(d) {return d.name}), group = dimension.group().reduce(function(p, v) { p

Rowchart select only a single bar in dc.js / crossfilter?

雨燕双飞 提交于 2019-12-01 06:47:12
I have a dc.rowchart that has 5 different "categories". Initially, all are selected. When I click on one, then only that one is highlighted. When I click on a second one... both the first and second one I clicked are highlighted. How can I make it/configure the rowchart such that only a single category is highlighted every time a bar is clicked? dc.filter("category1"); dc.filter("category2"); Both of these in sequence appear to "append" filters than replace. Ethan's answer is almost there. It's likely unintentional, but dc.js doesn't appear to use the return value for addFilterHandler , so you