0

My flot graph is rendering fine on firefox and chrome, however on ie11 it does not render. the graph appears with no datapoints.

var options = {
    "xaxis" : {
        "mode" : "time",
        "timeformat" : "%d/%m",
        //"tickSize" : [1, "day"]
    },
    "yaxes" : [{
            "position" : "left",
            //"tickSize" : 1,
            "min" : min,
            "max" : 100
        }, {
            "position" : "right",
            "min" : 0,
            "max" : max
        }
    ],
    "series" : {
        "lines" : {
            "show" : true
        },
        curvedLines: {
            apply: true,
         } 
    },

    "colors" : ["#00ff00"],
    "legend" : {
        "show" : false
    },
    "grid" : {
        hoverable: true,
        clickable: true
    }//,
    //animator: { start: 100, steps: 99, duration: 2000, direction: "left" }
};

var data_ajax = [{
            "color" : "#A8B400",
            "label" : "R1 Graph",
            "lines" : {
                "show" : true,
                "lineWidth" : 1
            },
            "points" : {
                "show" : false
            },
            "yaxis" : 1,
            "data" : arr
        }
    ];
    $('#network-graph').empty();
    plot = $.plot("#network-graph",  data_ajax, options);

Problem I found was with the data_ajax variable. it contained objects with wrong format. The time format i had to use for IE11 fix is as follows

var to_seconds = moment(data[i].TIMESTAMP, 'YYYY-MM-DD hh:mm A').unix() * 1000;

I wasn't specifying a format previously. Is there a universal date time format I can use for all browsers?

shorif2000
  • 2,582
  • 12
  • 65
  • 137
  • Can you create a [JSFiddle](http://jsfiddle.net) reproducing the issue? [This Fiddle](http://jsfiddle.net/o6xht8x4/1/) works in both IE11 and Chrome. – mechenbier Dec 15 '15 at 13:32
  • 1
    The timestamp in milliseconds is the universal (or base) format for JavaScript dates. Return these from your PHP and you shouldn't have problems (the `Date.parse()` function to read dates in text format is somewhat browser-dependent, but all browsers should understand default ISO-format). – Raidri Dec 17 '15 at 10:30
  • how can i make it work in js and timezone aware ? – shorif2000 Dec 20 '15 at 19:06

0 Answers0