From 4e22e75dcfd14e93e21020e92eddfeda28fc4bb8 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Fri, 1 Nov 2024 15:15:13 +0800 Subject: [PATCH] fix chart setting bug (#6983) --- .../src/pages/org-admin/statistic/statistic-chart.js | 10 ++++++---- .../src/pages/sys-admin/statistic/statistic-chart.js | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/org-admin/statistic/statistic-chart.js b/frontend/src/pages/org-admin/statistic/statistic-chart.js index 836bcd1ecb..a28213b6bb 100644 --- a/frontend/src/pages/org-admin/statistic/statistic-chart.js +++ b/frontend/src/pages/org-admin/statistic/statistic-chart.js @@ -86,7 +86,8 @@ class StatisticChart extends React.Component { } }, scales: { - y: [{ + y: { + display: true, beginAtZero: true, suggestedMax: suggestedMaxNumbers, ticks: { @@ -97,12 +98,13 @@ class StatisticChart extends React.Component { return value; } } - }], - x: [{ + }, + x: { + display: true, ticks: { maxTicksLimit: 20 } - }] + } } }; this.setState({ diff --git a/frontend/src/pages/sys-admin/statistic/statistic-chart.js b/frontend/src/pages/sys-admin/statistic/statistic-chart.js index 3f2c83be9a..a0c1aa41dd 100644 --- a/frontend/src/pages/sys-admin/statistic/statistic-chart.js +++ b/frontend/src/pages/sys-admin/statistic/statistic-chart.js @@ -86,7 +86,8 @@ class StatisticChart extends React.Component { } }, scales: { - y: [{ + y: { + display: true, beginAtZero: true, suggestedMax: suggestedMaxNumbers, ticks: { @@ -97,12 +98,13 @@ class StatisticChart extends React.Component { return value; } } - }], - x: [{ + }, + x: { + display: true, ticks: { maxTicksLimit: 20 } - }] + } } }; this.setState({