title: Highcharts: display peak values
body: <p>I would like to display difference between 2 points on my Highcharts graph. Only when it's a major "peak" difference.</p>
  
  <p>Here's a "static" example :</p>
  
  <p><img src="https://i.stack.imgur.com/wUFVd.jpg" alt="enter image description here"></p>
  
  <pre><code>$(function () {
      $('#container').highcharts({
          chart: {
              type: 'areaspline'
          },
          series: [{
              data:   [560,500,476,453,356,{
                          y: 590,
                          dataLabels: {
                              enabled: true,
                              formatter: function () {return '+243';}
                          } 
                      },497,478,465,465,465,410,398]
          }]
      });
  });  
  </code></pre>
  
  <p><a href="http://jsfiddle.net/vr1a61wy/" rel="nofollow noreferrer">http://jsfiddle.net/vr1a61wy/</a></p>
  
  <p>How can I compare all point values with the previous ?</p>
  
  <p>For example, something like that (not "real code)</p>
  
  <pre><code>if(prevValue &gt; 200) {
    displayDataLabel();
  }
  function displayDataLabel() {
     peak = this.datalabel - prev.datalabel;
     return peak;
  }
  </code></pre>
  
  <p>The goal is to have a clean json file only with values and peaks calculated by javascript.</p>
  
  <p>Is it possible ?</p>