add a total line to the tooltip of charts with multiple values #1280

Co-authored-by: Titouan V <titouan.verhille@gmail.com>
This commit is contained in:
henrygd
2025-11-04 15:35:23 -05:00
parent d77ee5554f
commit 04b6067e64
5 changed files with 114 additions and 13 deletions

View File

@@ -139,7 +139,7 @@ export default memo(function ContainerChart({
labelFormatter={(_, data) => formatShortDate(data[0].payload.created)}
// @ts-expect-error
itemSorter={(a, b) => b.value - a.value}
content={<ChartTooltipContent filter={filter} contentFormatter={toolTipFormatter} />}
content={<ChartTooltipContent filter={filter} contentFormatter={toolTipFormatter} showTotal={true} />}
/>
{Object.keys(chartConfig).map((key) => {
const filtered = filteredKeys.has(key)