mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-26 10:50:08 +00:00
修复MarkLine指定yValue时对数值轴无效的问题
This commit is contained in:
@@ -69,6 +69,7 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2023.10.11) 修复`MarkLine`指定`yValue`时对数值轴无效的问题
|
||||||
* (2023.10.11) 修复`Serie`的`showDataDimension`设置无效的问题
|
* (2023.10.11) 修复`Serie`的`showDataDimension`设置无效的问题
|
||||||
|
|
||||||
## v3.8.1
|
## v3.8.1
|
||||||
|
|||||||
@@ -125,19 +125,19 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
case MarkLineType.Min:
|
case MarkLineType.Min:
|
||||||
data.runtimeValue = SerieHelper.GetMinData(serie, data.dimension, dataZoom);
|
data.runtimeValue = SerieHelper.GetMinData(serie, data.dimension, dataZoom);
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
GetStartEndPos(yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
||||||
break;
|
break;
|
||||||
case MarkLineType.Max:
|
case MarkLineType.Max:
|
||||||
data.runtimeValue = SerieHelper.GetMaxData(serie, data.dimension, dataZoom);
|
data.runtimeValue = SerieHelper.GetMaxData(serie, data.dimension, dataZoom);
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
GetStartEndPos(yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
||||||
break;
|
break;
|
||||||
case MarkLineType.Average:
|
case MarkLineType.Average:
|
||||||
data.runtimeValue = SerieHelper.GetAverageData(serie, data.dimension, dataZoom);
|
data.runtimeValue = SerieHelper.GetAverageData(serie, data.dimension, dataZoom);
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
GetStartEndPos(yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
||||||
break;
|
break;
|
||||||
case MarkLineType.Median:
|
case MarkLineType.Median:
|
||||||
data.runtimeValue = SerieHelper.GetMedianData(serie, data.dimension, dataZoom);
|
data.runtimeValue = SerieHelper.GetMedianData(serie, data.dimension, dataZoom);
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
GetStartEndPos(yAxis, grid, data.runtimeValue, ref sp, ref ep);
|
||||||
break;
|
break;
|
||||||
case MarkLineType.None:
|
case MarkLineType.None:
|
||||||
if (data.xPosition != 0)
|
if (data.xPosition != 0)
|
||||||
@@ -165,7 +165,7 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.yValue, ref sp, ref ep);
|
GetStartEndPos(yAxis, grid, data.yValue, ref sp, ref ep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -179,7 +179,7 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetStartEndPos(xAxis, yAxis, grid, data.xValue, ref sp, ref ep);
|
GetStartEndPos(xAxis, grid, data.xValue, ref sp, ref ep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -258,11 +258,11 @@ namespace XCharts.Runtime
|
|||||||
ColorUtil.clearColor32, borderColor, symbol.gap, serie.clip, cornerRadius, grid, startPos);
|
ColorUtil.clearColor32, borderColor, symbol.gap, serie.clip, cornerRadius, grid, startPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetStartEndPos(Axis xAxis, Axis yAxis, GridCoord grid, double value, ref Vector3 sp, ref Vector3 ep)
|
private void GetStartEndPos(Axis xAxis, GridCoord grid, double value, ref Vector3 sp, ref Vector3 ep)
|
||||||
{
|
{
|
||||||
if (xAxis.IsCategory())
|
if (xAxis is YAxis)
|
||||||
{
|
{
|
||||||
var pY = AxisHelper.GetAxisPosition(grid, yAxis, value);
|
var pY = AxisHelper.GetAxisPosition(grid, xAxis, value);
|
||||||
sp = new Vector3(grid.context.x, pY);
|
sp = new Vector3(grid.context.x, pY);
|
||||||
ep = new Vector3(grid.context.x + grid.context.width, pY);
|
ep = new Vector3(grid.context.x + grid.context.width, pY);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user