score:0
You can define your x-axis captions and series separately.
xAxis: {
categories: ['12 am', '1 am', '2 am', '3 am', '4 am', '5 am', '6 am', '7 am', '8 am', '9 am', '10 am', '11 am', 'Noon', '1 pm', '2 pm', '3 pm', '4 pm', '5 pm', '6 pm', '7 pm', '8 pm', '9 pm', '10 pm', '11 pm']
}
series: [{
name: 'Time of Day',
data: [6, 1, 3, 1, 1, 3, 2, 19, 30, 54, 80, 73, 92, 105, 87, 100, 59, 38, 24, 7, 10, 4, 8, 10]
}]
Edit-- If you don't have data for all hours, you can define your xAxis as datetime and provide values in the series for specific hours.
xAxis: {
type: 'datetime',
},
series: [{
name: 'Time of Day',
data: [
[Date.UTC(2014, 2, 28, 10), 5 ],
[Date.UTC(2014, 2, 28, 12), 33 ],
[Date.UTC(2014, 2, 28, 13), 20 ],
[Date.UTC(2014, 2, 28, 15), 26 ]
]
}]
score:9
You can specify the format of date/time to be displayed using the php strftime format, http://php.net/manual/en/function.strftime.php.
So for example if you want to change the hours(when and if they are displayed) and minutes(when and if they are displayed) to 12 hour format use %I
instead of %H
.
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%e of %b',
minute: '%I:%M',
hour: '%I:%M'
}
}
jsfiddle - http://jsfiddle.net/xya6kato/
Source: stackoverflow.com
Related Query
- Highcharts 12hr time format of x-axis labels
- Making y axis of highcharts in time format hh:mm
- Highcharts format labels on grouped stacked bar diagram with $ k, M for currency and 'hrs' for time
- Highcharts with date and time for x axis (from a database with format YYYYMMDDHHMM)
- Format Highcharts y-axis labels
- Show only time labels on xAxis. Highcharts
- Highcharts - Long multi-line y axis labels causing following label to be removed
- Highcharts - with datetime axis labels overlap
- Highcharts yaxis labels Format
- Highcharts label format with tickPositioner in a datetime x Axis
- Highcharts - Multiple Axis Graph not displaying labels
- Show some specefic number on gauge highcharts axis labels
- How to adjust line-height/ellipses in Highcharts axis labels
- Highcharts -- Can't apply style to x axis labels
- How to position labels for plotbands on y axis in Highcharts
- Chart's width is impacting to my second x axis labels in Highcharts
- How To Show All Data Labels For Datetime Axis In Highcharts
- Wrong labels on X axis on Highcharts
- Replace axis labels with custom in highcharts r
- How to handle mouse events on axis labels in highcharts
- Fourth y axis does not show labels in Highcharts
- Highcharts date time axis
- HighCharts Bubble Chart: text for axis interval labels
- Multiple images for Highcharts X Axis Labels
- Highcharts datetime axis overlap with a long time series
- highcharts axis format decimal point
- How to add exporting date and time as user format in Highcharts exporter?
- Highcharts time X axis
- Highcharts - change seconds to time (H:M:S) in data labels
- How to avoid duplicate X time axis labels
More Query from same tag
- Not able to go back to original state after drill down in highcharts
- Unable to update the linkLength of networkgraph highchart js
- Remove the Z Axis Column Line in Highcharts 3D
- Rshiny Highcharter how can I create a piechart that drills down into another pie chart?
- Highcharts datetime starting on wrong day
- drilldown charts with more than one level
- Nothing displayed in Highchart Column
- Custom buttons on Highstock not enabled
- Can't get drilldown module to work in highcharts in typescript
- How to draw scatter chart with highcharts using timeseries data
- HighCharts: Keeping Tooltip on Chart Click (Chart, Not Series)
- Highcharts: multiple series columns by year
- Using different list for names of each point in highcharts in javascripts
- Is it possible to trigger tooltip in highchart of a line chart ONLY when the mouse hovers over the point?
- Highcharts chart doesn't show all data points in X axis
- Rounded corners in highcharts
- Highchart Heatmap Tooltip get x or key in HeaderFormat
- Chart not render correctly when maximizing / restoring window or dragging resize bar (SmartGWT)
- highcharts configuration
- HIghcharts Scrollbar (w/ showFull false) displays after setExtremes called
- Highstock - insert HTML link inside flag tooltip
- Highcharts not loading on PHP page
- Highcharts data series issue with ajax/json and PHP
- Add Data text on top of Bars (vertical) - Highcharts Bar charts
- HighCharts not being displayed in Partial view
- How add linear gradient fillColor for line with highcharts
- Highcharts column with drilldown results in blurred data label in main chart, except for the drilled down columns
- How refresh title highchart
- Highstock - why is min/maxPadding on xAxis ignored
- Is it possible to plot points on a line graph using two separate arrays? (highcharts)