mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 12:08:46 +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()))
|
||||||
@@ -1700,7 +1701,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
ClampInChart(ref p1);
|
ClampInChart(ref p1);
|
||||||
ClampInChart(ref p2);
|
ClampInChart(ref p2);
|
||||||
UGL.DrawZebraLine(vh, p1, p2, size, zebraWidth, zebraGap, color, toColor,maxDistance);
|
UGL.DrawZebraLine(vh, p1, p2, size, zebraWidth, zebraGap, color, toColor, maxDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Color32 GetXLerpColor(Color32 areaColor, Color32 areaToColor, Vector3 pos, Grid grid)
|
protected Color32 GetXLerpColor(Color32 areaColor, Color32 areaToColor, Vector3 pos, Grid grid)
|
||||||
|
|||||||
Reference in New Issue
Block a user