dc.js

dc.js multiple select menu with checkboxes

淺唱寂寞╮ 提交于 2019-12-22 10:38:48
问题 I have a dataset which consists of 5 columns -> country, id, value and sector. I was able to create a row chart in dc.js using the value and country, where country is my dimension. var rowChart = dc.rowChart('#rowChart'); d3.csv('data.csv', function(data){ data.forEach(function(d){ d.country = d.country; d.id = d.id; d.value = +d.value; d.sector = d.sector; }); var height = 300; var width = 300; var ndx = crossfilter(data) var countryDim = data.dimension(function (d) { return d.country; });

DC.js scatterPlot ordinal axis tick position

拜拜、爱过 提交于 2019-12-22 08:25:09
问题 How can I position the value points directly above the ticks (or the ticks directly under the points), using DC.js. I could not manage that, DC.js (or D3.js) positions the value points shifted to the left of the ticks, although the X-value is exactly the tick value. Important: I need this feature for ordinal X axis (it works fine for linear X axis)! var data = [ {"x":"a","y":1}, {"x":"b","y":2}, {"x":"c","y":3} ]; ... dc.scatterPlot("#mychart") .dimension(dimension) .group(group) .x(d3.scale

how to create multiline chart using dc.js

不想你离开。 提交于 2019-12-22 04:12:26
问题 I'm making a multi line chart using the Dimensional Charting javascript library dc.js, which is based on d3 and crossfilter. i am new in dc.js library.i am trying to display the multiline chart using csv file.i cant understand how to create multiline chart following csv format. my csv column format is Age_19_Under Age_19_64 Age_65_84 Age_85_and_Over 26.9 62.3 9.8 0.9 23.5 60.3 14.5 1.8 24.3 62.5 11.6 1.6 24.6 63.3 10.9 1.2 24.5 62.1 12.1 1.3 24.7 63.2 10 2.2 25.6 58.5 13.6 2.4 24.1 61.6 12.7

Trying to render data d3 crossfilter dc.js BarChart. The chart is drawn, but it's empty

只愿长相守 提交于 2019-12-22 01:30:00
问题 I must be doing something naive, but I can't get my data to render within the chart. here's my example data: var data = [ { date: '02-12-2013', val: 13, } { date: '02-13-2013', val: 6, } ... ] here's my code: var cf = crossfilter(data); var dim = cf.dimension(function(d){ return d.val }); var group = dim.group(); var barchart = dc.barChart('#container'); barchart.width(850) .height(250) .margins({top: 10, right: 50, bottom: 30, left: 40}) .dimension(dim) .group(group) .gap(1) .x(d3.time.scale

Tooltips in DC.js ( D3 Library )

久未见 提交于 2019-12-21 17:24:27
问题 DC.js has great functionality built-in to display tooltips per documentation .title([titleFunction]) function. Is there anyway to make the tooltips more like a bootstrap style tooltip similar to rickshaw's implementation? 来源: https://stackoverflow.com/questions/21992972/tooltips-in-dc-js-d3-library

Crossfilter showing negative numbers on dc.js with no negative numbers in the dataset

流过昼夜 提交于 2019-12-21 17:05:48
问题 I am using CrossFilter along with dc.js to create 4 different bar charts and allow a user to change the data by using the brush feature on the charts, so when the user changes the brush on one chart the others dynamically changes. This is all working for me at the minute bar one interesting issue, it looks like CrossFilter or dc.js are putting negative values on the graphs but only when certain sections of a graph is selected. So as you can see from the image when I select an area of a chart

How to make graphs in dc.js scrollable within a fixed dimension div?

故事扮演 提交于 2019-12-21 12:11:06
问题 I have been making some graphs using dc.js and i am plotting some manufacturers in a row-chart against their count. when manufacturer increase in number the row width becomes really small and hard to distinguish. I tried to use overflow : scroll in css but it also scrolls the scale with the graph. 回答1: There is a way to do this. I have 4 files, index.html, iframe.html, iframe.css, and iframe.js. Here is my setup. In index.html I had: <html> <head> <title>Example</title> <meta charset="utf-8">

Replace crossfilter data, restore dimensions and groups

故事扮演 提交于 2019-12-21 12:04:05
问题 I'm using dc.js to render a nice bubble chart of a dataset. Underlying dc.js is crossfilter. I'd like to smoothly refresh my chart with new data from the server. This issue on Github makes it clear that it is possible to do this by: deleting all the data from the crossfilter adding in the new data calling dc.redrawAll() . I've got this working but in order to delete all the data, you first have to clear all the filters (because crossfilter.remove only removes the records matching the current

Reorder datatable by column

佐手、 提交于 2019-12-20 09:06:29
问题 I was wondering if there is any known way to efficiently add a "Reorder" feature to my datatables in dc.js. It would be great if my users, after having done their selection with the charts, could decide according to which column the filtered rows should be ordered (by clicking on the column header for example). Any ideas where to start? Thanks a lot 回答1: I like to use JQuery datatables for this: http://datatables.net/ First add the table and the header row: <table id="dc-data-table" class=

Reorder datatable by column

时间秒杀一切 提交于 2019-12-20 09:05:23
问题 I was wondering if there is any known way to efficiently add a "Reorder" feature to my datatables in dc.js. It would be great if my users, after having done their selection with the charts, could decide according to which column the filtered rows should be ordered (by clicking on the column header for example). Any ideas where to start? Thanks a lot 回答1: I like to use JQuery datatables for this: http://datatables.net/ First add the table and the header row: <table id="dc-data-table" class=