diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 8dab8a1f..673f0ebc 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -42,6 +42,7 @@ ## branch-2.0 +* (2022.02.17) Fixed bug where axis split line might be displayed outside the coordinate system #181 * (2022.02.08) Fixed {d} formatter error when value is 0 * (2022.02.08) Fixed `YAxis` `AxisLabel`'s `onZero` does not work * (2022.01.06) Improved `Zebra` bar chart diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 668e1569..bdea7376 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -42,6 +42,7 @@ ## branch-2.0 +* (2022.02.17) 修复`Axis`的`SplitLine`可能会显示在坐标系外的问题 #181 * (2022.02.08) 修复数据全0时`{d}`显示不正确的问题 * (2022.02.08) 修复`YAxis`的`AxisLabel`的`onZero`参数不生效的问题 * (2022.01.06) 优化`Zebra`斑马柱图 diff --git a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs index 76eb9125..c20e123c 100644 --- a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs +++ b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs @@ -1082,7 +1082,7 @@ private void DrawYAxisSplit(VertexHelper vh, int yAxisIndex, YAxis yAxis) new Vector2(grid.runtimeX, pY + scaleWidth), yAxis.splitArea.GetColor(i, m_Theme.axis)); } - if (yAxis.splitLine.show) + if (yAxis.splitLine.show && pY >= grid.runtimeY) { if (!xAxis.axisLine.show || !xAxis.axisLine.onZero || zeroPos.y != pY) { @@ -1200,7 +1200,7 @@ private void DrawXAxisSplit(VertexHelper vh, int xAxisIndex, XAxis xAxis) new Vector2(pX + scaleWidth, grid.runtimeY), xAxis.splitArea.GetColor(i, m_Theme.axis)); } - if (xAxis.splitLine.show) + if (xAxis.splitLine.show && pX >= grid.runtimeX) { if (!yAxis.axisLine.show || !yAxis.axisLine.onZero || zeroPos.x != pX) {