260202_01_ENH: route 구조 초창기 기획으로 다시 변경 및 Category 별 하위 페이지에 샘플 데이터 모두 적용
This commit is contained in:
@@ -14,6 +14,7 @@ import { GroupedStackBarData, ShowLabel} from "../types";
|
||||
import { buildLgPalette } from "@/components/lge-dashboard/color";
|
||||
import {getIsShowLabel, roundedRectIcon} from "@/components/lge-dashboard/chart/utill";
|
||||
import {AXIS_HIDE_STYLE} from "@/const/lgConst";
|
||||
import { CHART_HEIGHTS, LEGEND_ITEM_SIZE } from "@/const/chartConst";
|
||||
|
||||
type Props = {
|
||||
data: GroupedStackBarData;
|
||||
@@ -33,7 +34,7 @@ type Props = {
|
||||
|
||||
const GroupedStackBar = ({
|
||||
data,
|
||||
height = 260,
|
||||
height = CHART_HEIGHTS.DEFAULT,
|
||||
tooltip,
|
||||
grid,
|
||||
xAxis,
|
||||
@@ -133,10 +134,6 @@ const GroupedStackBar = ({
|
||||
}
|
||||
}
|
||||
|
||||
const YEAR_ITEM_W = 25;
|
||||
const YEAR_ITEM_H = 14;
|
||||
const YEAR_RADIUS = 4;
|
||||
|
||||
// 3) legend 2개: (좌)연도, (우)브랜드
|
||||
let yearLegendOpt: LegendComponentOption | undefined = showYearLegend
|
||||
? ({
|
||||
@@ -145,9 +142,9 @@ const GroupedStackBar = ({
|
||||
orient: "horizontal",
|
||||
data: yearLabels, // yearLegendSeries name과 일치
|
||||
selected: yearSelected,
|
||||
icon: roundedRectIcon(YEAR_ITEM_W, YEAR_ITEM_H, YEAR_RADIUS),
|
||||
itemWidth: YEAR_ITEM_W,
|
||||
itemHeight: YEAR_ITEM_H,
|
||||
icon: roundedRectIcon(LEGEND_ITEM_SIZE.WIDTH, LEGEND_ITEM_SIZE.HEIGHT, LEGEND_ITEM_SIZE.RADIUS),
|
||||
itemWidth: LEGEND_ITEM_SIZE.WIDTH,
|
||||
itemHeight: LEGEND_ITEM_SIZE.HEIGHT,
|
||||
itemGap: 8,
|
||||
...legend,
|
||||
} as LegendComponentOption)
|
||||
@@ -161,12 +158,12 @@ const GroupedStackBar = ({
|
||||
top: 25,
|
||||
right: "center",
|
||||
orient: "horizontal",
|
||||
data: brands,
|
||||
icon: roundedRectIcon(YEAR_ITEM_W, YEAR_ITEM_H, YEAR_RADIUS),
|
||||
itemWidth: YEAR_ITEM_W,
|
||||
itemHeight: YEAR_ITEM_H,
|
||||
icon: roundedRectIcon(LEGEND_ITEM_SIZE.WIDTH, LEGEND_ITEM_SIZE.HEIGHT, LEGEND_ITEM_SIZE.RADIUS),
|
||||
itemWidth: LEGEND_ITEM_SIZE.WIDTH,
|
||||
itemHeight: LEGEND_ITEM_SIZE.HEIGHT,
|
||||
itemGap: 8,
|
||||
...legend,
|
||||
data: [...brands].reverse(),
|
||||
} as LegendComponentOption);
|
||||
|
||||
const legends = yearLegendOpt ? [yearLegendOpt, brandLegendOpt] : brandLegendOpt;
|
||||
|
||||
Reference in New Issue
Block a user