Reputation: 65
I am a new bee to High charts and stuck up with the formatting of axis values based on user selection. Please see the following scenario;
Date & Time Selection by User
In the image, the User select the Range of values with which the Graph will be plotted. The output as follows;
The Graph based on the User Selection
In this the data pulls out properly and all the information are correct. Except the following;
In the X-axis (The Hours of the day) the time showed from 00:15 to 05:00 instead of 10:00 to 15:00 (User selection).
Thank you.
Regards, Shenulal
Upvotes: 0
Views: 319
Reputation: 4769
If your time is fetched properly but labels showing wrongly , then it might be showing UTC dates. use utc false like below
Highcharts.setOptions({
global: {
useUTC: false
}
});
use formatter functionn in xAxis labels to get desired format of time.TickInterval to be set to one hour to show hourly data.
xAxis :{
tickInterval: 3600 * 1000 //equals to one hour
type:'dateTime',
labels: {
formatter: function() {
return Highcharts.dateFormat(''%H:%M', this.value);
}
}
Upvotes: 1