fixed emphasis label

This commit is contained in:
monitor1394
2021-12-21 07:01:54 +08:00
parent 76f640f64d
commit f0e94d35b6
5 changed files with 12 additions and 3 deletions

View File

@@ -41,6 +41,7 @@
## branch-2.0
* (2021.12.21) Fixed `Emphasis` dont work
* (2021.12.17) Fixed `MarkLine` does not auto refresh label active when serie hide #178
* (2021.12.10) Improved `Radar`'s `AxisLine` and `SplitLine` to be controlled separately
* (2021.12.08) Fixed y axis does not refresh when serie hidden

View File

@@ -41,6 +41,7 @@
## branch-2.0
* (2021.12.21) 修复`Emphasis`不生效的问题
* (2021.12.17) 修复`MarkLine`在运行时`Label`不自动刷新显示隐藏的问题 #178
* (2021.12.10) 完善`Radar``AxisLine``SplitLine`可单独控制
* (2021.12.08) 修复`Serie`隐藏后`Y`轴最大值不刷新的问题

View File

@@ -262,7 +262,6 @@ namespace XCharts
{
public CoordinateChart chart;
private GameObject m_MarkLineLabelRoot;
private bool m_RefreshLabel = false;
public MarkLineHandler(CoordinateChart chart)
{
@@ -515,7 +514,6 @@ namespace XCharts
data.runtimeCurrentEndPosition = ep;
if (sp != Vector3.zero || ep != Vector3.zero)
{
m_RefreshLabel = true;
chart.ClampInChart(ref sp);
chart.ClampInChart(ref ep);
var theme = chart.theme.axis;

View File

@@ -431,6 +431,14 @@ namespace XCharts
}
}
public static SerieLabel GetSerieEmphasisLabel(Serie serie, SerieData serieData)
{
if (!serie.IsPerformanceMode() && serieData.enableEmphasis && serieData.emphasis.show)
return serieData.emphasis.label;
else if (serie.emphasis.show) return serie.emphasis.label;
else return null;
}
public static IconStyle GetIconStyle(Serie serie, SerieData serieData)
{
if (serieData.enableIconStyle) return serieData.iconStyle;

View File

@@ -544,9 +544,10 @@ namespace XCharts
if (m_SerieLabelRoot == null) return;
if (count == -1) count = serie.dataCount;
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
var serieEmphasisLable = SerieHelper.GetSerieEmphasisLabel(serie, serieData);
var iconStyle = SerieHelper.GetIconStyle(serie, serieData);
if (serie.IsPerformanceMode()) return;
if (!serieLabel.show && !iconStyle.show) return;
if (!serieLabel.show && (serieEmphasisLable == null || !serieEmphasisLable.show) && !iconStyle.show) return;
if (serie.animation.enable && serie.animation.HasFadeOut()) return;
var textName = ChartCached.GetSerieLabelName(s_SerieLabelObjectName, serie.index, serieData.index);
var color = Color.grey;