diff --git a/FE/src/page/Rank.tsx b/FE/src/page/Rank.tsx
index 4406032d..6c13c715 100644
--- a/FE/src/page/Rank.tsx
+++ b/FE/src/page/Rank.tsx
@@ -1,7 +1,26 @@
+import Nav from 'components/Rank/Nav.tsx';
+import RankList from '../components/Rank/RankList.tsx';
+import { dummyRankData } from '../components/Rank/bummyData.ts';
+
export default function Rank() {
+ // const { data, isLoading } = useQuery({
+ // queryKey: ['Rank'],
+ // queryFn: () => getRanking(),
+ // });
+ //
+ // if (isLoading) return
Loading...
-
Ranking
+
);
}
diff --git a/FE/src/service/getRanking.ts b/FE/src/service/getRanking.ts
new file mode 100644
index 00000000..2c5221d9
--- /dev/null
+++ b/FE/src/service/getRanking.ts
@@ -0,0 +1,7 @@
+export const getRanking = async () => {
+ const response = await fetch(`${import.meta.env.VITE_API_URL}/ranking`);
+ if (!response.ok) {
+ throw new Error('Network response was not ok');
+ }
+ return response.json();
+};
diff --git a/FE/src/utils/chart/drawMouseGrid.ts b/FE/src/utils/chart/drawMouseGrid.ts
new file mode 100644
index 00000000..01d55441
--- /dev/null
+++ b/FE/src/utils/chart/drawMouseGrid.ts
@@ -0,0 +1,81 @@
+import { Padding } from 'types.ts';
+import { MousePositionType } from 'components/StocksDetail/Chart.tsx';
+
+export const drawMouseGrid = (
+ upperChartCtx: CanvasRenderingContext2D,
+ upperChartWidth: number,
+ upperChartHeight: number,
+ lowerChartCtx: CanvasRenderingContext2D,
+ lowerChartWidth: number,
+ lowerChartHeight: number,
+ padding: Padding,
+ mousePosition: MousePositionType,
+) => {
+ if (
+ mousePosition.x > 0 &&
+ mousePosition.x < upperChartWidth + padding.left + padding.right
+ ) {
+ upperChartCtx.beginPath();
+ upperChartCtx.setLineDash([10, 10]);
+ upperChartCtx.moveTo(mousePosition.x, padding.top);
+ upperChartCtx.lineTo(
+ mousePosition.x,
+ padding.top + upperChartHeight + padding.bottom,
+ );
+
+ upperChartCtx.strokeStyle = '#6E8091';
+ upperChartCtx.lineWidth = 1;
+ upperChartCtx.stroke();
+
+ lowerChartCtx.beginPath();
+ lowerChartCtx.setLineDash([10, 10]);
+ lowerChartCtx.moveTo(mousePosition.x, 0);
+ lowerChartCtx.lineTo(mousePosition.x, upperChartHeight + padding.bottom);
+
+ lowerChartCtx.strokeStyle = '#6E8091';
+ lowerChartCtx.lineWidth = 1;
+ lowerChartCtx.stroke();
+ }
+
+ if (
+ mousePosition.y > 0 &&
+ mousePosition.y < upperChartHeight + padding.top + padding.bottom
+ ) {
+ upperChartCtx.beginPath();
+ upperChartCtx.moveTo(0, mousePosition.y);
+ upperChartCtx.lineTo(
+ upperChartWidth + padding.left + padding.right,
+ mousePosition.y,
+ );
+
+ upperChartCtx.strokeStyle = '#6E8091';
+ upperChartCtx.lineWidth = 1;
+ upperChartCtx.stroke();
+ }
+
+ if (
+ mousePosition.y > upperChartHeight + padding.top + padding.bottom &&
+ mousePosition.y <
+ upperChartHeight +
+ padding.top +
+ padding.bottom +
+ lowerChartHeight +
+ padding.top +
+ padding.bottom
+ ) {
+ lowerChartCtx.beginPath();
+ lowerChartCtx.moveTo(
+ 0,
+ mousePosition.y - (upperChartHeight + padding.top + padding.bottom),
+ );
+ lowerChartCtx.lineTo(
+ lowerChartWidth + padding.left + padding.right,
+ mousePosition.y -
+ (upperChartHeight + padding.top + padding.bottom + padding.bottom),
+ );
+
+ lowerChartCtx.strokeStyle = '#6E8091';
+ lowerChartCtx.lineWidth = 1;
+ lowerChartCtx.stroke();
+ }
+};