mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix(图表): 修复堆叠柱状图无法显示总计的问题
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
TOOLTIP_ITEM_TPL,
|
||||
TOOLTIP_TITLE_TPL
|
||||
} from '@/views/chart/components/js/panel/common/common_antv'
|
||||
import { defaultsDeep, isEmpty } from 'lodash-es'
|
||||
import { isEmpty } from 'lodash-es'
|
||||
|
||||
/**
|
||||
* 堆叠柱状图
|
||||
@@ -74,7 +74,7 @@ export class StackBar extends Bar {
|
||||
|
||||
if (labelAttr.showTotal) {
|
||||
const formatterCfg = labelAttr.labelFormatter ?? formatterItem
|
||||
const groupedData = groupBy(children[0].data.value, 'field')
|
||||
const groupedData = groupBy(options.data, 'field')
|
||||
for (const [key, values] of Object.entries(groupedData)) {
|
||||
const total = values.reduce((a, b) => a + b.value, 0)
|
||||
const value = valueFormatter(total, formatterCfg)
|
||||
|
||||
Reference in New Issue
Block a user