mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
add chart tab to insights & explore page
This commit is contained in:
@@ -31,6 +31,7 @@ export interface CommonPieChartProps {
|
||||
colorField?: string;
|
||||
hiddenField?: string;
|
||||
minValidPercent?: number;
|
||||
amountValue?: boolean;
|
||||
defaultCurrency?: string;
|
||||
showValue?: boolean;
|
||||
showPercent?: boolean;
|
||||
@@ -74,7 +75,7 @@ export function usePieChartBase(props: CommonPieChartProps) {
|
||||
};
|
||||
|
||||
finalItem.displayPercent = formatPercentToLocalizedNumerals(finalItem.percent, 2, '<0.01');
|
||||
finalItem.displayValue = formatAmountToLocalizedNumeralsWithCurrency(finalItem.value, props.defaultCurrency);
|
||||
finalItem.displayValue = props.amountValue ? formatAmountToLocalizedNumeralsWithCurrency(finalItem.value, props.defaultCurrency) : finalItem.value.toString();
|
||||
|
||||
validItems.push(finalItem);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ const props = defineProps<{
|
||||
colorField?: string;
|
||||
hiddenField?: string;
|
||||
minValidPercent?: number;
|
||||
amountValue?: boolean;
|
||||
defaultCurrency?: string;
|
||||
showValue?: boolean;
|
||||
showPercent?: boolean;
|
||||
@@ -81,7 +82,7 @@ const radarData = computed<RadarChartData>(() => {
|
||||
|
||||
const finalPercent = (isNumber(percent) && percent >= 0) ? percent : (value / totalValidValue * 100);
|
||||
const displayPercent = formatPercentToLocalizedNumerals(finalPercent, 2, '<0.01');
|
||||
const displayValue = formatAmountToLocalizedNumeralsWithCurrency(value, props.defaultCurrency);
|
||||
const displayValue = props.amountValue ? formatAmountToLocalizedNumeralsWithCurrency(value, props.defaultCurrency) : value.toString();
|
||||
|
||||
indicators.push({
|
||||
name: name,
|
||||
|
||||
Reference in New Issue
Block a user