mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
删除Serie的MarkColor,增加ItemStyle的MarkColor
This commit is contained in:
@@ -65,6 +65,7 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2023.01.03) 删除`Serie`的`MarkColor`,增加`ItemStyle`的`MarkColor`
|
||||
* (2022.12.29) 增加`Editor`对`List`的`+`添加编辑功能
|
||||
* (2022.12.29) 修复`UpdateXYData()`接口影响数据精度的问题 (#238)
|
||||
* (2022.12.28) 修复`Pie`只有一个数据时设置`border`后显示异常的问题 (#237)
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_Color0");
|
||||
PropertyField(prop, "m_ToColor");
|
||||
PropertyField(prop, "m_ToColor2");
|
||||
PropertyField(prop, "m_MarkColor");
|
||||
PropertyField(prop, "m_BackgroundColor");
|
||||
PropertyField(prop, "m_BackgroundWidth");
|
||||
PropertyField(prop, "m_CenterColor");
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private Color32 m_Color0;
|
||||
[SerializeField] private Color32 m_ToColor;
|
||||
[SerializeField] private Color32 m_ToColor2;
|
||||
[SerializeField][Since("v3.6.0")] private Color32 m_MarkColor;
|
||||
[SerializeField] private Color32 m_BackgroundColor;
|
||||
[SerializeField] private float m_BackgroundWidth;
|
||||
[SerializeField] private Color32 m_CenterColor;
|
||||
@@ -35,6 +36,7 @@ namespace XCharts.Runtime
|
||||
m_Color0 = Color.clear;
|
||||
m_ToColor = Color.clear;
|
||||
m_ToColor2 = Color.clear;
|
||||
m_MarkColor = Color.clear;
|
||||
m_BackgroundColor = Color.clear;
|
||||
m_BackgroundWidth = 0;
|
||||
m_CenterColor = Color.clear;
|
||||
@@ -102,6 +104,15 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetColor(ref m_ToColor2, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
||||
/// |Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
||||
/// </summary>
|
||||
public Color32 markColor
|
||||
{
|
||||
get { return m_MarkColor; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_MarkColor, value)) { SetAllDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据项背景颜色。
|
||||
/// </summary>
|
||||
public Color32 backgroundColor
|
||||
|
||||
@@ -601,13 +601,14 @@ namespace XCharts.Runtime
|
||||
/// <returns></returns>
|
||||
public Color32 GetMarkColor(Serie serie, SerieData serieData)
|
||||
{
|
||||
if (ChartHelper.IsClearColor(serie.markColor))
|
||||
var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
|
||||
if (ChartHelper.IsClearColor(itemStyle.markColor))
|
||||
{
|
||||
return GetItemColor(serie, serieData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return serie.markColor;
|
||||
return itemStyle.markColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,6 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private string m_SerieName;
|
||||
[SerializeField][Since("v3.2.0")] private SerieState m_State = SerieState.Normal;
|
||||
[SerializeField][Since("v3.2.0")] private SerieColorBy m_ColorBy = SerieColorBy.Default;
|
||||
[SerializeField][Since("v3.4.0")] private Color32 m_MarkColor;
|
||||
[SerializeField] private string m_Stack;
|
||||
[SerializeField] private int m_XAxisIndex = 0;
|
||||
[SerializeField] private int m_YAxisIndex = 0;
|
||||
@@ -376,15 +375,6 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_ColorBy, value)) { SetAllDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
||||
/// |Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
||||
/// </summary>
|
||||
public Color32 markColor
|
||||
{
|
||||
get { return m_MarkColor; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_MarkColor, value)) { SetAllDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|
||||
/// |数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
|
||||
/// </summary>
|
||||
|
||||
@@ -106,7 +106,8 @@ namespace XCharts.Runtime
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ChartHelper.IsClearColor(destSerie.markColor))
|
||||
var itemStyle = SerieHelper.GetItemStyle(destSerie, destSerieData, SerieState.Normal);
|
||||
if (ChartHelper.IsClearColor(itemStyle.markColor))
|
||||
{
|
||||
Color32 color, toColor;
|
||||
SerieHelper.GetItemColor(out color, out toColor, destSerie, destSerieData, chart.theme, index, SerieState.Normal);
|
||||
@@ -114,7 +115,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
else
|
||||
{
|
||||
return destSerie.markColor;
|
||||
return itemStyle.markColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user