dc.js

dc.js - multiple lineChart based on separate categories in single csv file

99封情书 提交于 2019-12-25 04:07:11
问题 For example if I have the following csv file: category, number, total A,1,3 A,2,5 A,3,1 B,1,4 B,2,6 B,3,1 C,1,5 C,2,2 C,3,4 I was able to follow the following example and separate out the data into different csv files and composing each one. github link However, I was wondering how would I recreate the same lineCharts if I were to only have a single csv file and separate each lineChart by each grouped category. Thanks. 回答1: @minikomi's answer is the straight d3 way to do this. The dc.js

dc.js d3+crossfilter.top to export filtered data to CSV

徘徊边缘 提交于 2019-12-25 03:35:08
问题 I have looked extensively at code samples and have been able to call crossfilter's .top(Infinity) function to output the updated data records after filtration. I am even able to call d3.csv.format with .top(n) in order to get a string'ified CSV output that can be downloaded. But I have a couple issues. I am calling the top and csv.format functions in my chart draw method as explained here: d3.csv("/data/acuityData.csv", function (data) { // format our data var dtgFormat = d3.time.format("%Y-

Render Graph Issue

喜你入骨 提交于 2019-12-24 16:06:06
问题 var data = [{"id":"1000","usage":"9219","date":"2012-06-01","country":"US"}, {"id":"1001","usage":"13399","date":"2012-06-01","country":"US"}, {"id":"1002","usage":"13181","date":"2012-06-02","country":"CA"}, {"id":"1003","usage":"13494","date":"2012-06-02","country":"US"}, {"id":"1004","usage":"6252","date":"2012-06-03","country":"US"}, {"id":"1005","usage":"9351","date":"2012-06-03","country":"JP"}, {"id":"1006","usage":"13753","date":"2012-06-04","country":"CN"}, {"id":"1007","usage":"5410

How to handle mouseout event on DC range graph

心已入冬 提交于 2019-12-24 14:34:48
问题 I am using DC chart range filter. I want to handle mouse out event on range filter, so I can handle filter on mouse-out. I had used filter and post-redraw but when I use this there are multiple time event fire on single drag on range chart. I need only the last change event and I think a mouse out or mouse up event would be helpful. Can any one help me with how to use mouse up/mouse out event on range Chart? 回答1: chart.on('postRender', function() { chart.select('.brush').on("mouseover",

d3js (+crossfilter/dc) boxplot performance

∥☆過路亽.° 提交于 2019-12-24 12:41:13
问题 I'm trying to use a combination of D3, Crossfilter, and DC generate interactive boxplots, mainly using this example: https://github.com/dc-js/dc.js/blob/master/web/examples/box-plot.html My data looks more like this: id date met1 6368 10/24/2013 0.84 6369 10/24/2013 0.67 6374 10/24/2013 0.96 6375 10/24/2013 0.97 with around half a million data points, which works fine for everything else except for the boxplots. The code works fine and the boxplots are fine, but when I change the filter

dc js Composite Bar Chart Line Chart

老子叫甜甜 提交于 2019-12-24 12:19:55
问题 I have a dc js bar chart like the one in this forked fiddle. This bar chart will be loaded with predefined filters like 25-35 in this case. Now, I have a requirement to show a line chart composite with the bar chart highlighting the filtered data with kind of high low lines as shown in this image. JS Code: var tempBarChart = dc.barChart("#barChartTemp"); // reset the charts function reset() { dc.filterAll(); dc.renderAll(); } // remove axis markings tempBarChart.yAxis().ticks(0); var

Build line chart from user input in dc.js

房东的猫 提交于 2019-12-24 11:31:28
问题 I do not need to group, reduce or sum data as the info I want to chart is in each row. The idea is that the user would select a Year and a StatKey . I would then like to build a line chart based on their selection and the data in the rest of the row. The x-axis would be comprised of first, tenth and last data columns, whilst the y-axis would be 0 - 120. Below is an example of the data: [ {"Year": "2002", "StatKey": "02437", "First": "108.26", "Tenth": "101.20", "Last": "81.73"}, {"Year":

Build line chart from user input in dc.js

风流意气都作罢 提交于 2019-12-24 11:29:22
问题 I do not need to group, reduce or sum data as the info I want to chart is in each row. The idea is that the user would select a Year and a StatKey . I would then like to build a line chart based on their selection and the data in the rest of the row. The x-axis would be comprised of first, tenth and last data columns, whilst the y-axis would be 0 - 120. Below is an example of the data: [ {"Year": "2002", "StatKey": "02437", "First": "108.26", "Tenth": "101.20", "Last": "81.73"}, {"Year":

how to display month in sequence wise in dc.js

本秂侑毒 提交于 2019-12-24 09:48:50
问题 I'm making a barchart using the Dimensional Charting javascript library dc.js. I am trying to display barchart in sequence like jan,feb,mar,apr. I can't understand how to put the months in sequence. I have attached fiddile https://jsfiddle.net/jusjkm8j/27/ . The data is in the following format. Sku Stars partner review Date KBU12 5 Amazon Preferred over the r. 02/05/2016 KBU12 5 Amazon Gorgeous fixture 05/06/2016 KBU12 2 Amazon Awesome value! 02/02/2016 KBU12 2 Homedepot Kitchen Remodel 06/09

Elastic X axis for stacked barchart, removing the empty bins [dc.js]

佐手、 提交于 2019-12-24 07:43:24
问题 There is this example that shows how you can make an elastic X axis that removes the empty bins using a fake group and the chart.elasticX(true) method. I'm trying to make this work with a stacked barchart but I face a problem. I have slightly modified the code of the above example to use a stacked group for the barchart. (I have added an Earned column in the data, made a fake group for it and assigned it to the chart.stack method). But for certain "Earned" values there is a d3.js error: