260206_01_ENH: 일부 차트색상 변경, 브랜드별 차트 부분 색상 변경 필요

This commit is contained in:
2026-02-06 09:03:29 +09:00
parent 21989aeeb7
commit bd9a95b87f
6 changed files with 15 additions and 20 deletions

View File

@@ -144,8 +144,8 @@ const LGPenetrationPage = () => {
chart={
<GroupedOverlayBar
data={productChartData}
yearTotalColor={{ "24": "--chart-total-1", "25": "--chart-total-2", "26": "--chart-total-3" }}
yearFocusColor={{ "24": "--chart-lg-1", "25": "--chart-lg-2", "26": "--chart-lg-3" }}
yearTotalColor={{ "24": "--chart-3-t", "25": "--chart-2-t", "26": "--chart-1-t" }}
yearFocusColor={{ "24": "--chart-3", "25": "--chart-2", "26": "--chart-1" }}
showFocusLabel={"last"}
/>
}

View File

@@ -89,8 +89,8 @@ const LGPurchasePage = () => {
chart={
<GroupedOverlayBar
data={purchaseChartData}
yearTotalColor={{ "24": "--chart-total-1", "25": "--chart-total-2", "26": "--chart-total-3" }}
yearFocusColor={{ "24": "--chart-lg-1", "25": "--chart-lg-2", "26": "--chart-lg-3" }}
yearTotalColor={{ "24": "--chart-3-t", "25": "--chart-2-t", "26": "--chart-1-t" }}
yearFocusColor={{ "24": "--chart-3", "25": "--chart-2", "26": "--chart-1" }}
showFocusLabel={"last"}
/>
}

View File

@@ -14,17 +14,7 @@ export const POST = async (req: NextRequest) => {
const backApi = await createBackApi();
const body = (await req.json()) as LoginRequest;
//const result = await backApi.post<LoginResponse>("/auth/login", body);
const result:LoginResponse = {
accessToken: "abcdefghijklmnopqrstuvwxyz0123456789",
user: {
userId: "TEST_USER",
userName: "TEST_USER",
userCmpn: "TEST",
userTeam: "TEST",
userRole: 9999,
}
}
const result = await backApi.post<LoginResponse>("/auth/login", body);
const res = NextResponse.json(result.user, { status: 200 });
res.cookies.set("access_token", result.accessToken, {

View File

@@ -176,9 +176,13 @@
/* =============================
Chart Colors
============================= */
--chart-1: var(--lg-red-600);
--chart-2: var(--lg-red-300);
--chart-3: var(--lg-pink-300);
--chart-1: hsl(334 81% 41%);
--chart-2: hsl(0 0% 49%);
--chart-3: hsl(0 0% 74%);
--chart-1-t: hsl(334 80% 90%);
--chart-2-t: hsl(0 0% 70%);
--chart-3-t: hsl(0 0% 88%);
--chart-4: var(--lg-pink-400);
--chart-5: var(--lg-pink-600);
--chart-6: var(--lg-gray-500);

View File

@@ -80,11 +80,11 @@ const GroupedOverlayBar = ({
// 연도별 색: 없으면 기본값(전체=회색, LG=빨강 계열)
const totalTokens = years.map((y, i) => {
const t = yearTotalColor?.[String(y)];
return t ?? (["--lg-gray-200", "--lg-gray-300", "--lg-gray-400", "--lg-gray-500"][i] ?? "--lg-gray-300");
return t ?? (["--chart-1-t", "--chart-2-t", "--chart-3-t"][i] ?? "--lg-gray-300");
});
const focusTokens = years.map((y, i) => {
const t = yearFocusColor?.[String(y)];
return t ?? (["--lg-red-300", "--lg-red-400", "--lg-red-500", "--lg-red-600"][i] ?? "--lg-red-500");
return t ?? (["--chart-1", "--chart-2", "--chart-3"][i] ?? "--lg-red-500");
});
const totalColors = buildLgPalette(totalTokens);

View File

@@ -14,6 +14,7 @@ const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
export const resolveHslVar = (varName: string): Hsl | null => {
if (typeof window === "undefined") return null;
const raw = getComputedStyle(document.documentElement).getPropertyValue(varName);
return parseHslTriplet(raw);
};