title: HighCharts arithmetic operations using array and display results in tooltip
body: <p>I'm drawing a chart data using Highcharts with no problem so far. What I'm trying to do is to use <strong><em>pointFormatter</em></strong> function to do some calculation and add that calculation value to <strong>tooltip</strong> which I did successfully like this:</p>
  
  <pre><code>// unit is string
          someFunction(unit, unitPrice moneyType) {
              tooltip: {
                          shared: true,
                          useHTML: true,
                          pointFormatter: function() { 
                              return this.series.name + ' : &lt;b&gt;' + this.y + '&lt;/b&gt; ' + unit + '&lt;br/&gt;' +
                              localize("em_consumption_comparison_report_price") + ' : &lt;b&gt;' + (this.y * unitPrice).toFixed(2) + '&lt;/b&gt; ' + moneyType + '&lt;br/&gt;&lt;br/&gt;'; 
                            } 
      }
  </code></pre>
  
  <p>Output works just fine as seen in below pic</p>
  
  <p><a href="https://i.stack.imgur.com/UmlmN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UmlmN.png" alt="enter image description here"></a></p>
  
  <p><strong>unit</strong> and <strong>moneyType</strong> was a string value and above code works. But the problem is I figure those variables <em>should be array</em>. So I try to workaround the issue and tried this : (by the way in this case unit -> kWh, moneyUnit ->TL)</p>
  
  <pre><code>// unit is ARRAY
        tooltip: {
                      shared: true,
                      useHTML: true,
                      pointFormatter: function() { 
                          for (var i = 0; i &lt; unit.length; i++) {
                              return this.series.name + ' : &lt;b&gt;' + this.y + '&lt;/b&gt; ' + unit[i] + '&lt;br/&gt;' +
                              localize("em_consumption_comparison_report_price") + ' : &lt;b&gt;' + (this.y * unitPrice).toFixed(2) + '&lt;/b&gt; ' + moneyType[i] + '&lt;br/&gt;&lt;br/&gt;';
                          }
  
                        },
      }
  </code></pre>
  
  <p>But that didn't work as seen below picture. 
  <a href="https://i.stack.imgur.com/SYlnN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SYlnN.png" alt="enter image description here"></a></p>
  
  <p>So how can I loop through <em>unit</em> array in that case? Any tips?</p>