* UILineChart: 修复数据全为Nan时绘制出错
This commit is contained in:
parent
13526d0ec3
commit
101f3a9133
@ -38,6 +38,7 @@
|
||||
* 2022-07-30: V3.2.2 数据显示的日期格式重构调整至数据序列 Series.XAxisDateTimeFormat
|
||||
* 2022-07-30: V3.2.2 坐标轴的小数位数重构调整至坐标轴标签 AxisLabel.DecimalPlaces
|
||||
* 2022-07-30: V3.2.2 坐标轴的日期格式重构调整至坐标轴标签 AxisLabel.DateTimeFormat
|
||||
* 2022-08-17: V3.2.3 修复数据全为Nan时绘制出错
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
|
@ -234,6 +234,12 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (min > max)
|
||||
{
|
||||
min = 0;
|
||||
max = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -276,6 +282,12 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (min > max)
|
||||
{
|
||||
min = 0;
|
||||
max = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -297,6 +297,8 @@ namespace Sunny.UI
|
||||
/// <param name="penWidth">笔宽</param>
|
||||
public static void DrawLine(this Graphics g, Color color, float x1, float y1, float x2, float y2, bool smooth = false, float penWidth = 1)
|
||||
{
|
||||
if (y1.IsNanOrInfinity() || y2.IsNanOrInfinity() || x1.IsNanOrInfinity() || x2.IsNanOrInfinity()) return;
|
||||
|
||||
using (Pen pen = color.Pen(penWidth))
|
||||
{
|
||||
g.Smooth(smooth);
|
||||
|
Loading…
x
Reference in New Issue
Block a user