MultiTooltip Equivalent in 2.0

Hi,
I have a question about this tooltiptemplate
Before, in version 1.0, i’ve used to set multiTooltipTemplate though, does this functionnality still exist ?
Because, when I use this solution, I haven’t all the values in the tooltip. Anybody has a Clue ?

exemple :

Chart.defaults.global.responsive = true;

var dataMainMasterContainer_ContractMasterContainer_ChartJsStackBar1 = {
labels : ["26/04/2013","31/08/2013","31/12/2013","30/04/2014","18/12/2014","31/12/2014","30/04/2015","31/08/2015","31/12/2015"],
datasets: [{label:"Dédié",type: "bar",fillColor: "#a99d75",strokeColor: "#a99d75",highlightFill: "#978A5E",highlightStroke: "#978A5E", data: [0,0,0,0,300000,299930.92445703,308324.61999999,298776.5799,297132.82344081]
},
{label:"Versements - Retraits",type: "line",fillColor: "#000000",strokeColor: "#000000", data: [0,0,0,0,300000,300000,300000,300000,300000]
}
]};

var optionMainMasterContainer_ContractMasterContainer_ChartJsStackBar1 = { 
scaleLineColor : "black"
,scaleFontColor : "black"
,scaleShowGridLines : false
,tooltipFontColor : "#fff"
,tooltipCornerRadius : 0
,scaleBeginAtZero : true
,scaleGridLineColor : "rgba(0,0,0,.05)"
,scaleGridLineWidth : 1
,scaleShowHorizontalLines : true
,scaleShowVerticalLines : true
,legendTemplate : "<ul class='<%%=name.toLowerCase()%%>-legend'><%% for (var i=0; i<datasets.length; i++){%%><li><span style='background-color:<%%=datasets[i].strokeColor%%>'><%%if(datasets[i].label){%%><%%=datasets[i].label%%><%%}%%></span></li><%%}%%></ul>"
,tooltipHideZero : false
,sortLabels : true
,reverseLabels : false
,barShowStroke : true
,barStrokeWidth : 0
,barValueSpacing : 20
,relativeBars : false
,pointDot : false
,datasetFill : false
,bezierCurve : false
,scaleSteps : 1
,responsive : true
,maintainAspectRatio : true
,overlayBars : true
,scaleLabel : "<%%= number_format(numberCurrency(value),retr_dec(value),',','.')%%> EUR"
,multiTooltipTemplate : "<%%=datasetLabel%%>#<%%= value_format(value,0) %%> EUR#<%%=label%%>"
,tooltipTemplate : "<%%=datasetLabel%%>#<%%= value_format(value,0) %%> EUR#<%%=label%%>"
 };
var myChart = new Chart(document.getElementById("MainMasterContainer_ContractMasterContainer_ChartJsStackBar1").getContext("2d")).Overlay(dataMainMasterContainer_ContractMasterContainer_ChartJsStackBar1, optionMainMasterContainer_ContractMasterContainer_ChartJsStackBar1);

capture

Author: Fantashit

1 thought on “MultiTooltip Equivalent in 2.0

  1. @Minifish57 to enable multitooltip mode you can add the following snippet to your config

    {
      tooltips: {
        mode: 'label',
        callbacks: {
          label: function(tooltipItem) { /* called for each label item. return a string here that you want displayed */
        }
      }
    }

Comments are closed.