-2

I am looking for something like http://www.flotcharts.org/flot/examples/tracking/index.html. The only problem is that I need y axis to show altitude and x axis to show time of the day. How can I do this; I can use php or jquery for this work, so any suggestions will be appreciated.

Thanks in advance

user11085
  • 5
  • 2

3 Answers3

2

have a look at

highcharts.com

may that helps.

Dharmendra
  • 216
  • 1
  • 14
2

or maybe you find something in this library.

http://d3js.org/

MichaelKaeser
  • 162
  • 1
  • 2
  • 12
1

You could do it with Flot plugin by setting:

xaxis: {
    mode: "time",
    timeformat: "%Y/%m/%d"
}

You can adjust it by other options as well. Take a look at this: https://github.com/flot/flot/blob/master/API.md#time-series-data


---- EDIT ----

Here you go: http://jsfiddle.net/ZDt7h/7/

$(function(){
    var $placeholder = $('#placeholder');
    var start = 1361399340000;   
    var serie = [[start, 1],[start+60E3, 2],[start+120E3, 3],[start+180E3, 2]];

    var myplot = $.plot($placeholder, [serie], {
        xaxis: {
            mode: 'time',
            timeformat: '%H:%M:%S'
        },
        series: {
            'shadowSize': 0,
            'points': {
                'show': true
            },
            'lines': {
                'show': true
            }
        },
        crosshair: { 'mode': 'x' },
        grid: { 'hoverable': true, 'autoHighlight': true }
    });

    $('#update').click(function(){
        serie.push([start+(serie.length)*60E3, Math.floor(Math.random()*10)]);
        myplot.setData([serie]);
        myplot.setupGrid();
        myplot.draw();
    });
});
Jan.J
  • 3,050
  • 1
  • 23
  • 33
  • 1
    I can use four points per day based on time and altitude..other than that I need that when the user moves along , the altitude can also be tracked at all times..could u show an example ? – user11085 Feb 18 '13 at 08:40