Sha256: dd6a63dd177723fb4b6975e76fc2e6216a77bb5b167e281388a357b845680aaf

Contents?: true

Size: 1.96 KB

Versions: 4

Compression:

Stored size: 1.96 KB

Contents

$(function () {

    var d1, data, chartOptions;

    d1 = [
        [1262304000000, 5], [1264982400000, 200], [1267401600000, 1605], [1270080000000, 1129],
        [1272672000000, 1163], [1275350400000, 1905], [1277942400000, 2002], [1280620800000, 2917],
        [1283299200000, 2700], [1285891200000, 2700], [1288569600000, 2100], [1291161600000, 1700]
    ];

    d2 = [
        [1262304000000, 434], [1264982400000, 232], [1267401600000, 475], [1270080000000, 553],
        [1272672000000, 675], [1275350400000, 679], [1277942400000, 789], [1280620800000, 1026],
        [1283299200000, 1640], [1285891200000, 1892], [1288569600000, 2147], [1291161600000, 2256]
    ];

    data = [{
        label: "Total visitors",
        data: d2
    }, {
        label: "Total sales",
        data: d1
    }];

    chartOptions = {
        xaxis: {
            min: (new Date(2009, 12, 1)).getTime(),
            max: (new Date(2010, 11, 2)).getTime(),
            mode: "time",
            tickSize: [1, "month"],
            monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            tickLength: 0
        },
        yaxis: {

        },
        series: {
            lines: {
                show: true,
                fill: true,
                lineWidth: 3
            },
            points: {
                show: true,
                radius: 4.5,
                fill: true,
                fillColor: "#ffffff",
                lineWidth: 2.75
            }
        },
        grid: {
            hoverable: true,
            clickable: false,
            borderWidth: 0
        },
        legend: {
            show: true
        },

        tooltip: true,
        tooltipOpts: {
            content: '%s: %y'
        },
        colors: App.chartColors
    };

    var holder = $('#area-chart');

    if (holder.length) {
        $.plot(holder, data, chartOptions);
    }

});

Version data entries

4 entries across 3 versions & 1 rubygems

Version Path
repsheet_visualizer-1.1.0 lib/repsheet_visualizer/application/public/js/demos/charts/flot/area.js
repsheet_visualizer-1.0.0 lib/repsheet_visualizer/application/public/js/demos/charts/flot/area.js
repsheet_visualizer-1.0.0 redesign/js/demos/charts/flot/area.js
repsheet_visualizer-0.2.2 redesign/js/demos/charts/flot/area.js