Tooltip under transform scale

by kzoon

HTML

<script src="https://github.highcharts.com/master/highcharts.js"></script>

<div style="transform: scale(0.7);">
  <div id="container"></div>
</div>

JavaScript

(function(H) {
  H.wrap(H.Pointer.prototype, 'normalize', function(proceed, e) {
    var e = proceed.call(this, e);

    e.chartX /= this.chart.options.chart.scale;
    e.chartY /= this.chart.options.chart.scale;

    return e;
  });
}(Highcharts));

Highcharts.chart('container', {
  chart: {
    scale: 0.7
  },
  tooltip: {
    outside: true
  },
  series: [{
      data: [1, 4, 3, 5, 6, 7, 4, 3, 5, 2, 3, 4, 6, 5, 4],
      type: 'line',
    },
    {
      data: [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
      type: 'column'
    }
  ]
});