Skip to content

Commit

Permalink
feat: set start point of selection of avg-block-time 1% (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Nov 7, 2023
1 parent 366cf41 commit a2a22de
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/pages/StatisticsChart/block/AverageBlockTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ const useOption = (
containLabel: true,
}

const maxAndMinAxis = (statisticAverageBlockTimes: ChartItem.AverageBlockTime[]) => {
const array = statisticAverageBlockTimes.flatMap(data => parseFloat(data.avgBlockTimeDaily))
return {
max: Math.ceil(Math.max(...array) / 1000),
min: Math.floor(Math.min(...array) / 1000),
}
}

const widthSpan = (value: string) => tooltipWidth(value, currentLanguage === 'en' ? 180 : 100)

const parseTooltip = ({ seriesName, data, color }: SeriesItem & { data?: string[] }): string => {
Expand Down Expand Up @@ -114,8 +106,6 @@ const useOption = (
nameTextStyle: {
align: 'left',
},
max: () => maxAndMinAxis(statisticAverageBlockTimes).max,
min: () => maxAndMinAxis(statisticAverageBlockTimes).min,
axisLine: {
lineStyle: {
color: chartColor.colors[0],
Expand All @@ -133,8 +123,6 @@ const useOption = (
nameTextStyle: {
align: 'right',
},
max: () => maxAndMinAxis(statisticAverageBlockTimes).max,
min: () => maxAndMinAxis(statisticAverageBlockTimes).min,
axisLine: {
lineStyle: {
color: chartColor.colors[1],
Expand Down

1 comment on commit a2a22de

@vercel
Copy link

@vercel vercel bot commented on a2a22de Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.