Reputation: 13487
Please consider this code:
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},
When xAxis category is numeric (years) data labels align with xAxis tick, but when I change categories and set the to some string, data labels align in the middle of xAxis ticks.
categories:["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh"]
How I can align values on exact top of the xAxis ticks?
Thanks
Upvotes: 1
Views: 197
Reputation: 20536
You can use the tickmarkPlacement: 'on'
(API) setting to correct this. API-description:
For categorized axes only. If
on
the tick mark is placed in the center of the category, ifbetween
the tick mark is placed between categories. The default isbetween
if thetickInterval
is 1, elseon
.
For example:
xAxis: {
categories:["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh"],
tickmarkPlacement: 'on'
}
See this JSFiddle demonstration of it in use.
Upvotes: 1