score:0
Simple year-month-day format:
format: '{value:%Y-%m-%e}'
score:2
You can try this also -
- {value:%Y-%b-%e %l:%M %p }
labels: { format: '{value:%Y-%b-%e %l:%M %p }' },
Output- 2017-Apr-27 8:49 PM
- format: '{value:%Y-%b-%e %l:%M}'
labels: { format: '{value:%Y-%b-%e %l:%M %p }' },
Output- 2017-Apr-27 8:49
- format: '{value:%Y-%b-%e}'
labels: { format: '{value:%Y-%b-%e}' },
Output - 2017-Apr-27
- format: '{value:%Y-%b-%e %H:%M}'
labels: { format: '{value:%Y-%b-%e %H:%M}' },
output 2017-Apr-27 20:49
score:6
You can try format date with
xAxis: {
labels: {
formatter: function(){
return moment(new Date(this.value)).format('DD'); // example for moment.js date library
//return this.value;
},
},
Also you can check documentation http://api.highcharts.com/highcharts/xAxis.labels.formatter
score:16
axis.dateTimeLabelFormats works a little bit different. In the first place, Highcharts tries to guess what is 'the best unit' of your data and, e.g. if it is a day, it will format it according to day property from dateTimeLabelFormats.
If you want to just format axis labels, you can use axis.labels.format and specify a format like this:
xAxis: {
type: 'datetime',
labels: {
format: '{value:%Y-%b-%e}'
},
example: https://jsfiddle.net/dLfv2sbd/1/
Source: stackoverflow.com
Related Query
- HighCharts show datetime format on xAxis
- customize highcharts tooltip to show datetime
- Highcharts, Show specific tick on a datetime xaxis type
- Highcharts - remove times between dates on a datetime xaxis type
- HighCharts - show last labels in xAxis
- Highcharts - show every month on datetime x-axis when the parent container is small
- Highcharts label format with tickPositioner in a datetime x Axis
- Wrong alignment in highcharts datetime points with xaxis
- How to show only specific x-axis values on datetime axis in Highcharts
- Show only first and last xAxis label in Highcharts
- HighCharts datetime xAxis without missing values (weekends)
- Format Highcharts xAxis for stock data
- How to format datetime for (x,y) pair data for Highcharts
- How To Show All Data Labels For Datetime Axis In Highcharts
- Dynamically change datetime format of xAxis Tick Label in highchart
- How to Display Month and Year in xAxis of Highcharts datetime graph
- How to show xAxis label in tooltip in a Highcharts area chart?
- highcharts xaxis datetime label with minor tick
- Convert javascript datetime object to the format acceptable by highcharts Date.UTC(2014, 0, 2)
- format Xaxis timedate in highcharts
- HighCharts - show xaxis titles
- Highcharts - Xaxis should show only days and month, hide milliseconds
- Highcharts xAxis datetime from start
- pointPlacement in Highcharts Heatmap with datetime xAxis
- Highcharts datetime format y-axis interval
- HighCharts - timeseries chart - irregular datetime interval on xAxis
- Highcharts - show only years in xAxis
- Tooltip in Highcharts doesn't show the right format for Date
- How to format the xAxis of Highcharts
- Highcharts xAxis doesn't get the right time format
More Query from same tag
- Motion Bubble Chart
- Highcharts: Multiple Columnrange with point inside of each of them
- How to bind data in SQL Server to Highcharts?
- Highmaps choropleth showing unique color/ Highmap not seeing the value field in the data
- Highchart - Changing label text of the yaxis programatically
- Highcharts linked views
- Change chart property with onClick event
- reverse functionality of highcharts legend
- highcharts with year selector
- How to add texts to a graph in Highcharts
- Highcharts - chartanimation step by step
- Series overlap in Highcharts
- Update Series Array on HighChart after editing chart
- Higmaps doesn't display states of certain country
- Set a minimal default range for a column chart in Highcharts
- how to implement polling in below mentioned code. I want to poll data every 60 sec from the specified url. how can i do it?
- Issue on Highchaert Fill Opacity and Legend Color on Spiderweb
- Display data label always on first visible point
- Highchart StockChart - Update last point value
- Highchart Gantt chart Navigator color
- Highcharts responsive ignored on first render
- Disabling highcharts stacked bar's highlight
- Can't set title of highchart through @input
- Highcharts formatting: labels, datapoints and scale?
- Highchart yAxis plotLines label position
- How do I disable interaction on a Highcharts chart?
- HighChart - Can draw line between Title and SubTitle
- rCharts : Highcharts column with color based on value
- highcharts not displaying graph
- Display the value of plotband border in the highcharts