Menu

GWT Highcharts : Displaying 'Date' values on X-Axis

2013-05-24
2013-05-28
  • Muhammad Yaseen

    Muhammad Yaseen - 2013-05-24

    I am using GWT Highcharts to draw a bar-graph. The values for both X and Y axis are coming from the MySQL database.

    The chart will display a graph having vc values on Y-Axis and corresponding sampleno (i.e. Date) on X-Axis.

    Following is the code of loop that fills the series.

    for(int i = 0; i < stats.size(); i++)
    {        
     long sample = Long.parseLong(stats.get(i).getSampleno() + "");
     long n = (sample*60000);
     pointDate = new Date(n);
    
     Point point = new Point( /* pointDate?? */ ,stats.get(i).getVc());         
     serPt.addPoint(point);                            
     }
    

    The sampleno is some timestamp which I am converting into Date.

    Now, Could you guide me how can I display this date as values on x-axis.

    An example on Moxie Group site does this, but the dates are in a fixed range there.

    Please comment if any further explanation is needed.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.