Chartjs v2 - format tooltip for multiple data sets (bar and line) : <p>Reading up a lot on how to format the tooltip in ChartJS v2.x utilizing the tooltip callback. I've had success thus far, but find that I'm unable to define two separate formats for the two data sets I have.</p>

<p>As a bit more context, I have a line chart overlayed on top of a bar chart:</p>

<ul>
<li>My bar data is numerical (in the millions, and needs to be rounded and truncated). </li>
<li>Example: <b>22345343</b> needs to be shown as <b>22M</b> in the tooltip</li>
</ul>

<hr>

<ul>
<li>My line data is a currency</li>
<li>Example: <b>146.36534</b> needs to shown as <b>$146.37</b> in the tooptip</li>
</ul>

<hr>

<p>Here's my short WIP code thus far. This formats the tooltip to round and include the $ sign.  How can I expand this so that I can separately format my bar data correctly in the tooltip?</p>

<hr>

<pre><code>tooltips: {
                mode: 'index',
                intersect: false,
                callbacks: {
                    label: function(tooltipItem, data) {
                        return "$" + Number(tooltipItem.yLabel).toFixed(2).replace(/./g, function(c, i, a) {
                                    return i &gt; 0 &amp;&amp; c !== "." &amp;&amp; (a.length - i) % 3 === 0 ? "," + c : c;
                                });
                    }
                }
            }
</code></pre>
