From 6a1af4952f5f36c106438b922e4084796068f7be Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Wed, 17 Jan 2024 17:36:18 +0100 Subject: [PATCH] fix(lemon-ui): Fix labels on basic sparklines (#19816) --- frontend/src/lib/lemon-ui/Sparkline.tsx | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/lemon-ui/Sparkline.tsx b/frontend/src/lib/lemon-ui/Sparkline.tsx index 0ce8263be75..38bd6d40179 100644 --- a/frontend/src/lib/lemon-ui/Sparkline.tsx +++ b/frontend/src/lib/lemon-ui/Sparkline.tsx @@ -42,7 +42,7 @@ export function Sparkline({ labels, data }: SparklineProps): JSX.Element { chart = new Chart(canvasRef.current?.getContext('2d') as ChartItem, { type: 'bar', data: { - labels: labels || Object.values(adjustedData).map(() => ''), + labels: labels || adjustedData[0].values.map((_, i) => `Entry ${i}`), datasets: adjustedData.map((timeseries) => ({ data: timeseries.values, minBarLength: 0, diff --git a/package.json b/package.json index 7f1bdf639ca..f860db3fd69 100644 --- a/package.json +++ b/package.json @@ -312,11 +312,11 @@ "stylelint --fix", "prettier --write" ], - "frontend/src/**.{js,jsx,mjs,ts,tsx}": [ + "frontend/src/**/*.{js,jsx,mjs,ts,tsx}": [ "eslint -c .eslintrc.js --fix", "prettier --write" ], - "plugin-server/**.{js,jsx,mjs,ts,tsx}": [ + "plugin-server/**/*.{js,jsx,mjs,ts,tsx}": [ "pnpm --dir plugin-server exec eslint --fix", "pnpm --dir plugin-server exec prettier --write" ],