Accepted answer

All you really need to do is prepare a line chart and compute the pdf. D3 provides the charting framework and Jason Davies Science library the stats.

The d3 line function boils down to:

var line = d3.svg.line()
    .x(function(d) {
        return x(d.q);
    .y(function(d) {
        return y(d.p);

And your Bell curve coordinates can be calculated using the Box-Muller Transform and passing this to the Gaussian pdf.

You can see this all put together in this Bl.ock. You should also check out the links in the code.

Related Query