mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 09:54:17 +08:00
FEATURE: add total on stacked-chart tooltip (#6917)
This commit is contained in:
parent
4dee7ed6d9
commit
b1b27d9f7b
|
@ -76,6 +76,13 @@ export default Ember.Component.extend({
|
|||
mode: "index",
|
||||
intersect: false,
|
||||
callbacks: {
|
||||
beforeFooter: tooltipItem => {
|
||||
let total = 0;
|
||||
tooltipItem.forEach(
|
||||
item => (total += parseInt(item.yLabel || 0, 10))
|
||||
);
|
||||
return `= ${total}`;
|
||||
},
|
||||
title: tooltipItem =>
|
||||
moment(tooltipItem[0].xLabel, "YYYY-MM-DD").format("LL")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user