修复DataZoom拖动时SerieLabel不刷新的问题 (#165)

This commit is contained in:
monitor1394
2021-08-31 13:41:46 +08:00
parent ab5995be7f
commit 608ba43246
3 changed files with 14 additions and 6 deletions

View File

@@ -39,6 +39,7 @@
## master
* (2021.08.31) Fixed bug where `SerieLabel` does not refresh when `DataZoom` is dragged (#165)
* (2021.08.25) Fixed an issue where the theme switch could not be save to the scene (#166)
* (2021.08.24) Added `Animation`'s `alongWithLinePath`
* (2021.08.22) Added `Serie`'s `ignoreLineBreak` (#164)

View File

@@ -39,6 +39,7 @@
## master
* (2021.08.31) 修复`DataZoom`拖动时`SerieLabel`不刷新的问题 (#165)
* (2021.08.25) 修复`Theme`主题切换无法保持到场景上的问题 (#166)
* (2021.08.24) 增加`Animation``alongWithLinePath`参数设置折线轨迹匀速动画
* (2021.08.22) 增加`Serie``ignoreLineBreak`参数设置忽略数据连线是否断开 (#164)

View File

@@ -1464,10 +1464,11 @@ namespace XCharts
if (!serie.show) continue;
if (serie.IsPerformanceMode()) continue;
if (!serie.IsCoordinateSerie()) continue;
for (int j = 0; j < serie.data.Count; j++)
DataZoomHelper.GetSerieRelatedDataZoom(serie, dataZooms, out var xDataZoom, out var yDataZoom);
var showData = serie.GetDataList(xDataZoom);
for (int j = 0; j < showData.Count; j++)
{
var serieData = serie.data[j];
var serieData = showData[j];
if (serieData.labelObject == null) continue;
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData, serieData.highlighted);
serieData.index = j;
@@ -1546,9 +1547,13 @@ namespace XCharts
if (!serie.IsCoordinateSerie()) continue;
var total = serie.yTotal;
var isPercentStack = SeriesHelper.IsPercentStack(m_Series, serie.stack, SerieType.Bar);
for (int j = 0; j < serie.data.Count; j++)
DataZoomHelper.GetSerieRelatedDataZoom(serie, dataZooms, out var xDataZoom, out var yDataZoom);
var showData = serie.GetDataList(xDataZoom);
if (xDataZoom != null)
ChartHelper.HideAllObject(m_SerieLabelRoot, "label_" + i);
for (int j = 0; j < showData.Count; j++)
{
var serieData = serie.data[j];
var serieData = showData[j];
if (serieData.labelObject == null) continue;
if (j >= serie.dataPoints.Count)
{
@@ -1556,6 +1561,7 @@ namespace XCharts
serieData.SetIconActive(false);
continue;
}
serieData.labelObject.SetActive(true);
var pos = serie.dataPoints[j];
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
var iconStyle = SerieHelper.GetIconStyle(serie, serieData);
@@ -1689,7 +1695,7 @@ namespace XCharts
}
public void Internal_CheckClipAndDrawZebraLine(VertexHelper vh, Vector3 p1, Vector3 p2, float size, float zebraWidth,
float zebraGap, Color32 color,Color32 toColor, bool clip, Grid grid)
float zebraGap, Color32 color, Color32 toColor, bool clip, Grid grid)
{
ClampInChart(ref p1);
ClampInChart(ref p2);