修复Serie添加double.MaxValue时坐标绘制失败的问题

This commit is contained in:
monitor1394
2023-12-11 13:43:03 +08:00
parent a50bda5344
commit 53c7ddf9d4
3 changed files with 15 additions and 12 deletions

View File

@@ -267,7 +267,11 @@ namespace XCharts
if (axis.interval == 0)
{
if (axis.splitNumber > 0)
if (range >= double.MaxValue / 2)
{
tick = range / 4;
}
else if (axis.splitNumber > 0)
{
tick = range / axis.splitNumber;
}
@@ -865,7 +869,6 @@ namespace XCharts
for (int i = 0; i < size; i++)
{
var scaleWidth = AxisHelper.GetScaleWidth(axis, axisLength, axis.IsTime() ? i : i + 1, dataZoom);
if (axis.boundaryGap && axis.axisTick.alignWithLabel)
current -= scaleWidth / 2;