You can just use regular Java date's in millis (as numeric longs), where the the values are the number of milliseconds since the epoch. Make sure that you set the XAxis type to "Axis.Type.DATE_TIME", and GWT Highcharts/Highcharts will do the rest. Example here:
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.
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.
You can just use regular Java date's in millis (as numeric longs), where the the values are the number of milliseconds since the epoch. Make sure that you set the XAxis type to "Axis.Type.DATE_TIME", and GWT Highcharts/Highcharts will do the rest. Example here:
http://www.moxiegroup.com/moxieapps/gwt-highcharts/showcase/#line-spline-irregular
See the DateTimeLabelFormats for controlling the way the timestamps are displayed on the axis:
http://www.moxiegroup.com/moxieapps/gwt-highcharts/apidocs/org/moxieapps/gwt/highcharts/client/DateTimeLabelFormats.html
Also see the "setUseUTC" global option in case you have trouble with the way the timezone logic functions:
http://www.moxiegroup.com/moxieapps/gwt-highcharts/apidocs/org/moxieapps/gwt/highcharts/client/Global.html#setUseUTC%28boolean%29