{"size": 746, "ext": "js", "max_stars_repo_path": "13.Dashboard/js/Charts/RealtimeChart.js", "max_stars_repo_name": "leoshiang/DesignPatterns", "max_stars_repo_stars_event_min_datetime": "2018-11-21T01:54:16.000Z", "max_stars_repo_stars_event_max_datetime": "2018-11-21T01:54:16.000Z", "max_issues_repo_path": "13.Dashboard/js/Charts/RealtimeChart.js", "max_issues_repo_name": "leoshiang/DesignPatterns", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "13.Dashboard/js/Charts/RealtimeChart.js", "max_forks_repo_name": "leoshiang/DesignPatterns", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.3125, "max_line_length": 91, "alphanum_fraction": 0.4879356568}
DesignPatterns.namespace("Charts").RealtimeChart = (function () {
    var coordinates = DesignPatterns.DataSource.Coordinates;
    var plot;

    /**
     * 更新圖形內容
     */
    function update() {
        plot.setData([coordinates.generateRandomCoordinates()]);
        plot.draw();
        setTimeout(update, 30);
    }

    /**
     * 初始化
     */
    var init = function () {
        var options = {
            series: {shadowSize: 0},
            yaxis: {min: 0, max: 100},
            xaxis: {show: false},
            colors: ["#cc0000"]
        };

        plot = $.plot($("#realtime"), [coordinates.generateRandomCoordinates()], options);
        update();
    };

    return {
        init: init
    }
})();