score:1
So there are a couple things going on in this question, so I'll try to separate them:
Crossfilter works with tidy data
http://vita.had.co.nz/papers/tidy-data.pdf
This means that you will need to come up with a naive method of filling in the nulls you're seeing (or if need be, in your initial query of the data, omit the nulled values. If you want to get really fancy, you could even infer the null values based off of other data. Whatever your solution, you need to make your data tidy prior to putting it into crossfilter.
Groups and Filtering Operations
txnVolByCurrcode = txnByCurrcode.group().reduceSum(function(d) {
if(d.GROUPING_ID ===1) {
return d.TXNCOUNT;
} else {
return 0;
}
});
This is a filtering operation done on the reduction. This is something that you should separate. Allow that filtering to occur elsewhere (either in the visual, crossfilter itself, or in the query on the data).
This means your reduceSum's become:
var txnVolByCurrcode = txnByCurrcode.group().reduceSum(function(d) {
return d.TXNCOUNT;
});
And if you would like the user to select which group to display:
var groupId = cfdata.dimension(function(d) { return d.GROUPING_ID; });
var groupIdGroup = groupId.group(); // this is an interesting name
dc.pieChart("#group-chart")
.width(250)
.height(250)
.radius(125)
.innerRadius(50)
.transitionDuration(750)
.dimension(groupId)
.group(groupIdGroup)
.renderLabel(true);
For an example of this working: http://jsfiddle.net/b67pX/
Source: stackoverflow.com
Related Query
- How to achieve dimensional charting on large dataset?
- D3: How to show large dataset
- How to load very large CSV dataset into d3
- How to handle large dataset in d3js
- How to plot circles on path using React D3 for tooltip for large dataset fast
- D3 How to change dataset based on drop down box selection
- Load large dataset into crossfilter/dc.js
- d3 — Progressively draw a large dataset
- How can I achieve the R kernel density estimate plot using D3.js?
- Making bar widths and gaps consistent in dc.js when using a large dataset and d3.scale.linear()
- How to achieve disc shape in D3 force simulation?
- How to smooth/reduce/filter large amounts of sensor data?
- D3.js - how can I iterate through subarrays in my dataset
- How to get projected path definition strings (not SVG elements) from a GeoJSON dataset with D3?
- Large dataset crashes my browser
- How to achieve that bubbles are only clickable if completly zoomed d3js
- How to increase time to read d3.json data for large data set and slow networks?
- Large dataset visualisation
- How to achieve magnifying square effect for D3 charts?
- d3.js not being able to visualiza a large dataset
- How to reset svg scaling and fit to screen for random but large maps/datasets with different orientations
- Javascript D3 How to access and manipulate dataset from CSV
- How to achieve "flying Arcs" as link in the force layout of D3.js
- How to achieve this transition effect in d3?
- How to display d3 bubbles in different colors for a dataset with one branch and many children?
- How to achieve jQuery slide (slideDown, slideUp) methods in D3.js
- How to add the data in the tooltip after the dataset switching
- How would I parse a large TSV file in node.js?
- D3 v4: charting tool: How to send horizontal gridlines behind columns
- D3.js - How to use inline JSON as dataset for D3 charts, instead of csv/tsv/json file
More Query from same tag
- how to draw an array of circles in a straight line, in the bottom of the browser window
- How to read in CSV with d3 v4?
- d3js transforming nested group images
- A good book for learning D3.js
- Losing Data Binding When Creating Path
- Why text append outside svg element d3js?
- Bad SVG performance on Ipad
- Arc Chart - with various segment indentions/heights
- D3js: Unable to rotate axis labels
- Adding Text on UI with SVG
- How to use d3.js in JSP?
- Text Transition on Click D3.js
- Convert D3 to Angular component
- d3js: adding same type of elements with different data
- Empty arc in Datamaps
- Back to path style color on click in d3.select(this)
- How to add a title for a NVD3.js graph
- d3.js projection scale doesn't increase a size of a country
- How to draw non-scalable text in SVG with Javascript?
- The most elegant way to reuse aggregation related code in d3 rollup?
- Ionic D3.js piechart does not render
- How to update (but not redraw) a d3-geomap with new data
- Center a element on the svg
- using d3 data properties to set inner HTML to an img link
- Watching for updates nested within multiple objects passed into angular component
- Major issue with running d3.v3.js
- D3.js v5 not displaying any data using d3.tsv()
- D3.js Straight links in tree after transformation
- Getting TypeError: .selectAll(...).enter is not a function with d3.js
- d3.js dendrogram : binding old and new properties to the svg element