title: Highcharts tooltip get position and change class
body: <p>I have a custom tooltip that I have styled using HTML and headerFormat etc, like so:</p>
  
  <pre><code>tooltip: {
              useHTML: true,
              valueDecimals: 2,
              backgroundColor: 'none',
              borderColor: '#c0c0c0',
              borderRadius: 0,
              borderWidth: 0,
              xDateFormat: '%d %b %y',
              headerFormat: '&lt;div class="chart-tooltip"&gt;&lt;span class="tooltip-header"&gt;{point.key}&lt;/span&gt;&lt;br&gt;&lt;div class="markers"&gt;&lt;span class="tooltip-bg"&gt;&lt;/span&gt;',
              pointFormat: '&lt;span class="tooltip-marker" style="background: {series.color};"&gt;&lt;/span&gt;' +
                  '&lt;span class="tooltip-series" style="color: {series.color};"&gt;{point.y}&lt;/span&gt;&lt;br&gt;',
              footerFormat: '&lt;/div&gt;&lt;/div&gt;',
              animation: false,
              shadow: false,
              style: {
                  padding: '0px'
              }
          }
  </code></pre>
  
  <p>Using the classes I have then styled the tooltip with my external CSS file. This works well except for one problem, the tooltip looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/vi1y3.png" alt="enter image description here"> So the problem is when the crosshair is over to the left of the chart, the tooltip goes over to the right and the arrow is on the wrong side.</p>
  
  <p><img src="https://i.stack.imgur.com/bLEIW.png" alt="enter image description here"></p>
  
  <p>Is it possible to know when the tooltip changes sides, and then add a class accordingly? So I can then adjust the styles.</p>
  
  <p>Any help would be great, thanks.</p>