score:1
You can use xAxis.dateTimeLabelFormats
to set how different ranges for the x-axis affect the labels. It defaults to:
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
}
But you could alter the format for week
to be "MMM DD." instead, like so (JSFiddle demo):
dateTimeLabelFormats: {
week: '%b %e.'
}
Not that if you want a leading zero for "DD" (e.g. "05") you have to use %d
instead of %e
. If you want it to apply to more ranges just add for day
, month
... as well.
The formatting codes that can be used are found in the source code (not in API, for some reason):
// Day
'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
'A': langWeekdays[day], // Long weekday, like 'Monday'
'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
'e': dayOfMonth, // Day of the month, 1 through 31
// Week (none implemented)
//'W': weekNumber(),
// Month
'b': lang.shortMonths[month], // Short month, like 'Jan'
'B': lang.months[month], // Long month, like 'January'
'm': pad(month + 1), // Two digit month number, 01 through 12
// Year
'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
'Y': fullYear, // Four digits year, like 2009
// Time
'H': pad(hours), // Two digits hours in 24h format, 00 through 23
'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59
'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)
score:1
You need to use label formatter including Highcharts.dateFormat
Source: stackoverflow.com
Related Query
- Highstocks Changing x axis tick from Feb DD. MMM to MMM DD
- Changing X axis type from category to datetime on drilldown
- How to remove tick lines from secondary y axis in highcharts heatmap graph
- How to disable range selector from highstocks charts
- Highcharts - How to start x axis from an arbitrary value
- Highstocks - Use tickmarkPlacement "between" on datetime Axis (no categories)
- How to dynamically change axis from linear to logarithmic in HighChart
- Align y axis tick "outside" on highstock, so they are the same as on highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to populate a Highcharts axis with string formatted data from a PHP array
- Highcharts.js DateTime on x axis coming from JSON only displays number
- How to catch the click event from the axis ticks jqplot, highcharts,flot
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Highstocks chart multiple pane width and y axis alignment issue
- Highstocks - Place a line between columns when using datetime axis
- Highstocks tooltip Remove the phrase "Week From Monday"
- Highstock, dynamically changing from percent stacking to normal stacking
- passing json values to highcharts from .net code behind
- change distance of x-axis labels from axis in highchart
- change distance of x-axis labels from axis in highchart
- Changing unit on y-axis from million (M) to show multimillion (MM) in HighCharts
- Is it possible to have two Y Axis in a highstock chart from highcharts one on the left and another on the right?
- how to add dynamic y axis in highchart from specific point of x-axis
- How to make data from ajax become X axis in Highchart?
- How to make data from ajax become X axis in Highchart?
- 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 we configure highchart x axis start from first tick?
- Scatter chart using HTML and Java Script (makeing y axis starting from zero (upside down) )
- Highchart : by passing FROM DATE and TO DATE x axis labels should set
- Changing the name for 'categories' of x axis while implementing crossfilter with highcharts
More Query from same tag
- Highcharts custom x-axis categories aligned center (Under the pins)
- How to produce scatterplot with a factor as y in highcharter?
- Hover effect on Inside/InnerSize of donut chart?
- Is it possible to set the tick interval's pixel width?
- How Highcharts ChartView redraw or wait for AsyncTask data in Android
- Need to remove the empty space to the left of the graph, after I moved the stocktools to the top of the graph in highstocks
- How to align category labels on xAxes in Highcharts.js
- Highchart - Use a formatter on PlotLine labels
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- VB.net 2 dimensional array with data from a list
- Highcharts : is it possible to make specific plots of a series transparent.
- Parsing json.dumps to HighCharts in Django
- Highcharts - How do I track/follow a live updated chart without using a navigator?
- Disable Plotpoint legend on hover in Highcharts
- Highchart - yAxis - 1,000 should be displayed like 1000
- Highcharts yAxis max not working
- put labels on the right of the chart area in HighCharts
- HighCharts negative color for dataLabels
- Import error, can't find file: highcharts/histogram-bellcurve
- Why does my addSeries (in highcharts) only display names of the series but not the actual pie chart itself
- How to slide highcharts?
- Highcharts pointer cursor doesn't work
- Highcharts - use same chart on multiple places
- Convert datetime to timestamp milliseconds adding +1 month
- What is highstock.js - modules- canvas-tools?
- Hichcharts - Custom legend css not getting displayed in Print Chart download functionality
- Range Selector in Are Graph of High Chart
- How to change the Highchart plotline color for theme
- Resizing HighCharts Chart Causes Changes to Max Y Value
- event.ctrlKey works in IE and Chrome but not Firefox on legendItemClick