score:1
Accepted answer
best way i found to do this was to filter my data ahead of time in the nesting phase:
var data_array = keys.map(function(name) {
return {
name: name, // values > 0 will be excluded
values: data.filter(function(d) { return +d[name] > 0 }).map(function(d) {
return {date: d.date, poll: +d[name]};
})
};
});
Source: stackoverflow.com
Related Query
- Plotting multiple lines with different number of values
- Creating nested Json structure with multiple key values in Python from Json
- D3: skip null values in line graph with several lines
- Special donut chart with different rings/arcs for positive and negative values
- Plotting a very large number of points on HTML5 canvas with JavaScript
- Half pie chart with multiple values
- Align lines and dots with x-axis values in line chart
- Multiple maps with d3.js: change values of scale and center
- D3 with AngularJs, Multiple charts on same page with different data based on common key
- d3.js small multiples map with different filled country for every multiple
- How to overcome x-axis styling problems when multiple X-axis Values with single point to load in C3 graph?
- React + d3 multiple charts components with different data
- Transition between paths with different number of data points
- Tooltips for multiple lines chart with legend click d3.js
- How to plot multiple lines one for each element of an array contains y values in vega spec data?
- Multiple polygons with different roll over actions in d3
- d3: multiple lines same graph with varying y domains?
- Updating D3 column chart with different values and different data sizes
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- d3 Grouping data on multiple values in combination with key value pair
- No DIVs created by D3 on enter() data with multiple values
- D3 Transition. Working with multiple lines on line graph and would like to transition smoothly between lines when button is pressed
- Creating multiple lines using json file with coordinates in d3.js
- How to draw a scatter plot with multiple y values for each x value?
- d3 Circle Packing - Printing labels with multiple lines
- dc.js Scatter Plot with multiple values for a single key
- Multiple d3 charts on a page with different (linear and log) axes
- Multiple D3 TreeMap on the same page with different div id's
- Show missing values with dotted lines
- Multiple lines with d3.js
More Query from same tag
- D3 Wordwrap with data-driven width limit
- Can't get c3.js right click event arguments
- How do I change the position of a circle svg element using the transform attribute?
- How do I position tooltips to follow a data point to which it is attached in D3?
- d3 - disable scrolling when zooming with mouse wheel?
- d3.js radial tree layout variable node length / text wrap node description
- Pie chart legend in dc.js 1.7 not showing up
- d3 v5 axis transition
- Converting stroked path to shape with javascript
- On click re-position root node and adjust window
- Django heatmap d3.js passing returned data from search
- how to add legend to a pie chart using D3js? And how to centralise the pie chart?
- Configure fixed-layout static graph in d3.js
- JS: Working with Sliders
- Using a scale in d3.js to fill up a vertical bar with 3 colors
- Update chart with new data not working
- show dropdown for particular node when down arrow is clicked
- Append linked graphics at fixed locations on d3 geo plot
- How to fix graph so it doesn't write over itself when resizing
- D3 - Why do circles drawn on top of a map not appear in the correct position?
- D3.JS- Format tick values with an ordinal scale axis
- How to change the location of the pie chart in D3?
- Can the links in D3.js Sankey Diagrams be anything besides cubic bézier curves?
- D3 pick nodes needed for graphics
- Drawing state borders with d3 not working as expected
- D3 - adding dynamic data to tick labels
- D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing - Need orientation changed
- Does it make sense to convert dc.js to React?
- format date in javascript using d3.js tool
- Plotting Name of States on Map using Node js and D3 in real time