Skip to content

Commit

Permalink
πŸ”§ fix: 차트 λ²”μœ„ λ°–μ—μ„œ ν™•λŒ€/μΆ•μ†Œκ°€ 되던 문제 ν•΄κ²°
Browse files Browse the repository at this point in the history
  • Loading branch information
dannysir committed Dec 4, 2024
1 parent c6a158e commit 1c96da8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions FE/src/components/StocksDetail/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ export default function Chart({ code }: StocksDetailChartProps) {
ref={containerRef}
className='mt-2 flex h-[200px] w-full flex-col'
onMouseMove={getCanvasMousePosition}
onWheel={handleWheel}
>
{/* Upper 차트 μ˜μ—­ */}
<div className='flex flex-row'>
<canvas ref={upperChartCanvasRef} />
<canvas ref={upperChartCanvasRef} onWheel={handleWheel} />
<canvas ref={upperChartY} />
<div className='absolute flex w-[520px] flex-col gap-1'>
<div className={'relative flex flex-row items-center gap-1'}>
Expand Down Expand Up @@ -195,7 +194,7 @@ export default function Chart({ code }: StocksDetailChartProps) {
</div>
{/* Lower 차트 μ˜μ—­ */}
<div className='flex flex-row'>
<canvas ref={lowerChartCanvasRef} />
<canvas ref={lowerChartCanvasRef} onWheel={handleWheel} />
<canvas ref={lowerChartY} />
</div>
{/* XμΆ• μ˜μ—­ */}
Expand Down
2 changes: 1 addition & 1 deletion FE/src/hooks/useMouseWheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useMouseWheel = (data: StockChartUnit[] | undefined) => {
const minDisplayData = 20;

const handleWheel = useCallback(
(e: WheelEvent<HTMLDivElement>) => {
(e: WheelEvent<HTMLCanvasElement>) => {
if (!data) return;

const wheelPower = 0.1;
Expand Down

0 comments on commit 1c96da8

Please sign in to comment.