getChartXY = function() { // create new chart chart = new ChartXY(); // define plotted ranges of x and f(x) chart.XRange = [ 0, Math.PI*2]; chart.YRange = [ 2, -2]; // plot x-axis with function f(x) = 0 function zero(x) { return 0.0; } chart.Add(zero, 'rgba(64,64,64,1.0)', 1); // plot sin with blue line chart.Add(Math.sin, 'rgba(0,0,255,0.7)', 3); // plot cos with green line chart.Add(Math.cos, 'rgba(0,255,0,0.7)', 3); return chart; }
Simple line chart applet using ExplorerCanvas. After changing code, click 'plot'.
home