Skip to content

Commit

Permalink
[#11982] Math.round to long maxValue
Browse files Browse the repository at this point in the history
  • Loading branch information
jihea-park committed Jan 23, 2025
1 parent ccae72c commit d6cbe0c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const summaryColumns = ({
accessorKey: 'chart',
header: 'Volume',
meta: {
headerClassName: 'w-40 text-sm font-medium text-center',
headerClassName: 'w-52 text-sm font-medium text-center',
cellClassName: 'text-[-webkit-right]',
},
cell: (props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
import { Chart } from '@pinpoint-fe/ui/constants';
import { ComposedChart, ReferenceLine } from 'recharts';
import { useRechart } from '../ReChart/useRechart';
import { ChartContainer } from '../ui';

export interface MiniChart {
chart: Chart;
}

export const MiniChart = ({ chart }: MiniChart) => {
const { data, maxValue, renderChartChildComponents } = useRechart(chart);
const { data, chartConfig, maxValue, renderChartChildComponents } = useRechart(chart);

return (
<ComposedChart
width={128}
height={40}
data={data}
margin={{
top: 6,
right: 30,
bottom: 6,
left: 2,
}}
>
{data?.length && maxValue > -1 && (
<ReferenceLine
y={maxValue}
stroke="black"
strokeDasharray="3 3"
position="middle"
label={{ position: 'right', value: maxValue }}
ifOverflow="extendDomain"
/>
)}
{renderChartChildComponents()}
</ComposedChart>
<ChartContainer config={chartConfig} className="w-full h-[40px]">
<ComposedChart
data={data}
margin={{
top: 6,
right: 60,
bottom: 6,
left: 2,
}}
>
{data?.length && maxValue > -1 && (
<ReferenceLine
y={maxValue}
stroke="black"
strokeDasharray="3 3"
position="middle"
label={{ position: 'right', value: Math.round(maxValue * 100) / 100 }}
ifOverflow="extendDomain"
/>
)}
{renderChartChildComponents()}
</ComposedChart>
</ChartContainer>
);
};

0 comments on commit d6cbe0c

Please sign in to comment.