<%
var data1 = [];
totalPoints = 10;
var chartOptions = require("../config/chart-options.json");
function getRandomData() {

    if (data1.length > 0)
        data1 = data1.slice(1);

    while (data1.length < totalPoints) {
        for (var i = 0; i <= 20; ++i) {
            var x1 = Math.random();
            var x2 = Math.random();
            var x = x1 + i * (Math.abs(x2 - x1)) / 100;
            data1.push([i, Math.sin(x * Math.sin(x))]);
        }
    }

    chartOptions["series"]["bars"]["barWidth"] = 0.5;
    chartOptions["xaxis"]["autoscaleMargin"] = 0;

    return [
        {"series1":{label: "sin(x sin(x))", data: data1}},chartOptions
    ];

}

var log = new Log();
log.info("data4.jag");

print(getRandomData());

%>
