score:1
You can not use category
and datetime
axis type together, these are two mutually exclusive values. However, you can achieve the wanted result by using one of them.
For category
axis type set pointPlacement
to 'between'
and xAxis.labels.align
to 'left'
:
xAxis: {
categories: [...],
labels: {
align: 'left'
}
},
series: [{
pointPlacement: 'between',
data: [...]
}]
Live demo: https://jsfiddle.net/BlackLabel/fnsuxt90/
For datetime
axis type, you need to use x
and y
data values or set pointStart
and pointInterval
properties:
xAxis: {
type: 'datetime'
},
series: [{
pointStart: 1563040800,
pointInterval: 1000 * 60 * 30,
data: [...]
}]
Live demo: https://jsfiddle.net/BlackLabel/f1c59a0w/
API Reference:
https://api.highcharts.com/highcharts/series.line.label
https://api.highcharts.com/highcharts/series.line.pointPlacement
https://api.highcharts.com/highcharts/series.line.type
EDIT:
To split the label into two lines, inset <br>
tag to a string in labels.formatter
function:
xAxis: {
...,
labels: {
formatter: function() {
return this.value.split(' ').join('<br>')
}
}
}
Live demo: https://jsfiddle.net/BlackLabel/vgp46bhw/
Source: stackoverflow.com
Related Query
- Highcharts label format with tickPositioner in a datetime x Axis
- Format X axis Label of Highcharts
- How do I format x-axis label in highcharts
- Highcharts - Long multi-line y axis labels causing following label to be removed
- How to change axis label size when exporting in Highcharts / Highstock
- Highcharts axis label before first point
- How to set dataLabel Format and axis label angle in R highcharter package
- last label in x axis with datetime format not coming in highchart
- Making y axis of highcharts in time format hh:mm
- Highcharts show plot value on x axis label
- Highcharts x axis label text wrapping lost on setting label step
- How to position axis label in highcharts
- Axis Label Alignment in highcharts
- Highcharts Omits X Axis Label
- highcharts axis format decimal point
- Highcharts display label for pie chart using html table as data source
- Highcharts - Bar chart show full label on Y Axis
- Highcharts drilldown to pie chart - Clicking on axis label with multiple series causes pie charts to overlap
- Highcharts set X axis label on tick
- HighCharts Axis Label Encoding
- Avoid displaying y axis label and points when there is no data: HIghcharts
- Need to join x axis and y axis label highcharts
- highcharts y axis label with offset is hidden when chart has no title
- Highcharts repeating same label value on Y Axis
- Highcharts export customize axis label and fontsize: No effect after migration
- Change X axis label on Drill Down using HighCharts
- Highcharts - Format X axis with 2 digit hours in 24 hour format
- How to show first and last label of x axis Highcharts
- X axis label in Highcharts graph in Django app
- Value or Logic Dependent Data Label format in Highcharts
More Query from same tag
- Highstock From/To Invalid Date Issue
- Rsquare best fit line in actual and precited scatter plot with d3.js/chart.js/highcharts
- Highcharts add legend on export
- Highcharts areaspline, not getting the default color for chart
- path issue of package.json during build
- setting highcharts title in a modal
- HighCharts - Pie chart drilldown for multilevel (3 to 4 level)
- Relative percentage height not showing properly
- selectInput variable to influence chart output - group argument? Preferably using highcharter output [Shiny app]
- how to stop ajax call in live highcharts when no new data
- In Highcharts after zoom in and zoom out some of the x-axis values are not display
- Convert group json for Highcharts Donut chart
- In a Highcharts Stacked Area chart, is there a way of highlighting the area hovered over, rather than the area belonging to the nearest point?
- Disabling inactive state in Highcharts styled mode
- How to convert a JavaScript object to array
- Highcharts showing nearest point causes flickering crosshair and strange order
- Load Highchart animation on scroll
- Highcharts dont display statistics with MySQL Query
- Which controller to use for Health Index Monitoring
- How to combine Bar chart and data as table in High Charts
- Highcharts too slow when plotting 4000 bars (rCharts)
- How to display Html Entities in High Charts labels
- How can I sort the stacked bar charts in Highcharts by the sum of positive response?
- Error: <rect> attribute width: Expected length, "NaN" in highcharts
- How to add new chart(any charts, highcharts or d3 charts) in Serenity admin dashboard
- Dynamic button background change
- Highchart reloading upon call issue - javascript
- Add custom logo to Highchart graphs
- Higstock add all series dynamically
- using flask render_template to make a highchart on the front end