Skip to content

Commit

Permalink
fix: fix auto-scale of y-axis in uncle rate chart (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Dec 12, 2023
1 parent 794b12b commit 65aacd4
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/pages/StatisticsChart/mining/UncleRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { ChartItem, explorerService } from '../../../services/ExplorerService'
import { useCurrentLanguage } from '../../../utils/i18n'
import { ChartColorConfig } from '../../../constants/common'

const max = (statisticUncleRates: ChartItem.UncleRate[]) => {
const array = statisticUncleRates.flatMap(data => Number(data.uncleRate) * 100)
return Math.max(5, Math.ceil(Math.max(...array)))
}

const useOption = (
statisticUncleRates: ChartItem.UncleRate[],
chartColor: ChartColorConfig,
Expand Down Expand Up @@ -69,8 +64,6 @@ const useOption = (
name: isMobile || isThumbnail ? '' : t('block.uncle_rate'),
type: 'value',
scale: true,
max: max(statisticUncleRates),
min: 0,
axisLine: {
lineStyle: {
color: chartColor.colors[0],
Expand Down

0 comments on commit 65aacd4

Please sign in to comment.