NodeJS and Dygraphs
<p>I try to draw a (Dy)graph ... currently running NodeJs - a little bit of HTML.</p>

<p>My question is: My data is stored in a postgreSQL DB...How do i load the data from my datasource and into my NODEJS FILE? All example by DyGraphs...is inline or loading from a text file...i have million of data point - so the solution should have performance like no. 1 criteria...</p>

<p>If you would approach this in a very different way - another way to construct and build this code - please tell me! My only demand is it runs NodeJS...</p>

<h2>HTML FILE</h2>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;script type="text/javascript" src="node_modules/dygraphs/dygraph-combined-dev.js"&gt;&lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;div id="demodiv"&gt;&lt;/div&gt;
        &lt;script type="text/javascript" src="chart.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            draw_chart();
        &lt;/script&gt;
    &lt;/body&gt; &lt;/html&gt;
</code></pre>

<h2>NODEJS FILE:</h2>

<pre><code>function draw_chart() {

    new Dygraph(
        document.getElementById("demodiv"),
        "chart.csv"
        );
}
</code></pre>