diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f48089..bc116733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ ## master +* (2022.08.09) 优化`Axis`的`Time`时间轴的次分割线 * (2022.08.09) 增加`AreaStyle`的`innerFill`参数支持填充凸多边形 * (2022.08.08) 优化`Serie`的数据项索引维护,增加检测和修复功能,修复相关问题 * (2022.07.29) 修复`Unity`版本兼容:在某些版本导入后图表创建异常的问题 diff --git a/Runtime/Component/Axis/AxisHandler.cs b/Runtime/Component/Axis/AxisHandler.cs index 50e9b3ac..0a86e596 100644 --- a/Runtime/Component/Axis/AxisHandler.cs +++ b/Runtime/Component/Axis/AxisHandler.cs @@ -562,6 +562,12 @@ namespace XCharts if (AxisHelper.NeedShowSplit(axis)) { var size = AxisHelper.GetScaleNumber(axis, axisLength, dataZoom); + if (axis.IsTime()) + { + size += 1; + if (!ChartHelper.IsEquals(axis.GetLastLabelValue(), axis.context.maxValue)) + size += 1; + } var tickWidth = axis.axisTick.GetWidth(theme.tickWidth); var tickColor = axis.axisTick.GetColor(theme.tickColor); var current = orient == Orient.Horizonal ? startX : startY; diff --git a/Runtime/Utilities/DateTimeUtil.cs b/Runtime/Utilities/DateTimeUtil.cs index cf97f145..1ff3fa97 100644 --- a/Runtime/Utilities/DateTimeUtil.cs +++ b/Runtime/Utilities/DateTimeUtil.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using UnityEngine; namespace XCharts.Runtime { @@ -160,7 +161,7 @@ namespace XCharts.Runtime private static void AddTickTimestamp(List list, int startTimestamp, int maxTimestamp, int tickSecond) { - while (startTimestamp < maxTimestamp) + while (startTimestamp <= maxTimestamp) { list.Add(startTimestamp); startTimestamp += tickSecond;