JavaScript
const alternateSeriesIndex = [1, 0];
Highcharts.chart('container', {
chart: {
type: 'column',
marginLeft: 0,
marginRight: 20,
},
title: {
text: 'yAxis.title.offset is set to zero'
},
xAxis: {
maxPadding: 0.5,
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
reserveSpace: true,
opposite: true,
lineWidth: 1,
tickWidth: 1,
title: {
align: 'high',
offset: 0,
text: 'EPS',
rotation: 0,
y: -10,
x: -50,
useHTM: true,
},
labels: {
useHTML: true,
align: 'right',
y: -5,
/* x: -5, */
/* reserveSpace: true,
offset: 0 */
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], },
{
data: [30, 72, 106.3, 128, 145, 176.6, 135.8, 149, 220, 195, 97, 55], }],
plotOptions: {
column: {
point: {
events: {
mouseOver: ({target}) => {
const {index: pointIndex, series} = target;
const {chart, index: seriesIndex} = series;
const otherSeriesIndex = alternateSeriesIndex[seriesIndex];
const otherSeries = chart.series[otherSeriesIndex];
const otherPoint = otherSeries.points[pointIndex];
otherPoint.setState('hover');
console.log(target);
},
mouseOut: ({target}) => {
const {index: pointIndex, series} = target;
const {chart, index: seriesIndex} = series;
const otherSeriesIndex = alternateSeriesIndex[seriesIndex];
const otherSeries = chart.series[otherSeriesIndex];
const otherPoint = otherSeries.points[pointIndex];
otherPoint.setState('mouseOut');
}
...