3
votes

What is the proper way to limit out NaN values from dc.js figures?

Let's say these values are checked on the dimension function and converted to a numerical value -1000, when the legal numerical range in my case is [0,Inf). Then, I draw a bar chart (histogram) and set the x axis limits to start from 0 onwards. In this manner I can avoid the -1000 peak, but only if the option elasticX is disabled.

Is there a renderlet solution or another approach that would allow me to use the elasticX option and in the same time omit the -1000 peak?

I do not want to address this by using crossfilter, as this would filter out the whole sample row, as the sample might have a defined value for a different variable, but on Dc.js figure-by-figure basis.

1

1 Answers

1
votes

Use the "fake group" technique described here:

https://github.com/dc-js/dc.js/wiki/FAQ#filter-the-data-before-its-charted

... to remove unwanted groups before drawing/updating the chart.(Really .data() is designed for this but it doesn't work for all charts, yet.)