javascript - how to use crossfilter and dc.js to draw a cumulative distribution function lineChart -
suppose have records this:
// origin: http://blog.rusty.io/2012/09/17/crossfilter-tutorial/ var livingthings = crossfilter([ // fact data. { name: “rusty”, type: “human”, legs: 2 }, { name: “alex”, type: “human”, legs: 2 }, { name: “lassie”, type: “dog”, legs: 4 }, { name: “spot”, type: “dog”, legs: 4 }, { name: “polly”, type: “bird”, legs: 2 }, { name: “fiona”, type: “plant”, legs: 0 } ]);
let's want draw simple cdf based on legs variable using crossfilter , dc.js's linechart.
the expected chart points be:
x:0 --> y:0.16667 x:2 --> y:0.66667 x:4 --> y:1
but don't know how can implement this. please this? thanks!
Comments
Post a Comment