d3.js

How can I fill gaps in a dc.js series chart?

风流意气都作罢 提交于 2020-05-28 07:34:09
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

How can I fill gaps in a dc.js series chart?

て烟熏妆下的殇ゞ 提交于 2020-05-28 07:33:15
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

How can I fill gaps in a dc.js series chart?

筅森魡賤 提交于 2020-05-28 07:32:12
问题 I have the following dc.js series chart: var data = [ {day: 1, service: 'ABC', count: 100}, {day: 2, service: 'ABC', count: 80}, {day: 4, service: 'ABC', count: 10}, {day: 7, service: 'XYZ', count: 380}, {day: 8, service: 'XYZ', count: 400} ]; var ndx = crossfilter(data); var dim = ndx.dimension(function (d) { return [d.service, d.day]; }); var grp = dim.group().reduceSum(function(d) { return +d.count; }); var chart = dc.seriesChart('#graph') .width(620) .height(175) .chart(function(c) {

D3 cartography: lon/lat circles in wrong place on map (projection)

不想你离开。 提交于 2020-05-26 09:08:46
问题 I have a question about D3 cartography. I am working on a little project and I am new to D3. I have started out from this example: http://bl.ocks.org/mbostock/5914438 Instead of the showing the state-mesh, I would like to show circles on the map in certain locations (lon/lat). I am currently facing a problem that the circles are not on the correct spots on the map. I suspect the problem lies in the special projection that Mike uses. He uses a 1x1 square projection. Probably this is necessary

D3 cartography: lon/lat circles in wrong place on map (projection)

烈酒焚心 提交于 2020-05-26 09:07:29
问题 I have a question about D3 cartography. I am working on a little project and I am new to D3. I have started out from this example: http://bl.ocks.org/mbostock/5914438 Instead of the showing the state-mesh, I would like to show circles on the map in certain locations (lon/lat). I am currently facing a problem that the circles are not on the correct spots on the map. I suspect the problem lies in the special projection that Mike uses. He uses a 1x1 square projection. Probably this is necessary

D3js collapsible tree throwing bad request

為{幸葍}努か 提交于 2020-05-24 07:31:31
问题 I am using the d3js collapsible tree grid to display the nodes and when I run the code in plunker I am getting a weird 400 bad request error. I have replaced the code which fetches the json and hard coded the json directly like below: var treeData ={"user_id":0,"name":"Root Node","children":[{"user_id":0,"name":"Flossie Hickman","children":[....]}]}; // Calculate total nodes, max label length var totalNodes = 0; var maxLabelLength = 0; // variables for drag/drop var selectedNode = null; var

How to put a legend in a pie chart in d3.js

穿精又带淫゛_ 提交于 2020-05-24 03:30:07
问题 I have this pie chart created in d3.js and want to put some legend on it. But the is almost all of the documentation i've read so far is only for d3.js version 3 and a lot has changed for v5. Some says that there is already a built in legend maker of d3 which i don't understand how to use it. Please help. Below is my code snippet of the pie chart: /** START OF PIE CHART */ var data = [{"region_iso_code":"PH-00","total_up_percentage":97.69},{"region_iso_code":"PH-01","total_up_percentage":99

How to put a legend in a pie chart in d3.js

痞子三分冷 提交于 2020-05-24 03:30:06
问题 I have this pie chart created in d3.js and want to put some legend on it. But the is almost all of the documentation i've read so far is only for d3.js version 3 and a lot has changed for v5. Some says that there is already a built in legend maker of d3 which i don't understand how to use it. Please help. Below is my code snippet of the pie chart: /** START OF PIE CHART */ var data = [{"region_iso_code":"PH-00","total_up_percentage":97.69},{"region_iso_code":"PH-01","total_up_percentage":99

Stroke on rect in D3 blurry

会有一股神秘感。 提交于 2020-05-23 08:41:07
问题 I am trying to draw a rectangle with a dashed strong in SVG using D3 but when I do the top and bottom dashed lines are blurry. Here is my code: var width = 400, height = 400; var svg = d3.select('body') .append('svg') .attr('width', width) .attr('height', height) .append('g') .attr('transform', 'translate('+height/2+','+width/2+')'); svg.append('rect') .attr('width', '185') .attr('height', '45') .attr('x', -height/2+185/2) .attr('y', -width/2+10) .attr('fill', 'rgba(0,0,0,0)') .attr('stroke',

avoid enumerating group names in d3.layout.stack()[“group 1”, “group 2”]

六眼飞鱼酱① 提交于 2020-05-17 06:49:12
问题 I am having a really hard time understanding d3.layout.stack() when groups are not listed manually. In the below example, similar to what I've found in other questions, groups are listed in [] as "Apple", etc., but as far as I understand this has to be inputted manually. I am seeking a way to not have to manually input "Apple", "Blueberry", etc. var dataset = d3.layout.stack()(["Apple", "Blueberry", "Lettuce", "Orange"].map(function(fruit) { return data.map(function(d) { return {x: d.orchard,