From fafa34b882b859fea4f995a35f921ddcd06f1c48 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Mon, 24 Aug 2026 19:37:04 +0800 Subject: [PATCH 1/2] feat(charts): let LineChart pin the y-axis ceiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Percentage charts read wrong when the axis scales to the data — 59% usage fills the frame like 100% would. An optional yAxisMax pins the ceiling; unset keeps the adaptive axis. --- src/lib/components/echarts/line-chart.tsx | 3 +++ src/lib/components/echarts/types.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/lib/components/echarts/line-chart.tsx b/src/lib/components/echarts/line-chart.tsx index 7fa3f0e..e7f4125 100644 --- a/src/lib/components/echarts/line-chart.tsx +++ b/src/lib/components/echarts/line-chart.tsx @@ -13,6 +13,7 @@ const LineChart: React.FC = (props) => { seriesData, xAxisData, yAxisName, + yAxisMax, height, width, labelFormatter, @@ -132,6 +133,7 @@ const LineChart: React.FC = (props) => { yAxis: { ...options.yAxis, name: yAxisName, + max: yAxisMax ?? undefined, nameTextStyle: { fontSize: 12, align: 'right' @@ -147,6 +149,7 @@ const LineChart: React.FC = (props) => { seriesData, xAxisData, yAxisName, + yAxisMax, title, smooth, titleOptions, diff --git a/src/lib/components/echarts/types.ts b/src/lib/components/echarts/types.ts index d393930..c130625 100644 --- a/src/lib/components/echarts/types.ts +++ b/src/lib/components/echarts/types.ts @@ -29,6 +29,9 @@ export interface ChartProps { smooth?: boolean; color?: string; yAxisName?: string; + // pins the y-axis ceiling (e.g. 100 for percentage charts); left + // unset, echarts scales the axis to the data + yAxisMax?: number; stack?: string | false; gaugeConfig?: { radius?: string; From 58c8762781049dc7c1d0cdb070741b8ec7bd6772 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Wed, 26 Aug 2026 18:17:40 +0800 Subject: [PATCH 2/2] feat(line-chart): honor a series-provided showSymbol A series with gaps can carry isolated points no line segment reaches; callers mark them with per-item symbols and flip showSymbol on the series, which the shared line config used to override. --- src/lib/components/echarts/line-chart.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/components/echarts/line-chart.tsx b/src/lib/components/echarts/line-chart.tsx index e7f4125..631a8d0 100644 --- a/src/lib/components/echarts/line-chart.tsx +++ b/src/lib/components/echarts/line-chart.tsx @@ -97,6 +97,9 @@ const LineChart: React.FC = (props) => { return { ...item, ...lineItemConfig, + // a series whose data marks isolated points (per-item symbol) + // opts back into symbol rendering + showSymbol: item.showSymbol ?? lineItemConfig.showSymbol, smooth: smooth, itemStyle: { ...lineItemConfig.itemStyle,