Skip to content

Commit

Permalink
修复图表控件平均值某些情况下大于最大值的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
noberumotto committed Oct 24, 2021
1 parent 0fc3c6c commit c13f5ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Local/Project1.UI/Controls/ChartControl/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ private void RenderTick()
averageTickY = (averageValue / maxValue) * itemTrueHeight + 30 - AverageTick.ActualHeight / 2;

//最终显示的平均值需要处理小数点,仅保留一位
averageValue = Math.Round(averageValue, 1);
averageValue = double.Parse(string.Format("{0:N1}", averageValue));

Average = averageValue;

double bottomTickMargin = (bottomValue / maxValue) * itemTrueHeight + 30;
Expand Down

0 comments on commit c13f5ee

Please sign in to comment.