From 4bdb7057209ef0977fd1a89bac15e0d3f1092ab4 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Thu, 26 Feb 2026 11:56:53 +0900 Subject: [PATCH] =?UTF-8?q?260226=5F05=5FENH:=20=EC=B9=B4=ED=85=8C?= =?UTF-8?q?=EA=B3=A0=EB=A6=AC=20=ED=8C=8C=ED=8A=B8=20=EC=98=B5=EC=85=98?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20ChartLegend,=20ChartTopMargin=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lge-dashboard/chart/StackBar.tsx | 2 +- .../lge-dashboard/combo/CategoryByData.tsx | 13 +++++++++++-- .../sub-page/category-page/CategoryDetail.tsx | 4 ++++ src/const/lgConst.ts | 1 + src/types/lg.ts | 9 ++++++++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/lge-dashboard/chart/StackBar.tsx b/src/components/lge-dashboard/chart/StackBar.tsx index f138058..a2b35db 100644 --- a/src/components/lge-dashboard/chart/StackBar.tsx +++ b/src/components/lge-dashboard/chart/StackBar.tsx @@ -65,7 +65,7 @@ const StackBar = ({ const option: EChartsOption = useMemo(() => { const fmt = valueFormatter ?? ((v: number) => String(v)); const isV = orientation === "vertical"; - +console.log(grid) return { color: palette, tooltip: tooltip ?? (isReverse ? createReverseTooltip(data, fmt) : createDefaultTooltip(fmt)), diff --git a/src/components/lge-dashboard/combo/CategoryByData.tsx b/src/components/lge-dashboard/combo/CategoryByData.tsx index 66498d3..7a81ee3 100644 --- a/src/components/lge-dashboard/combo/CategoryByData.tsx +++ b/src/components/lge-dashboard/combo/CategoryByData.tsx @@ -8,7 +8,7 @@ import { import BannerButtons from "@/components/lge-dashboard/BannerButtons"; import {totalFilters} from "@/config/filter.data"; import React, {useMemo, useState} from "react"; -import {BannerGroupKey, CategoryChartMode, BannerRow} from "@/types/lg"; +import {BannerGroupKey, CategoryChartMode, BannerRow, LegendOption} from "@/types/lg"; import { buildRowLabelSeriesChartData, buildYearSeriesChartData, formatRowLabel, @@ -22,6 +22,8 @@ type CategoryByDataProps = { selectedYear: string; title?: string; chartMode: CategoryChartMode; + chartLegend?: LegendOption; + chartTopMargin?: number; allTableData: BannerRow[]; fillGreaterThan5?: boolean; chartHeight?: number | string; @@ -44,6 +46,8 @@ const CategoryByData = ({ selectedYear, title, chartMode, + chartLegend, + chartTopMargin, allTableData, fillGreaterThan5, chartHeight, @@ -102,6 +106,7 @@ const CategoryByData = ({ }) , [allTableData, selectedYear]); + return (
@@ -110,11 +115,14 @@ const CategoryByData = ({
{(() => { + console.log(chartTopMargin) switch (chartMode) { case "horizontal": return ( ); diff --git a/src/components/lge-dashboard/sub-page/category-page/CategoryDetail.tsx b/src/components/lge-dashboard/sub-page/category-page/CategoryDetail.tsx index a617a6f..9b31ebb 100644 --- a/src/components/lge-dashboard/sub-page/category-page/CategoryDetail.tsx +++ b/src/components/lge-dashboard/sub-page/category-page/CategoryDetail.tsx @@ -22,6 +22,8 @@ const CategoryDetail = ({ return { title: typeof f.title === "string"? f.title : f.title[debouncedFilterValue.type.value], chartMode:f.chartMode, + chartLegend:f.chartLegend, + chartTopMargin:f.chartTopMargin, data: dataLength && dataLength > 0 ? dataMap[f.requestKeyResolved] : [] }; }); @@ -69,6 +71,8 @@ const CategoryDetail = ({ selectedYear={filterValue.year} title={tableData.title} chartMode={tableData.chartMode} + chartLegend={tableData.chartLegend} + chartTopMargin={tableData.chartTopMargin} allTableData={tableData.data} chartHeight={tableData.chartHeight} chartWidth={tableData.chartWidth} diff --git a/src/const/lgConst.ts b/src/const/lgConst.ts index a6e1230..5fbb3b8 100644 --- a/src/const/lgConst.ts +++ b/src/const/lgConst.ts @@ -290,6 +290,7 @@ export const CATEGORY_PAGE_FIELDS: Record = { title: string; chartMode: CategoryChartMode; - data: T[]; + chartLegend?: LegendOption; + chartTopMargin?:number; chartHeight?: number | string; chartWidth?: number; + data: T[]; }; +export type LegendOption = EChartsOption["legend"]; + export type CategoryFieldSpec = { title: string | Record; requestKey: string; chartMode:CategoryChartMode; + chartLegend?: LegendOption; + chartTopMargin?:number; qidByMode: Partial>; // mode별 qid (없으면 숨김/요청 제외) };