mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-31 05:48:45 +00:00
fixed y axis label onZero does not work
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
## branch-2.0
|
## branch-2.0
|
||||||
|
|
||||||
|
* (2022.02.08) Fixed `YAxis` `AxisLabel`'s `onZero` does not work
|
||||||
* (2022.01.06) Improved `Zebra` bar chart
|
* (2022.01.06) Improved `Zebra` bar chart
|
||||||
|
|
||||||
## v2.6.0
|
## v2.6.0
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
## branch-2.0
|
## branch-2.0
|
||||||
|
|
||||||
|
* (2022.02.08) 修复`YAxis`的`AxisLabel`的`onZero`参数不生效的问题
|
||||||
* (2022.01.06) 优化`Zebra`斑马柱图
|
* (2022.01.06) 优化`Zebra`斑马柱图
|
||||||
|
|
||||||
## v2.6.0
|
## v2.6.0
|
||||||
|
|||||||
@@ -848,7 +848,8 @@ namespace XCharts
|
|||||||
private Vector3 GetLabelYPosition(float scaleWid, int i, int yAxisIndex, YAxis yAxis)
|
private Vector3 GetLabelYPosition(float scaleWid, int i, int yAxisIndex, YAxis yAxis)
|
||||||
{
|
{
|
||||||
var grid = GetAxisGridOrDefault(yAxis);
|
var grid = GetAxisGridOrDefault(yAxis);
|
||||||
var startX = yAxis.IsLeft() ? grid.runtimeX : grid.runtimeX + grid.runtimeWidth;
|
var startX = grid.runtimeX + (yAxis.axisLabel.onZero ? m_XAxes[yAxisIndex].runtimeZeroXOffset : 0);
|
||||||
|
if (yAxis.IsRight()) startX += grid.runtimeWidth;
|
||||||
var posX = 0f;
|
var posX = 0f;
|
||||||
var inside = yAxis.axisLabel.inside;
|
var inside = yAxis.axisLabel.inside;
|
||||||
if ((inside && yAxis.IsLeft()) || (!inside && yAxis.IsRight()))
|
if ((inside && yAxis.IsLeft()) || (!inside && yAxis.IsRight()))
|
||||||
|
|||||||
Reference in New Issue
Block a user