mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 16:00:24 +00:00
[optimaze][label] icon and emphasis label
This commit is contained in:
@@ -137,6 +137,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
m_IconImage.sprite = sprite == null ? iconStyle.sprite : sprite;
|
||||
m_IconImage.color = iconStyle.color;
|
||||
m_IconImage.type = iconStyle.type;
|
||||
m_IconRect.sizeDelta = new Vector2(iconStyle.width, iconStyle.height);
|
||||
m_IconOffest = iconStyle.offset;
|
||||
m_Align = iconStyle.align;
|
||||
|
||||
@@ -240,13 +240,11 @@ namespace XCharts.Runtime
|
||||
if (count == -1) count = serie.dataCount;
|
||||
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
|
||||
if (serieLabel == null)
|
||||
return false;
|
||||
|
||||
var serieEmphasisLabel = SerieHelper.GetSerieEmphasisLabel(serie, serieData);
|
||||
|
||||
if (!serieLabel.show &&
|
||||
(serieEmphasisLabel == null || !serieEmphasisLabel.show))
|
||||
return false;
|
||||
{
|
||||
serieLabel = SerieHelper.GetSerieEmphasisLabel(serie, serieData);
|
||||
if (serieLabel == null || !serieLabel.show)
|
||||
return false;
|
||||
}
|
||||
|
||||
var dataAutoColor = GetSerieDataAutoColor(serieData);
|
||||
serieData.context.dataLabels.Clear();
|
||||
@@ -404,6 +402,7 @@ namespace XCharts.Runtime
|
||||
labelObject.SetActive(!isIgnore);
|
||||
labelObject.SetText(content);
|
||||
labelObject.SetPosition(serieData.context.dataPoints[i] + offset);
|
||||
labelObject.UpdateIcon(currLabel.icon);
|
||||
if (currLabel.textStyle.autoColor)
|
||||
{
|
||||
var dataAutoColor = GetSerieDataAutoColor(serieData);
|
||||
@@ -422,7 +421,7 @@ namespace XCharts.Runtime
|
||||
SerieLabelHelper.GetFormatterContent(serie, serieData, value, total,
|
||||
currLabel, color);
|
||||
serieData.SetLabelActive(!isIgnore);
|
||||
|
||||
serieData.labelObject.UpdateIcon(currLabel.icon);
|
||||
serieData.labelObject.SetText(content);
|
||||
UpdateLabelPosition(serieData, currLabel);
|
||||
if (currLabel.textStyle.autoColor)
|
||||
|
||||
Reference in New Issue
Block a user