diff --git a/src/frontend/src/components/charts/tooltipFormatter.tsx b/src/frontend/src/components/charts/tooltipFormatter.tsx new file mode 100644 index 0000000000..73b3b97703 --- /dev/null +++ b/src/frontend/src/components/charts/tooltipFormatter.tsx @@ -0,0 +1,9 @@ +import { formatCurrency } from '../../defaults/formatters'; + +export function tooltipFormatter(label: any, currency: string) { + return ( + formatCurrency(label, { + currency: currency + })?.toString() ?? '' + ); +} diff --git a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx index e6ea6ba6d4..b8228b0334 100644 --- a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx @@ -21,6 +21,7 @@ import { } from 'recharts'; import { CHART_COLORS } from '../../../components/charts/colors'; +import { tooltipFormatter } from '../../../components/charts/tooltipFormatter'; import { formatCurrency, formatDecimal, @@ -68,7 +69,9 @@ function BomPieChart({ data, currency }: { data: any[]; currency: string }) { /> ))} - + tooltipFormatter(label, currency)} + /> ); @@ -87,7 +90,9 @@ function BomBarChart({ data, currency }: { data: any[]; currency: string }) { })?.toString() ?? '' } /> - + tooltipFormatter(label, currency)} + /> - + + tooltipFormatter(label, currency) + } + /> - + + tooltipFormatter(label, pricing?.currency) + } + /> - + tooltipFormatter(label, currency)} + /> - + tooltipFormatter(label, currency)} + /> - + tooltipFormatter(label, currency)} + /> - + + tooltipFormatter(label, pricing?.currency) + } + />