Skip to content

Commit

Permalink
fix(mis): 修复了Mis系统中平台数据统计折线图溢出的问题 (#1259)
Browse files Browse the repository at this point in the history
1.做了什么:
修复了Mis系统中平台数据统计折线图溢出的问题
修复后:

![image](https://github.com/PKUHPC/SCOW/assets/72734623/743e00df-e9ad-4a77-be39-5e85e6d215e1)
修复前:

![image](https://github.com/PKUHPC/SCOW/assets/72734623/4ef40be7-9506-4ef5-b254-d4cb0af05144)
  • Loading branch information
usaveh authored May 20, 2024
1 parent 953e9bc commit 98a166f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-meals-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/mis-web": patch
---

修复了平台数据统计图(折线图)溢出的问题.
6 changes: 4 additions & 2 deletions apps/mis-web/src/pageComponents/admin/DataLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const DataLineChart: React.FC<Props> = ({
lineType = "linear",
toolTipFormatter = (value) => value,
}) => {

return (
<StatisticContainer>
{isLoading ? <Spin /> : (
Expand All @@ -56,7 +55,10 @@ export const DataLineChart: React.FC<Props> = ({
data={data}
>
<XAxis dataKey="x" padding={{ left: 20, right: 20 }} type="category" />
<YAxis padding={{ top: 20 }} />
<YAxis
domain={["dataMin", "dataMax"]}
interval={"preserveStartEnd"}
/>
<Tooltip
formatter={toolTipFormatter}
/>
Expand Down
6 changes: 3 additions & 3 deletions apps/mis-web/src/pages/admin/statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
<DataLineChart
data={dailyChargeData.map((d) => ({
x: d.date.format("YYYY-MM-DD"),
y: d.count.toFixed(2),
y: Number(d.count.toFixed(2)),
}))}
title={t(p("chargeAmount"))}
isLoading={dailyChargeLoading}
Expand All @@ -469,7 +469,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
<DataLineChart
data={dailyPayData.map((d) => ({
x: d.date.format("YYYY-MM-DD"),
y: d.count.toFixed(2),
y: Number(d.count.toFixed(2)),
}))}
title={t(p("payAmount"))}
toolTipFormatter={amountToolTipFormatter}
Expand Down Expand Up @@ -541,7 +541,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
<DataBarChart
data={misUsageCountData.map((d) => ({
x: OperationTypeTexts[d.operationType],
y: d.count,
y:d.count,
}))}
title={t(p("misFeatureUsageCount"))}
toolTipFormatter={(value) => [value, t(p("usageCount"))]}
Expand Down

0 comments on commit 98a166f

Please sign in to comment.