score:262
Highcharts will automatically try to find the best format for the current zoom-range. This is done if the xAxis has the type 'datetime'
. Next the unit of the current zoom is calculated, it could be one of:
- second
- minute
- hour
- day
- week
- month
- year
This unit is then used find a format for the axis labels. The default patterns are:
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
If you want the day to be part of the "hour"-level labels you should change the dateTimeLabelFormats
option for that level include %d
or %e
.
These are the available patters:
- %a: Short weekday, like 'Mon'.
- %A: Long weekday, like 'Monday'.
- %d: Two digit day of the month, 01 to 31.
- %e: Day of the month, 1 through 31.
- %b: Short month, like 'Jan'.
- %B: Long month, like 'January'.
- %m: Two digit month number, 01 through 12.
- %y: Two digits year, like 09 for 2009.
- %Y: Four digits year, like 2009.
- %H: Two digits hours in 24h format, 00 through 23.
- %I: Two digits hours in 12h format, 00 through 11.
- %l (Lower case L): Hours in 12h format, 1 through 11.
- %M: Two digits minutes, 00 through 59.
- %p: Upper case AM or PM.
- %P: Lower case AM or PM.
- %S: Two digits seconds, 00 through 59
http://api.highcharts.com/highcharts#xAxis.dateTimeLabelFormats
score:19
You write like this-:
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%d %b %Y' //ex- 01 Jan 2016
}
}
also check for other datetime format
http://api.highcharts.com/highcharts#xAxis.dateTimeLabelFormats
score:32
Check this sample out from the Highcharts API.
Replace this
return Highcharts.dateFormat('%a %d %b', this.value);
With this
return Highcharts.dateFormat('%a %d %b %H:%M:%S', this.value);
Look here about the dateFormat()
function.
Also see - tickInterval and pointInterval
Source: stackoverflow.com
Related Query
- How to get highcharts dates in the x axis?
- How to get the axis value with respect to the cross hair in highcharts
- HighCharts - Angular, how to get y axis labels on the vertical lines drawn from x axis
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How can I get the max value of a y axis at highcharts?
- How to get Highcharts X-Axis Categories starting at the left most point
- How do I get the value of a highcharts graph point on mouseover?
- How to get the Div id of charts in highcharts on click of it in angular 6
- how to get the axis value when I click on a cursor in highstock(high charts)?
- How do I get my highcharts to reduce in size when the window is resized down
- How do I put Icons in the y Axis for a Dynamic Highcharts chart?
- How to get the highlighted point from shared tooltip formatter, Highcharts
- Highcharts - how to create multiple y axis and group the data series
- how to display 2 same highcharts without duplicate the code
- Get the x axis range on selecting a zoom range in Highcharts
- Highcharts Bubble Chart - How to get the size of the point
- How do I use dates from a LinkedHashMap for the x-axis on a Highcharts line graph (using Thymeleaf)?
- Highcharts - How can I get the nearest point on click event
- How to make the Y Axis values not start from 0 in highcharts? How to display forcefully display the last category data on X axis in HighCharts ?
- How to get the angular component class reference inside an emitted Highcharts selection event callback function?
- How do I plot the x axis line using Highcharts when pegged at 0?
- How to get the correct the date-time format for highcharts in R (using rcharts)
- Get only visible x axis dates when zooming in highcharts
- highcharts via json how to get the xAxis?
- highcharts how to make x and y axis starting on the same zero using categories on yAxis
- Highcharts - how to access category of multiple axis of the point from tooltip
- How can I get HighCharts column chart to scale the yAxis to not have so much whitespace?
- HighCharts how to place dates in the Y-Axis (vertical axis)
- How can I update the data in highcharts for both x axis & y axis?
More Query from same tag
- Highcharts - How to sort data by name?
- Using an input box to get a variable?
- Tools for building charting server that creates / caches server-side rendered image charts?
- $("#highcharts-2i5ujpv-2").highcharts() is undefined
- Remove the strikethrough on legend symbols for line charts?
- How to get multiple series data in tooltip highcharts?
- How to add fill color in highcharts data series
- Highcharts pass external variable to global options
- How to return Highcharts in Apollo Query component?
- Remove tooltip from level 2 of treemap (using highcharts)
- Highcharts issues with date
- HighCharts - two Y-axis, one with max value
- highcharts JSON google earth
- how to get index of a point in Highcharts to use in an event?
- How to create highlight area under curve in high chart?
- Highcharts sync is not working horizontally
- How to add another same chart but with different data?
- Highcharts - Can't run example
- How to make highchart points redirect to another component with value in React?
- after using for loop all my column graphs are plotted in single color i need each bar in different color in highcharts
- How do I set a custom style to given stacked columns?
- (HighCharts) Color reverts on mouseOut after manual mouseOver
- Coloring a country in lat-long highmap
- How to force the display of every labels on yAxis in a BarChart
- In Highcharts, my dataLabels disappear when re-enabling the rightmost element of my chart
- How can i loop data in highcharts
- clip path in highcharts chart makes line invisible
- Highcharts datetime label for column
- Highstock UTC date YTD
- Different approach to generate PDF of a HTML page which contains 10 highcharts using mPDF in PHP