mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
Show shared tooltip & percentage
This commit is contained in:
parent
10a1350bb3
commit
c668ed8a2b
@ -4,7 +4,24 @@ var defaultChartOptions = {
|
||||
"text": null
|
||||
},
|
||||
"tooltip": {
|
||||
valueDecimals: 2
|
||||
valueDecimals: 2,
|
||||
formatter: function () {
|
||||
var s = '<b>' + moment(this.x).format("DD/MM/YY HH:mm") + '</b>',
|
||||
pointsCount = this.points.length;
|
||||
|
||||
|
||||
$.each(this.points, function (i, point) {
|
||||
s += '<br/><span style="color:'+point.series.color+'">' + point.series.name + '</span>: ' +
|
||||
Highcharts.numberFormat(point.y);
|
||||
|
||||
if (pointsCount > 1 && point.percentage) {
|
||||
s += " (" + Highcharts.numberFormat(point.percentage) + "%)";
|
||||
}
|
||||
});
|
||||
|
||||
return s;
|
||||
},
|
||||
shared: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'datetime'
|
||||
|
Loading…
Reference in New Issue
Block a user