Plotting Data using JScript

Generate data points and add them to the graph.  Start

Hide the axes.

Show the axes.

 


Script Example

<script language="JavaScript"> 
function plotData(){
    document.DataGraph.setAutoRefresh(false); 
    document.DataGraph.clearSeries(1); 
    document.DataGraph.setSeriesStyle(1,false,2);
    document.DataGraph.setSeriesRGB(1,255,0,0); 
    x=0; dx=1.0/20.0; pi=Math.PI; 
    for(i=0; i<20;i++){ 
        document.DataGraph.addDatum(1,x,Math.exp(-(x-0.5)*(x-0.5)/0.02)+Math.random()*0.1); 
        x+=dx;
    } 
    fid=document.DataGraph.addFunction("x","exp(-(x-0.5)*(x-0.5)/0.02)"); 
    document.DataGraph.setAutoRefresh(true); }
</script>