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
- High Chart Async drilldown
- How to give proper number denominations in highcharts buuble chart
- Highchart, how to vertically align in the middle a line?
- How to insert annotation with auto y value
- highstock -- navigator time range does not update after adding/removing series
- Remove Highcharts dataLabel border
- Highcharts boxplot line rendering issues: is there a solution?
- How to set second yAxis scale according to data from first yAxis
- Change Datalabel Color, Rotation and Align values based on Column value in highcharts
- How to get a Highchart to appear in HTML pages?
- angular2-highcharts Highcharts exporting module
- npm throws this error '"**/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDef'
- Searching large (6 million) rows MySQL with stored queries?
- Use value from prompt as highcharts export file name
- Highmaps hover effect/mouseout color change
- HighChart And R weird Column chart breaks
- highcharts-export-server always produces blank PNG
- Meteor: Reusing a Template With a Chart-Div
- Preserve time spacing ratio of gaps in Highstock charts
- Highcharts: Nothing change happens whatever I setting formatter:function() or set tooltip{enabled:false}
- Highcharts Stacked Bar: How to remove spacing between bars
- Unknown date format in Api
- Highcharts Polar charts display labels on specific tick quarters
- highcharts tooltip not moving next point
- How to overcome missing values in Highstock-Stockchart?
- highcharts stacked area with irregular x-intervals
- Highcharts - load and refresh csv
- Highcharts rangeSelector for multiple charts
- How to create PIE chart with slice inside outer circle
- addpoint is not adding point in highcharts ,where data is updated dynamically with ajax