diff --git a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx index 4b7825a..6c60e64 100644 --- a/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx +++ b/src/app/(pages)/(main)/dashboard/[waveCd]/[partCd]/page.tsx @@ -11,10 +11,11 @@ import { Button } from "@/components/ui/button"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { CHART_BAR_MAX_WIDTH, + CHART_FONT_DEFAULT, CHART_FONT_SIZE, CHART_GAP_MARKER_BG_COLOR, CHART_GAP_MARKER_TEXT_COLOR, - CHART_HEIGHT, + CHART_HEIGHT, CHART_LEGEND_FONT_SIZE, SUBITEM_NEGATIVE_COLOR, } from "@/const/epolicy-dash.const"; import { cn } from "@/lib/utils"; @@ -167,7 +168,7 @@ function ResultGroupChart({ group, item }: { group: ResultGroup; item: Item }) { label: { show: true, position: "top", - fontSize: CHART_FONT_SIZE, + ...CHART_FONT_DEFAULT, formatter: (params: { value: number }) => formatDecimal1(params.value), }, ...(gapPoints.length @@ -186,7 +187,7 @@ function ResultGroupChart({ group, item }: { group: ResultGroup; item: Item }) { borderRadius: 20, padding: [10, 10, 7, 10], fontWeight: "bold", - fontSize: CHART_FONT_SIZE, + ...CHART_FONT_DEFAULT, formatter: ({ value }: { value: number }) => `${value >= 0 ? "▲" : "▼"} ${formatDecimal1(Math.abs(value))}%p`, }, @@ -201,18 +202,18 @@ function ResultGroupChart({ group, item }: { group: ResultGroup; item: Item }) { }, }; })} - legend={{ right: 0, top: 0, textStyle: { fontSize: CHART_FONT_SIZE } }} + legend={{ right: 0, top: 0, textStyle: { fontSize: CHART_LEGEND_FONT_SIZE } }} grid={{ top: 85, right: 25, bottom: 5, left: 0, containLabel: true }} xAxis={{ axisLabel: { - fontSize: CHART_FONT_SIZE, + ...CHART_FONT_DEFAULT, interval: 0, ...(axisLabelWidth ? { formatter: (value: string) => wrapLabelByWord(value, axisLabelWidth, CHART_FONT_SIZE) } : {}), }, }} - yAxis={{ min: 0, max: 100, interval: 25, axisLabel: { fontSize: CHART_FONT_SIZE } }} + yAxis={{ min: 0, max: 100, interval: 25, axisLabel: { show: false } }} barMaxWidth={CHART_BAR_MAX_WIDTH} height={CHART_HEIGHT} /> @@ -271,7 +272,7 @@ function ItemCard({ item }: { item: Item }) { return (
-

{item.title}

+

{item.title}

-

{survey.title}

+

{survey.title}

{survey.items.map((item) => (
diff --git a/src/const/epolicy-dash.const.ts b/src/const/epolicy-dash.const.ts index 428fdb7..3591a13 100644 --- a/src/const/epolicy-dash.const.ts +++ b/src/const/epolicy-dash.const.ts @@ -7,6 +7,16 @@ export const SCROLL_SPY_BOTTOM_TOLERANCE = 8; // Part 상세 차트 렌더링 설정. dashboard/[waveCd]/[partCd]/page.tsx에서 사용. export const CHART_FONT_SIZE = 16; +export const CHART_LEGEND_FONT_SIZE = 14; +// echarts는 canvas 렌더러라 font-family에 CSS var()를 못 쓴다(셔다워 값을 요소 cascade 없이 자체 파싱해서 +// var()가 그대로 무시됨). 본문(html)에 적용되는 --default-font-family(Tailwind 기본 --font-sans)를 +// 리터럴로 그대로 옮겨왔다 — globals.css에서 --font-sans를 바꾸면 이 값도 함께 갱신해야 한다. +export const CHART_FONT_FAMILY = + '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'; +export const CHART_FONT_DEFAULT = { + fontSize: CHART_FONT_SIZE, + fontFamily: CHART_FONT_FAMILY, +}; export const CHART_BAR_MAX_WIDTH = 100; export const CHART_HEIGHT = 320;