[feature][serie] support EmphasisStle,BlurStyle and SelectStyle

This commit is contained in:
monitor1394
2022-07-25 07:46:03 +08:00
parent 8dde322c04
commit 4f93628667
61 changed files with 1052 additions and 758 deletions

View File

@@ -57,6 +57,10 @@
## master ## master
* (2022.07.24) 增加`Serie``SerieData``state`设置默认状态
* (2022.07.22) 增加`Serie`的三种状态`EmphasisStyle`,`BlurStyle`,`SelectStyle`
* (2022.07.22) 去掉`AreaStyle``m_HighlightColor``m_HighlightToColor`配置
* (2022.07.22) 去掉`Emphasis`,`EmphasisItemStyle`,`EmphasisLabelStyle`,`EmphasisLabelLine`组件
* (2022.07.20) 文档支持用`Since`标识类从哪个版本开始支持 * (2022.07.20) 文档支持用`Since`标识类从哪个版本开始支持
* (2022.07.20) 修复`Axis``Value`轴时,`AxisLabel``showStartLabel``showEndLabel`参数设置不生效的问题 * (2022.07.20) 修复`Axis``Value`轴时,`AxisLabel``showStartLabel``showEndLabel`参数设置不生效的问题
* (2022.07.19) 增加`Axis``MinorSplitLine`设置坐标轴次分割线 * (2022.07.19) 增加`Axis``MinorSplitLine`设置坐标轴次分割线

View File

@@ -190,8 +190,9 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `GetDataZoomOfSerie()` |public void GetDataZoomOfSerie(Serie serie, out DataZoom xDataZoom, out DataZoom yDataZoom)</br> | | `GetDataZoomOfSerie()` |public void GetDataZoomOfSerie(Serie serie, out DataZoom xDataZoom, out DataZoom yDataZoom)</br> |
| `GetGrid()` |public GridCoord GetGrid(Vector2 local)</br> | | `GetGrid()` |public GridCoord GetGrid(Vector2 local)</br> |
| `GetGridOfDataZoom()` |public GridCoord GetGridOfDataZoom(DataZoom dataZoom)</br> | | `GetGridOfDataZoom()` |public GridCoord GetGridOfDataZoom(DataZoom dataZoom)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, bool highlight = false)</br> | | `GetItemColor()` |public Color32 GetItemColor(Serie serie)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)</br> |
| `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)</br> | | `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)</br> |
| `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)</br> | | `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)</br> |
| `GetPainter()` |public Painter GetPainter(int index)</br> | | `GetPainter()` |public Painter GetPainter(int index)</br> |
@@ -340,6 +341,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `DestroyAllChildren()` |public static void DestroyAllChildren(Transform parent)</br> | | `DestroyAllChildren()` |public static void DestroyAllChildren(Transform parent)</br> |
| `GetActualValue()` |public static float GetActualValue(float valueOrRate, float total, float maxRate = 1.5f)</br> | | `GetActualValue()` |public static float GetActualValue(float valueOrRate, float total, float maxRate = 1.5f)</br> |
| `GetAngle360()` |public static float GetAngle360(Vector2 from, Vector2 to)</br>获得0-360的角度12点钟方向为0度 | | `GetAngle360()` |public static float GetAngle360(Vector2 from, Vector2 to)</br>获得0-360的角度12点钟方向为0度 |
| `GetBlurColor()` |public static Color32 GetBlurColor(Color32 color, float a = 0.3f)</br> |
| `GetColor()` |public static Color32 GetColor(string hexColorStr)</br> | | `GetColor()` |public static Color32 GetColor(string hexColorStr)</br> |
| `GetDire()` |public static Vector3 GetDire(float angle, bool isDegree = false)</br> | | `GetDire()` |public static Vector3 GetDire(float angle, bool isDegree = false)</br> |
| `GetFloatAccuracy()` |public static int GetFloatAccuracy(double value)</br> | | `GetFloatAccuracy()` |public static int GetFloatAccuracy(double value)</br> |
@@ -353,6 +355,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> | | `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> | | `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> | | `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
| `GetSelectColor()` |public static Color32 GetSelectColor(Color32 color, float rate = 0.7f)</br> |
| `GetVertialDire()` |public static Vector3 GetVertialDire(Vector3 dire)</br> | | `GetVertialDire()` |public static Vector3 GetVertialDire(Vector3 dire)</br> |
| `HideAllObject()` |public static void HideAllObject(GameObject obj, string match = null)</br> | | `HideAllObject()` |public static void HideAllObject(GameObject obj, string match = null)</br> |
| `HideAllObject()` |public static void HideAllObject(Transform parent, string match = null)</br> | | `HideAllObject()` |public static void HideAllObject(Transform parent, string match = null)</br> |
@@ -828,18 +831,15 @@ Inherits or Implemented: [Attribute](#Attribute)
|--|--| |--|--|
| `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> | | `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> | | `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAreaColor()` |public static Color32 GetAreaColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> | | `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> | | `GetBlurStyle()` |public static BlurStyle GetBlurStyle(Serie serie, SerieData serieData)</br> |
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> | | `GetEmphasisStyle()` |public static EmphasisStyle GetEmphasisStyle(Serie serie, SerieData serieData)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto, bool opacity = true)</br> |
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> | | `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> | | `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> | | `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> | | `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetMaxSerieData()` |public static SerieData GetMaxSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMaxSerieData()` |public static SerieData GetMaxSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
@@ -848,14 +848,16 @@ Inherits or Implemented: [Attribute](#Attribute)
| `GetMinMaxData()` |public static void GetMinMaxData(Serie serie, out double min, out double max, DataZoom dataZoom = null, int dimension = 0)</br>Gets the maximum and minimum values of all data in the serie. | | `GetMinMaxData()` |public static void GetMinMaxData(Serie serie, out double min, out double max, DataZoom dataZoom = null, int dimension = 0)</br>Gets the maximum and minimum values of all data in the serie. |
| `GetMinSerieData()` |public static SerieData GetMinSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMinSerieData()` |public static SerieData GetMinSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetNumericFormatter()` |public static string GetNumericFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> | | `GetNumericFormatter()` |public static string GetNumericFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetSerieEmphasisLabel()` |public static LabelStyle GetSerieEmphasisLabel(Serie serie, SerieData serieData)</br> | | `GetSelectStyle()` |public static SelectStyle GetSelectStyle(Serie serie, SerieData serieData)</br> |
| `GetSerieLabel()` |public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetSerieLabel()` |public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetSerieLabelLine()` |public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetSerieLabelLine()` |public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetSerieState()` |public static SerieState GetSerieState(Serie serie)</br> |
| `GetSerieState()` |public static SerieState GetSerieState(Serie serie, SerieData serieData)</br> |
| `GetSerieSymbol()` |public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)</br> | | `GetSerieSymbol()` |public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)</br> |
| `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight)</br> | | `GetStateStyle()` |public static StateStyle GetStateStyle(Serie serie, SerieData serieData, SerieState state)</br> |
| `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, float defaultWidth)</br> | | `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)</br> |
| `GetSymbolBorderColor()` |public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight)</br> | | `GetSymbolBorderColor()` |public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)</br> |
| `GetSymbolCornerRadius()` |public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, bool highlight)</br> | | `GetSymbolCornerRadius()` |public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetTitleStyle()` |public static TitleStyle GetTitleStyle(Serie serie, SerieData serieData)</br> | | `GetTitleStyle()` |public static TitleStyle GetTitleStyle(Serie serie, SerieData serieData)</br> |
| `IsAllZeroValue()` |public static bool IsAllZeroValue(Serie serie, int dimension = 1)</br>Whether the data for the specified dimension of serie are all 0. | | `IsAllZeroValue()` |public static bool IsAllZeroValue(Serie serie, int dimension = 1)</br>Whether the data for the specified dimension of serie are all 0. |
| `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> | | `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> |

View File

@@ -190,8 +190,9 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `GetDataZoomOfSerie()` |public void GetDataZoomOfSerie(Serie serie, out DataZoom xDataZoom, out DataZoom yDataZoom)</br> | | `GetDataZoomOfSerie()` |public void GetDataZoomOfSerie(Serie serie, out DataZoom xDataZoom, out DataZoom yDataZoom)</br> |
| `GetGrid()` |public GridCoord GetGrid(Vector2 local)</br> | | `GetGrid()` |public GridCoord GetGrid(Vector2 local)</br> |
| `GetGridOfDataZoom()` |public GridCoord GetGridOfDataZoom(DataZoom dataZoom)</br> | | `GetGridOfDataZoom()` |public GridCoord GetGridOfDataZoom(DataZoom dataZoom)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, bool highlight = false)</br> | | `GetItemColor()` |public Color32 GetItemColor(Serie serie)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData)</br> |
| `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)</br> |
| `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)</br> | | `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)</br> |
| `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)</br> | | `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)</br> |
| `GetPainter()` |public Painter GetPainter(int index)</br> | | `GetPainter()` |public Painter GetPainter(int index)</br> |
@@ -340,6 +341,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `DestroyAllChildren()` |public static void DestroyAllChildren(Transform parent)</br> | | `DestroyAllChildren()` |public static void DestroyAllChildren(Transform parent)</br> |
| `GetActualValue()` |public static float GetActualValue(float valueOrRate, float total, float maxRate = 1.5f)</br> | | `GetActualValue()` |public static float GetActualValue(float valueOrRate, float total, float maxRate = 1.5f)</br> |
| `GetAngle360()` |public static float GetAngle360(Vector2 from, Vector2 to)</br>获得0-360的角度12点钟方向为0度 | | `GetAngle360()` |public static float GetAngle360(Vector2 from, Vector2 to)</br>获得0-360的角度12点钟方向为0度 |
| `GetBlurColor()` |public static Color32 GetBlurColor(Color32 color, float a = 0.3f)</br> |
| `GetColor()` |public static Color32 GetColor(string hexColorStr)</br> | | `GetColor()` |public static Color32 GetColor(string hexColorStr)</br> |
| `GetDire()` |public static Vector3 GetDire(float angle, bool isDegree = false)</br> | | `GetDire()` |public static Vector3 GetDire(float angle, bool isDegree = false)</br> |
| `GetFloatAccuracy()` |public static int GetFloatAccuracy(double value)</br> | | `GetFloatAccuracy()` |public static int GetFloatAccuracy(double value)</br> |
@@ -353,6 +355,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> | | `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> | | `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> | | `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
| `GetSelectColor()` |public static Color32 GetSelectColor(Color32 color, float rate = 0.7f)</br> |
| `GetVertialDire()` |public static Vector3 GetVertialDire(Vector3 dire)</br> | | `GetVertialDire()` |public static Vector3 GetVertialDire(Vector3 dire)</br> |
| `HideAllObject()` |public static void HideAllObject(GameObject obj, string match = null)</br> | | `HideAllObject()` |public static void HideAllObject(GameObject obj, string match = null)</br> |
| `HideAllObject()` |public static void HideAllObject(Transform parent, string match = null)</br> | | `HideAllObject()` |public static void HideAllObject(Transform parent, string match = null)</br> |
@@ -828,18 +831,15 @@ Inherits or Implemented: [Attribute](#Attribute)
|--|--| |--|--|
| `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> | | `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> | | `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAreaColor()` |public static Color32 GetAreaColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> | | `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> | | `GetBlurStyle()` |public static BlurStyle GetBlurStyle(Serie serie, SerieData serieData)</br> |
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> | | `GetEmphasisStyle()` |public static EmphasisStyle GetEmphasisStyle(Serie serie, SerieData serieData)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto, bool opacity = true)</br> |
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> | | `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> | | `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> | | `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> | | `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetMaxSerieData()` |public static SerieData GetMaxSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMaxSerieData()` |public static SerieData GetMaxSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
@@ -848,14 +848,16 @@ Inherits or Implemented: [Attribute](#Attribute)
| `GetMinMaxData()` |public static void GetMinMaxData(Serie serie, out double min, out double max, DataZoom dataZoom = null, int dimension = 0)</br>获得系列所有数据的最大最小值。 | | `GetMinMaxData()` |public static void GetMinMaxData(Serie serie, out double min, out double max, DataZoom dataZoom = null, int dimension = 0)</br>获得系列所有数据的最大最小值。 |
| `GetMinSerieData()` |public static SerieData GetMinSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> | | `GetMinSerieData()` |public static SerieData GetMinSerieData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetNumericFormatter()` |public static string GetNumericFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> | | `GetNumericFormatter()` |public static string GetNumericFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetSerieEmphasisLabel()` |public static LabelStyle GetSerieEmphasisLabel(Serie serie, SerieData serieData)</br> | | `GetSelectStyle()` |public static SelectStyle GetSelectStyle(Serie serie, SerieData serieData)</br> |
| `GetSerieLabel()` |public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetSerieLabel()` |public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetSerieLabelLine()` |public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, bool highlight = false)</br> | | `GetSerieLabelLine()` |public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetSerieState()` |public static SerieState GetSerieState(Serie serie)</br> |
| `GetSerieState()` |public static SerieState GetSerieState(Serie serie, SerieData serieData)</br> |
| `GetSerieSymbol()` |public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)</br> | | `GetSerieSymbol()` |public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)</br> |
| `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight)</br> | | `GetStateStyle()` |public static StateStyle GetStateStyle(Serie serie, SerieData serieData, SerieState state)</br> |
| `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, float defaultWidth)</br> | | `GetSymbolBorder()` |public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)</br> |
| `GetSymbolBorderColor()` |public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight)</br> | | `GetSymbolBorderColor()` |public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)</br> |
| `GetSymbolCornerRadius()` |public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, bool highlight)</br> | | `GetSymbolCornerRadius()` |public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)</br> |
| `GetTitleStyle()` |public static TitleStyle GetTitleStyle(Serie serie, SerieData serieData)</br> | | `GetTitleStyle()` |public static TitleStyle GetTitleStyle(Serie serie, SerieData serieData)</br> |
| `IsAllZeroValue()` |public static bool IsAllZeroValue(Serie serie, int dimension = 1)</br>系列指定维数的数据是否全部为0。 | | `IsAllZeroValue()` |public static bool IsAllZeroValue(Serie serie, int dimension = 1)</br>系列指定维数的数据是否全部为0。 |
| `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> | | `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> |

View File

@@ -85,14 +85,12 @@
- [AxisTick](#AxisTick) - [AxisTick](#AxisTick)
- [BaseAxisTheme](#BaseAxisTheme) - [BaseAxisTheme](#BaseAxisTheme)
- [BaseLine](#BaseLine) - [BaseLine](#BaseLine)
- [BlurStyle](#BlurStyle)
- [CommentItem](#CommentItem) - [CommentItem](#CommentItem)
- [CommentMarkStyle](#CommentMarkStyle) - [CommentMarkStyle](#CommentMarkStyle)
- [ComponentTheme](#ComponentTheme) - [ComponentTheme](#ComponentTheme)
- [DataZoomTheme](#DataZoomTheme) - [DataZoomTheme](#DataZoomTheme)
- [Emphasis](#Emphasis) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisItemStyle](#EmphasisItemStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [EndLabelStyle](#EndLabelStyle) - [EndLabelStyle](#EndLabelStyle)
- [IconStyle](#IconStyle) - [IconStyle](#IconStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
@@ -111,10 +109,12 @@
- [PolarAxisTheme](#PolarAxisTheme) - [PolarAxisTheme](#PolarAxisTheme)
- [RadarAxisTheme](#RadarAxisTheme) - [RadarAxisTheme](#RadarAxisTheme)
- [RadiusAxisTheme](#RadiusAxisTheme) - [RadiusAxisTheme](#RadiusAxisTheme)
- [SelectStyle](#SelectStyle)
- [SerieData](#SerieData) - [SerieData](#SerieData)
- [SerieSymbol](#SerieSymbol) - [SerieSymbol](#SerieSymbol)
- [SerieTheme](#SerieTheme) - [SerieTheme](#SerieTheme)
- [StageColor](#StageColor) - [StageColor](#StageColor)
- [StateStyle](#StateStyle)
- [SubTitleTheme](#SubTitleTheme) - [SubTitleTheme](#SubTitleTheme)
- [SymbolStyle](#SymbolStyle) - [SymbolStyle](#SymbolStyle)
- [TextLimit](#TextLimit) - [TextLimit](#TextLimit)
@@ -130,28 +130,26 @@
## ISerieExtraComponent ## ISerieExtraComponent
- [AreaStyle](#AreaStyle) - [AreaStyle](#AreaStyle)
- [Emphasis](#Emphasis) - [BlurStyle](#BlurStyle)
- [EmphasisItemStyle](#EmphasisItemStyle) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
- [LabelLine](#LabelLine) - [LabelLine](#LabelLine)
- [LabelStyle](#LabelStyle) - [LabelStyle](#LabelStyle)
- [LineArrow](#LineArrow) - [LineArrow](#LineArrow)
- [SelectStyle](#SelectStyle)
- [TitleStyle](#TitleStyle) - [TitleStyle](#TitleStyle)
## ISerieDataComponent ## ISerieDataComponent
- [AreaStyle](#AreaStyle) - [AreaStyle](#AreaStyle)
- [Emphasis](#Emphasis) - [BlurStyle](#BlurStyle)
- [EmphasisItemStyle](#EmphasisItemStyle) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
- [ItemStyle](#ItemStyle) - [ItemStyle](#ItemStyle)
- [LabelLine](#LabelLine) - [LabelLine](#LabelLine)
- [LabelStyle](#LabelStyle) - [LabelStyle](#LabelStyle)
- [LineStyle](#LineStyle) - [LineStyle](#LineStyle)
- [SelectStyle](#SelectStyle)
- [SerieSymbol](#SerieSymbol) - [SerieSymbol](#SerieSymbol)
- [TitleStyle](#TitleStyle) - [TitleStyle](#TitleStyle)
@@ -217,8 +215,6 @@ The style of area.
|`color`|||the color of area,default use serie color. |`color`|||the color of area,default use serie color.
|`toColor`|||Gradient color, start color to toColor. |`toColor`|||Gradient color, start color to toColor.
|`opacity`|0.6f||Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0. |`opacity`|0.6f||Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0.
|`highlightColor`|||the color of area,default use serie color.
|`highlightToColor`|||Gradient color, start highlightColor to highlightToColor.
## `ArrowStyle` ## `ArrowStyle`
@@ -440,6 +436,15 @@ Inherits or Implemented: [Serie](#Serie),[INeedSerieContainer](#INeedSerieContai
## `BaseSerie` ## `BaseSerie`
## `BlurStyle`
Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
> Since `v3.2.0`
Configurations of blur state.
## `CalendarCoord` ## `CalendarCoord`
Inherits or Implemented: [CoordSystem](#CoordSystem),[IUpdateRuntimeData](#IUpdateRuntimeData),[ISerieContainer](#ISerieContainer) Inherits or Implemented: [CoordSystem](#CoordSystem),[IUpdateRuntimeData](#IUpdateRuntimeData),[ISerieContainer](#ISerieContainer)
@@ -581,39 +586,19 @@ Inherits or Implemented: [ComponentTheme](#ComponentTheme)
Inherits or Implemented: [BaseScatter](#BaseScatter) Inherits or Implemented: [BaseScatter](#BaseScatter)
## `Emphasis` ## `EmphasisStyle`
Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent) Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的图形样式和文本标签样式。 > Since `v3.2.0`
Configurations of emphasis state.
|field|default|since|comment| |field|default|since|comment|
|--|--|--|--| |--|--|--|--|
|`show`|||是否启用高亮样式 |`scale`|1.1f||Whether to scale to highlight the data in emphasis state. 高亮时的缩放倍数
|`label`|||图形文本标签。 [LabelStyle](#LabelStyle)| |`focus`|||When the data is highlighted, whether to fade out of other data to focus the highlighted.</br>`EmphasisStyle.FocusType`:</br>- `None`: Do not fade out other data, it's by default.</br>- `Self`: Only focus (not fade out) the element of the currently highlighted data.</br>- `Series`: Focus on all elements of the series which the currently highlighted data belongs to.</br>|
|`labelLine`|||图形文本引导线样式。 [LabelLine](#LabelLine)| |`blurScope`|||The range of fade out when focus is enabled.</br>`EmphasisStyle.BlurScope`:</br>- `GridCoord`: coordinate system.</br>- `Series`: series.</br>- `Global`: global.</br>|
|`itemStyle`|||图形样式。 [ItemStyle](#ItemStyle)|
## `EmphasisItemStyle`
Inherits or Implemented: [ItemStyle](#ItemStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的图形样式
## `EmphasisLabelLine`
Inherits or Implemented: [LabelLine](#LabelLine),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的标签引导线样式
## `EmphasisLabelStyle`
Inherits or Implemented: [LabelStyle](#LabelStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的标签样式
## `EndLabelStyle` ## `EndLabelStyle`
@@ -1063,6 +1048,15 @@ Inherits or Implemented: [Serie](#Serie)
Inherits or Implemented: [BaseScatter](#BaseScatter) Inherits or Implemented: [BaseScatter](#BaseScatter)
## `SelectStyle`
Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
> Since `v3.2.0`
Configurations of select state.
## `Serie` ## `Serie`
Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable) Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
@@ -1076,6 +1070,7 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|`coordSystem`|||the chart coord system of serie. |`coordSystem`|||the chart coord system of serie.
|`serieType`|||the type of serie. |`serieType`|||the type of serie.
|`serieName`|||Series name used for displaying in tooltip and filtering with legend. |`serieName`|||Series name used for displaying in tooltip and filtering with legend.
|`state`||v3.2.0|The default state of a serie.</br>`SerieState`:</br>- `Normal`: Normal state.</br>- `Emphasis`: Emphasis state.</br>- `Blur`: Blur state.</br>- `Select`: Select state.</br>- `Auto`: Auto state.</br>|
|`stack`|||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`|||If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|`xAxisIndex`|0||the index of XAxis. |`xAxisIndex`|0||the index of XAxis.
|`yAxisIndex`|0||the index of YAxis. |`yAxisIndex`|0||the index of YAxis.
@@ -1153,6 +1148,7 @@ A data item of serie.
|`ignore`|||是否忽略数据。当为 true 时,数据不进行绘制。 |`ignore`|||是否忽略数据。当为 true 时,数据不进行绘制。
|`selected`|||Whether the data item is selected. |`selected`|||Whether the data item is selected.
|`radius`|||自定义半径。可用在饼图中自定义某个数据项的半径。 |`radius`|||自定义半径。可用在饼图中自定义某个数据项的半径。
|`state`||v3.2.0|the state of serie data.</br>`SerieState`:</br>- `Normal`: Normal state.</br>- `Emphasis`: Emphasis state.</br>- `Blur`: Blur state.</br>- `Select`: Select state.</br>- `Auto`: Auto state.</br>|
|`data`|||An arbitrary dimension data list of data item. |`data`|||An arbitrary dimension data list of data item.
## `SerieSymbol` ## `SerieSymbol`
@@ -1261,6 +1257,23 @@ Inherits or Implemented: [ChildComponent](#ChildComponent)
|`percent`|||结束位置百分比。 |`percent`|||结束位置百分比。
|`color`|||颜色。 |`color`|||颜色。
## `StateStyle`
Inherits or Implemented: [ChildComponent](#ChildComponent)
> Since `v3.2.0`
the state style of serie.
|field|default|since|comment|
|--|--|--|--|
|`show`|true||是否启用高亮样式。
|`label`|||图形文本标签。 [LabelStyle](#LabelStyle)|
|`labelLine`|||图形文本引导线样式。 [LabelLine](#LabelLine)|
|`itemStyle`|||图形样式。 [ItemStyle](#ItemStyle)|
|`lineStyle`|||折线样式。 [LineStyle](#LineStyle)|
|`areaStyle`|||区域样式。 [AreaStyle](#AreaStyle)|
## `SubTitleTheme` ## `SubTitleTheme`
Inherits or Implemented: [ComponentTheme](#ComponentTheme) Inherits or Implemented: [ComponentTheme](#ComponentTheme)

View File

@@ -85,14 +85,12 @@
- [AxisTick](#AxisTick) - [AxisTick](#AxisTick)
- [BaseAxisTheme](#BaseAxisTheme) - [BaseAxisTheme](#BaseAxisTheme)
- [BaseLine](#BaseLine) - [BaseLine](#BaseLine)
- [BlurStyle](#BlurStyle)
- [CommentItem](#CommentItem) - [CommentItem](#CommentItem)
- [CommentMarkStyle](#CommentMarkStyle) - [CommentMarkStyle](#CommentMarkStyle)
- [ComponentTheme](#ComponentTheme) - [ComponentTheme](#ComponentTheme)
- [DataZoomTheme](#DataZoomTheme) - [DataZoomTheme](#DataZoomTheme)
- [Emphasis](#Emphasis) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisItemStyle](#EmphasisItemStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [EndLabelStyle](#EndLabelStyle) - [EndLabelStyle](#EndLabelStyle)
- [IconStyle](#IconStyle) - [IconStyle](#IconStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
@@ -111,10 +109,12 @@
- [PolarAxisTheme](#PolarAxisTheme) - [PolarAxisTheme](#PolarAxisTheme)
- [RadarAxisTheme](#RadarAxisTheme) - [RadarAxisTheme](#RadarAxisTheme)
- [RadiusAxisTheme](#RadiusAxisTheme) - [RadiusAxisTheme](#RadiusAxisTheme)
- [SelectStyle](#SelectStyle)
- [SerieData](#SerieData) - [SerieData](#SerieData)
- [SerieSymbol](#SerieSymbol) - [SerieSymbol](#SerieSymbol)
- [SerieTheme](#SerieTheme) - [SerieTheme](#SerieTheme)
- [StageColor](#StageColor) - [StageColor](#StageColor)
- [StateStyle](#StateStyle)
- [SubTitleTheme](#SubTitleTheme) - [SubTitleTheme](#SubTitleTheme)
- [SymbolStyle](#SymbolStyle) - [SymbolStyle](#SymbolStyle)
- [TextLimit](#TextLimit) - [TextLimit](#TextLimit)
@@ -130,28 +130,26 @@
## ISerieExtraComponent Serie额外组件 ## ISerieExtraComponent Serie额外组件
- [AreaStyle](#AreaStyle) - [AreaStyle](#AreaStyle)
- [Emphasis](#Emphasis) - [BlurStyle](#BlurStyle)
- [EmphasisItemStyle](#EmphasisItemStyle) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
- [LabelLine](#LabelLine) - [LabelLine](#LabelLine)
- [LabelStyle](#LabelStyle) - [LabelStyle](#LabelStyle)
- [LineArrow](#LineArrow) - [LineArrow](#LineArrow)
- [SelectStyle](#SelectStyle)
- [TitleStyle](#TitleStyle) - [TitleStyle](#TitleStyle)
## ISerieDataComponent SerieData额外组件 ## ISerieDataComponent SerieData额外组件
- [AreaStyle](#AreaStyle) - [AreaStyle](#AreaStyle)
- [Emphasis](#Emphasis) - [BlurStyle](#BlurStyle)
- [EmphasisItemStyle](#EmphasisItemStyle) - [EmphasisStyle](#EmphasisStyle)
- [EmphasisLabelLine](#EmphasisLabelLine)
- [EmphasisLabelStyle](#EmphasisLabelStyle)
- [ImageStyle](#ImageStyle) - [ImageStyle](#ImageStyle)
- [ItemStyle](#ItemStyle) - [ItemStyle](#ItemStyle)
- [LabelLine](#LabelLine) - [LabelLine](#LabelLine)
- [LabelStyle](#LabelStyle) - [LabelStyle](#LabelStyle)
- [LineStyle](#LineStyle) - [LineStyle](#LineStyle)
- [SelectStyle](#SelectStyle)
- [SerieSymbol](#SerieSymbol) - [SerieSymbol](#SerieSymbol)
- [TitleStyle](#TitleStyle) - [TitleStyle](#TitleStyle)
@@ -217,8 +215,6 @@ Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent
|`color`|||区域填充的颜色如果toColor不是默认值则表示渐变色的起点颜色。 |`color`|||区域填充的颜色如果toColor不是默认值则表示渐变色的起点颜色。
|`toColor`|||渐变色的终点颜色。 |`toColor`|||渐变色的终点颜色。
|`opacity`|0.6f||图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。 |`opacity`|0.6f||图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|`highlightColor`|||高亮时区域填充的颜色如果highlightToColor不是默认值则表示渐变色的起点颜色。
|`highlightToColor`|||高亮时渐变色的终点颜色。
## `ArrowStyle` ## `ArrowStyle`
@@ -440,6 +436,15 @@ Inherits or Implemented: [Serie](#Serie),[INeedSerieContainer](#INeedSerieContai
## `BaseSerie` ## `BaseSerie`
## `BlurStyle`
Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
> 从 `v3.2.0` 开始支持
淡出状态样式。
## `CalendarCoord` ## `CalendarCoord`
Inherits or Implemented: [CoordSystem](#CoordSystem),[IUpdateRuntimeData](#IUpdateRuntimeData),[ISerieContainer](#ISerieContainer) Inherits or Implemented: [CoordSystem](#CoordSystem),[IUpdateRuntimeData](#IUpdateRuntimeData),[ISerieContainer](#ISerieContainer)
@@ -581,39 +586,19 @@ Inherits or Implemented: [ComponentTheme](#ComponentTheme)
Inherits or Implemented: [BaseScatter](#BaseScatter) Inherits or Implemented: [BaseScatter](#BaseScatter)
## `Emphasis` ## `EmphasisStyle`
Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent) Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的图形样式和文本标签样式。 > 从 `v3.2.0` 开始支持
高亮状态样式。
|field|default|since|comment| |field|default|since|comment|
|--|--|--|--| |--|--|--|--|
|`show`|||是否启用高亮样式 |`scale`|1.1f||Whether to scale to highlight the data in emphasis state. 高亮时的缩放倍数
|`label`|||图形文本标签。 [LabelStyle](#LabelStyle)| |`focus`|||在高亮图形时,是否淡出其它数据的图形已达到聚焦的效果。</br>`EmphasisStyle.FocusType`:</br>- `None`: 不淡出其它图形,默认使用该配置。</br>- `Self`: 只聚焦(不淡出)当前高亮的数据的图形。</br>- `Series`: 聚焦当前高亮的数据所在的系列的所有图形。</br>|
|`labelLine`|||图形文本引导线样式。 [LabelLine](#LabelLine)| |`blurScope`|||在开启focus的时候可以通过blurScope配置淡出的范围。</br>`EmphasisStyle.BlurScope`:</br>- `GridCoord`: 淡出范围为坐标系,默认使用该配置。</br>- `Series`: 淡出范围为系列。</br>- `Global`: 淡出范围为全局。</br>|
|`itemStyle`|||图形样式。 [ItemStyle](#ItemStyle)|
## `EmphasisItemStyle`
Inherits or Implemented: [ItemStyle](#ItemStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的图形样式
## `EmphasisLabelLine`
Inherits or Implemented: [LabelLine](#LabelLine),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的标签引导线样式
## `EmphasisLabelStyle`
Inherits or Implemented: [LabelStyle](#LabelStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
高亮的标签样式
## `EndLabelStyle` ## `EndLabelStyle`
@@ -1063,6 +1048,15 @@ Inherits or Implemented: [Serie](#Serie)
Inherits or Implemented: [BaseScatter](#BaseScatter) Inherits or Implemented: [BaseScatter](#BaseScatter)
## `SelectStyle`
Inherits or Implemented: [StateStyle](#StateStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
> 从 `v3.2.0` 开始支持
选中状态样式。
## `Serie` ## `Serie`
Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable) Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
@@ -1076,6 +1070,7 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|`coordSystem`|||使用的坐标系。 |`coordSystem`|||使用的坐标系。
|`serieType`|||系列类型。 |`serieType`|||系列类型。
|`serieName`|||系列名称,用于 tooltip 的显示legend 的图例筛选。 |`serieName`|||系列名称,用于 tooltip 的显示legend 的图例筛选。
|`state`||v3.2.0|系列的默认状态。</br>`SerieState`:</br>- `Normal`: 正常状态。</br>- `Emphasis`: 高亮状态。</br>- `Blur`: 淡出状态。</br>- `Select`: 选中状态。</br>- `Auto`: 自动保持和父节点一致。一般用在SerieData。</br>|
|`stack`|||数据堆叠同个类目轴上系列配置相同的stack值后后一个系列的值会在前一个系列的值上相加。 |`stack`|||数据堆叠同个类目轴上系列配置相同的stack值后后一个系列的值会在前一个系列的值上相加。
|`xAxisIndex`|0||使用X轴的index。 |`xAxisIndex`|0||使用X轴的index。
|`yAxisIndex`|0||使用Y轴的index。 |`yAxisIndex`|0||使用Y轴的index。
@@ -1153,6 +1148,7 @@ Inherits or Implemented: [ChildComponent](#ChildComponent)
|`ignore`|||是否忽略数据。当为 true 时,数据不进行绘制。 |`ignore`|||是否忽略数据。当为 true 时,数据不进行绘制。
|`selected`|||该数据项是否被选中。 |`selected`|||该数据项是否被选中。
|`radius`|||自定义半径。可用在饼图中自定义某个数据项的半径。 |`radius`|||自定义半径。可用在饼图中自定义某个数据项的半径。
|`state`||v3.2.0|数据项的默认状态。</br>`SerieState`:</br>- `Normal`: 正常状态。</br>- `Emphasis`: 高亮状态。</br>- `Blur`: 淡出状态。</br>- `Select`: 选中状态。</br>- `Auto`: 自动保持和父节点一致。一般用在SerieData。</br>|
|`data`|||可指定任意维数的数值列表。 |`data`|||可指定任意维数的数值列表。
## `SerieSymbol` ## `SerieSymbol`
@@ -1261,6 +1257,23 @@ Inherits or Implemented: [ChildComponent](#ChildComponent)
|`percent`|||结束位置百分比。 |`percent`|||结束位置百分比。
|`color`|||颜色。 |`color`|||颜色。
## `StateStyle`
Inherits or Implemented: [ChildComponent](#ChildComponent)
> 从 `v3.2.0` 开始支持
Serie的状态样式。Serie的状态有正常高亮淡出选中四种状态。
|field|default|since|comment|
|--|--|--|--|
|`show`|true||是否启用高亮样式。
|`label`|||图形文本标签。 [LabelStyle](#LabelStyle)|
|`labelLine`|||图形文本引导线样式。 [LabelLine](#LabelLine)|
|`itemStyle`|||图形样式。 [ItemStyle](#ItemStyle)|
|`lineStyle`|||折线样式。 [LineStyle](#LineStyle)|
|`areaStyle`|||区域样式。 [AreaStyle](#AreaStyle)|
## `SubTitleTheme` ## `SubTitleTheme`
Inherits or Implemented: [ComponentTheme](#ComponentTheme) Inherits or Implemented: [ComponentTheme](#ComponentTheme)

View File

@@ -17,8 +17,6 @@ namespace XCharts.Editor
PropertyField(prop, "m_Origin"); PropertyField(prop, "m_Origin");
PropertyField(prop, "m_Color"); PropertyField(prop, "m_Color");
PropertyField(prop, "m_ToColor"); PropertyField(prop, "m_ToColor");
PropertyField(prop, "m_HighlightColor");
PropertyField(prop, "m_HighlightToColor");
PropertyField(prop, "m_Opacity"); PropertyField(prop, "m_Opacity");
--EditorGUI.indentLevel; --EditorGUI.indentLevel;
} }

View File

@@ -1,43 +0,0 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(Emphasis), true)]
public class EmphasisDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Emphasis"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Label");
PropertyField(prop, "m_LabelLine");
PropertyField(prop, "m_ItemStyle");
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(EmphasisItemStyle), true)]
public class EmphasisItemStyleDrawer : ItemStyleDrawer
{
public override string ClassName { get { return "EmphasisItemStyle"; } }
}
[CustomPropertyDrawer(typeof(EmphasisLabelStyle), true)]
public class EmphasisLabelStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "EmphasisLabel"; } }
}
[CustomPropertyDrawer(typeof(EmphasisLabelLine), true)]
public class EmphasisLabelLineDrawer : LabelLineDrawer
{
public override string ClassName { get { return "EmphasisLabelLine"; } }
}
}

View File

@@ -0,0 +1,54 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(StateStyle), true)]
public class StateStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "StateStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
OnCustomGUI(prop);
PropertyField(prop, "m_ItemStyle");
PropertyField(prop, "m_Label");
PropertyField(prop, "m_LabelLine");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_AreaStyle");
--EditorGUI.indentLevel;
}
}
protected virtual void OnCustomGUI(SerializedProperty prop) { }
}
[CustomPropertyDrawer(typeof(EmphasisStyle), true)]
public class EmphasisStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "EmphasisStyle"; } }
protected override void OnCustomGUI(SerializedProperty prop)
{
PropertyField(prop, "m_Scale");
PropertyField(prop, "m_Focus");
PropertyField(prop, "m_BlurScope");
}
}
[CustomPropertyDrawer(typeof(BlurStyle), true)]
public class BlurStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "BlurStyle"; } }
}
[CustomPropertyDrawer(typeof(SelectStyle), true)]
public class SelectStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "SelectStyle"; } }
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6e0b1690532674b24952a87e0aead6fa guid: 3aad8ee99115742729ec5a963274fae0
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -16,7 +16,6 @@ namespace XCharts.Editor
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
++EditorGUI.indentLevel; ++EditorGUI.indentLevel;
//PropertyField("m_InsertDataToHead");
PropertyField("m_SerieName"); PropertyField("m_SerieName");
if (m_CoordOptionsNames != null && m_CoordOptionsNames.Count > 1) if (m_CoordOptionsNames != null && m_CoordOptionsNames.Count > 1)
{ {
@@ -28,6 +27,7 @@ namespace XCharts.Editor
serie.coordSystem = m_CoordOptionsDic[typeName].Name; serie.coordSystem = m_CoordOptionsDic[typeName].Name;
} }
} }
PropertyField("m_State");
OnCustomInspectorGUI(); OnCustomInspectorGUI();
OnExtraInspectorGUI(); OnExtraInspectorGUI();
PropertyFieldData(); PropertyFieldData();
@@ -189,9 +189,8 @@ namespace XCharts.Editor
{ {
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
var serieData = m_Datas.GetArrayElementAtIndex(index); var serieData = m_Datas.GetArrayElementAtIndex(index);
var m_Name = serieData.FindPropertyRelative("m_Name"); PropertyField(serieData.FindPropertyRelative("m_Name"));
PropertyField(serieData.FindPropertyRelative("m_State"));
PropertyField(m_Name);
if (serie.GetType().IsDefined(typeof(SerieDataExtraFieldAttribute), false)) if (serie.GetType().IsDefined(typeof(SerieDataExtraFieldAttribute), false))
{ {
var attribute = serie.GetType().GetAttribute<SerieDataExtraFieldAttribute>(); var attribute = serie.GetType().GetAttribute<SerieDataExtraFieldAttribute>();

View File

@@ -47,10 +47,10 @@ namespace XCharts.Example
serie.itemStyle.borderColor = Color.clear; serie.itemStyle.borderColor = Color.clear;
//设置高亮样式 //设置高亮样式
serie.AddExtraComponent<EmphasisItemStyle>(); var emphasisStyle = serie.AddExtraComponent<EmphasisStyle>();
serie.emphasisItemStyle.show = true; emphasisStyle.itemStyle.show = true;
serie.emphasisItemStyle.borderWidth = 1; emphasisStyle.itemStyle.borderWidth = 1;
serie.emphasisItemStyle.borderColor = Color.black; emphasisStyle.itemStyle.borderColor = Color.black;
//设置视觉映射组件 //设置视觉映射组件
var visualMap = chart.GetChartComponent<VisualMap>(); var visualMap = chart.GetChartComponent<VisualMap>();

View File

@@ -37,8 +37,6 @@ namespace XCharts.Runtime
[SerializeField] private Color32 m_Color; [SerializeField] private Color32 m_Color;
[SerializeField] private Color32 m_ToColor; [SerializeField] private Color32 m_ToColor;
[SerializeField][Range(0, 1)] private float m_Opacity = 0.6f; [SerializeField][Range(0, 1)] private float m_Opacity = 0.6f;
[SerializeField] private Color32 m_HighlightColor;
[SerializeField] private Color32 m_HighlightToColor;
/// <summary> /// <summary>
/// Set this to false to prevent the areafrom showing. /// Set this to false to prevent the areafrom showing.
@@ -85,24 +83,6 @@ namespace XCharts.Runtime
get { return m_Opacity; } get { return m_Opacity; }
set { if (PropertyUtil.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); } set { if (PropertyUtil.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); }
} }
/// <summary>
/// the color of area,default use serie color.
/// |高亮时区域填充的颜色如果highlightToColor不是默认值则表示渐变色的起点颜色。
/// </summary>
public Color32 highlightColor
{
get { return m_HighlightColor; }
set { if (PropertyUtil.SetColor(ref m_HighlightColor, value)) SetVerticesDirty(); }
}
/// <summary>
/// Gradient color, start highlightColor to highlightToColor.
/// |高亮时渐变色的终点颜色。
/// </summary>
public Color32 highlightToColor
{
get { return m_HighlightToColor; }
set { if (PropertyUtil.SetColor(ref m_HighlightToColor, value)) SetVerticesDirty(); }
}
public Color32 GetColor() public Color32 GetColor()
{ {

View File

@@ -1,11 +0,0 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// 高亮的图形样式
/// </summary>
[System.Serializable]
public class EmphasisItemStyle : ItemStyle, ISerieExtraComponent, ISerieDataComponent
{ }
}

View File

@@ -1,11 +0,0 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// 高亮的标签引导线样式
/// </summary>
[System.Serializable]
public class EmphasisLabelLine : LabelLine, ISerieExtraComponent, ISerieDataComponent
{ }
}

View File

@@ -1,11 +0,0 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// 高亮的标签样式
/// </summary>
[System.Serializable]
public class EmphasisLabelStyle : LabelStyle, ISerieExtraComponent, ISerieDataComponent
{ }
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3e025b0f4be6d4141aa08bdad0102aa7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -62,7 +62,7 @@ namespace XCharts.Runtime
UpdateRuntimeData(markArea); UpdateRuntimeData(markArea);
var colorIndex = chart.GetLegendRealShowNameIndex(serie.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serie.legendName);
var serieColor = SerieHelper.GetLineColor(serie, null, chart.theme, colorIndex, false); var serieColor = SerieHelper.GetLineColor(serie, null, chart.theme, colorIndex, SerieState.Normal);
var areaColor = markArea.itemStyle.GetColor(serieColor); var areaColor = markArea.itemStyle.GetColor(serieColor);
UGL.DrawRectangle(vh, markArea.runtimeRect, areaColor, areaColor); UGL.DrawRectangle(vh, markArea.runtimeRect, areaColor, areaColor);
} }

View File

@@ -100,7 +100,7 @@ namespace XCharts.Runtime
var sp = Vector3.zero; var sp = Vector3.zero;
var ep = Vector3.zero; var ep = Vector3.zero;
var colorIndex = chart.GetLegendRealShowNameIndex(serie.serieName); var colorIndex = chart.GetLegendRealShowNameIndex(serie.serieName);
var serieColor = SerieHelper.GetLineColor(serie, null, chart.theme, colorIndex, false); var serieColor = SerieHelper.GetLineColor(serie, null, chart.theme, colorIndex, SerieState.Normal);
animation.InitProgress(0, 1f); animation.InitProgress(0, 1f);
ResetTempMarkLineGroupData(markLine); ResetTempMarkLineGroupData(markLine);
if (m_TempGroupData.Count > 0) if (m_TempGroupData.Count > 0)
@@ -242,9 +242,9 @@ namespace XCharts.Runtime
private void DrawMarkLineSymbol(VertexHelper vh, SymbolStyle symbol, Serie serie, GridCoord grid, ThemeStyle theme, private void DrawMarkLineSymbol(VertexHelper vh, SymbolStyle symbol, Serie serie, GridCoord grid, ThemeStyle theme,
Vector3 pos, Vector3 startPos, Color32 lineColor) Vector3 pos, Vector3 startPos, Color32 lineColor)
{ {
var tickness = SerieHelper.GetSymbolBorder(serie, null, theme, false); var tickness = SerieHelper.GetSymbolBorder(serie, null, theme);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, null, theme, false); var borderColor = SerieHelper.GetSymbolBorderColor(serie, null, theme);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, null, false); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, null);
chart.DrawClipSymbol(vh, symbol.type, symbol.size, tickness, pos, lineColor, lineColor, chart.DrawClipSymbol(vh, symbol.type, symbol.size, tickness, pos, lineColor, lineColor,
ColorUtil.clearColor32, borderColor, symbol.gap, true, cornerRadius, grid, startPos); ColorUtil.clearColor32, borderColor, symbol.gap, true, cornerRadius, grid, startPos);
} }

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4cd4074bb11fc40059363dd78b9ee98d guid: ca1088963feb54117bce8be6bceb64de
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Configurations of blur state.
/// |淡出状态样式。
/// </summary>
[System.Serializable]
[Since("v3.2.0")]
public class BlurStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
{ }
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7de9b5e4c5d474fdd88ebb89f0924305 guid: 4e3f901db80454f89800a84977289535
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -0,0 +1,90 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Configurations of emphasis state.
/// |高亮状态样式。
/// </summary>
[System.Serializable]
[Since("v3.2.0")]
public class EmphasisStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
{
/// <summary>
/// focus type.
/// |聚焦类型。
/// </summary>
public enum FocusType
{
/// <summary>
/// Do not fade out other data, it's by default.
/// |不淡出其它图形,默认使用该配置。
/// </summary>
None,
/// <summary>
/// Only focus (not fade out) the element of the currently highlighted data.
/// |只聚焦(不淡出)当前高亮的数据的图形。
/// </summary>
Self,
/// <summary>
/// Focus on all elements of the series which the currently highlighted data belongs to.
/// |聚焦当前高亮的数据所在的系列的所有图形。
/// </summary>
Series
}
/// <summary>
/// blur scope.
/// |淡出范围。
/// </summary>
public enum BlurScope
{
/// <summary>
/// coordinate system.
/// |淡出范围为坐标系,默认使用该配置。
/// </summary>
GridCoord,
/// <summary>
/// series.
/// |淡出范围为系列。
/// </summary>
Series,
/// <summary>
/// global.
/// |淡出范围为全局。
/// </summary>
Global
}
[SerializeField] private float m_Scale = 1.1f;
[SerializeField] private FocusType m_Focus = FocusType.None;
[SerializeField] private BlurScope m_BlurScope = BlurScope.GridCoord;
/// <summary>
/// Whether to scale to highlight the data in emphasis state.
/// |高亮时的缩放倍数。
/// </summary>
public float scale
{
get { return m_Scale; }
set { if (PropertyUtil.SetStruct(ref m_Scale, value)) SetVerticesDirty(); }
}
/// <summary>
/// When the data is highlighted, whether to fade out of other data to focus the highlighted.
/// |在高亮图形时,是否淡出其它数据的图形已达到聚焦的效果。
/// </summary>
public FocusType focus
{
get { return m_Focus; }
set { if (PropertyUtil.SetStruct(ref m_Focus, value)) SetVerticesDirty(); }
}
/// <summary>
/// The range of fade out when focus is enabled.
/// |在开启focus的时候可以通过blurScope配置淡出的范围。
/// </summary>
public BlurScope blurScope
{
get { return m_BlurScope; }
set { if (PropertyUtil.SetStruct(ref m_BlurScope, value)) SetVerticesDirty(); }
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a0d9ff3b8e09d464e9b5ea996b941314 guid: 91a31f424478042418811c32bb8aa2d5
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Configurations of select state.
/// |选中状态样式。
/// </summary>
[System.Serializable]
[Since("v3.2.0")]
public class SelectStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
{ }
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5d1095175540449f99bb9da27a5aaf04 guid: 986a9b6da6fdd48c49a9b665450dd605
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -3,15 +3,19 @@ using UnityEngine;
namespace XCharts.Runtime namespace XCharts.Runtime
{ {
/// <summary> /// <summary>
/// 高亮的图形样式和文本标签样式。 /// the state style of serie.
/// |Serie的状态样式。Serie的状态有正常高亮淡出选中四种状态。
/// </summary> /// </summary>
[System.Serializable] [System.Serializable]
public class Emphasis : ChildComponent, ISerieExtraComponent, ISerieDataComponent [Since("v3.2.0")]
public class StateStyle : ChildComponent
{ {
[SerializeField] private bool m_Show; [SerializeField] private bool m_Show = true;
[SerializeField] private LabelStyle m_Label = new LabelStyle(); [SerializeField] private LabelStyle m_Label = new LabelStyle();
[SerializeField] private LabelLine m_LabelLine = new LabelLine(); [SerializeField] private LabelLine m_LabelLine = new LabelLine();
[SerializeField] private ItemStyle m_ItemStyle = new ItemStyle(); [SerializeField] private ItemStyle m_ItemStyle = new ItemStyle();
[SerializeField] private LineStyle m_LineStyle = new LineStyle();
[SerializeField] private AreaStyle m_AreaStyle = new AreaStyle();
public void Reset() public void Reset()
{ {
@@ -53,22 +57,57 @@ namespace XCharts.Runtime
get { return m_ItemStyle; } get { return m_ItemStyle; }
set { if (PropertyUtil.SetClass(ref m_ItemStyle, value, true)) SetVerticesDirty(); } set { if (PropertyUtil.SetClass(ref m_ItemStyle, value, true)) SetVerticesDirty(); }
} }
/// <summary>
/// 折线样式。
/// </summary>
public LineStyle lineStyle
{
get { return m_LineStyle; }
set { if (PropertyUtil.SetClass(ref m_LineStyle, value, true)) SetVerticesDirty(); }
}
/// <summary>
/// 区域样式。
/// </summary>
public AreaStyle areaStyle
{
get { return m_AreaStyle; }
set { if (PropertyUtil.SetClass(ref m_AreaStyle, value, true)) SetVerticesDirty(); }
}
public override bool vertsDirty { get { return m_VertsDirty || label.vertsDirty || itemStyle.vertsDirty; } } public override bool vertsDirty
{
get
{
return m_VertsDirty ||
m_Label.vertsDirty ||
m_ItemStyle.vertsDirty ||
m_LineStyle.vertsDirty ||
m_AreaStyle.vertsDirty;
}
}
public override bool componentDirty { get { return m_ComponentDirty || label.componentDirty; } } public override bool componentDirty
{
get
{
return m_ComponentDirty ||
m_Label.componentDirty;
}
}
public override void ClearVerticesDirty() public override void ClearVerticesDirty()
{ {
base.ClearVerticesDirty(); base.ClearVerticesDirty();
label.ClearVerticesDirty(); m_Label.ClearVerticesDirty();
itemStyle.ClearVerticesDirty(); m_ItemStyle.ClearVerticesDirty();
m_LineStyle.ClearVerticesDirty();
m_AreaStyle.ClearVerticesDirty();
} }
public override void ClearComponentDirty() public override void ClearComponentDirty()
{ {
base.ClearComponentDirty(); base.ClearComponentDirty();
label.ClearComponentDirty(); m_Label.ClearComponentDirty();
} }
} }
} }

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 921539f841914493a90f748c6c6662dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -544,17 +544,25 @@ namespace XCharts.Runtime
return theme.GetBackgroundColor(background); return theme.GetBackgroundColor(background);
} }
public Color32 GetItemColor(Serie serie, SerieData serieData, bool highlight = false) public Color32 GetItemColor(Serie serie, SerieData serieData)
{ {
var colorIndex = serieData == null || !serie.useDataNameForColor ? Color32 color, toColor;
GetLegendRealShowNameIndex(serie.legendName) : SerieHelper.GetItemColor(out color, out toColor, serie, serieData, m_Theme);
GetLegendRealShowNameIndex(serieData.legendName); return color;
return SerieHelper.GetItemColor(serie, serieData, m_Theme, colorIndex, highlight);
} }
public Color32 GetItemColor(Serie serie, bool highlight = false) public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)
{ {
return SerieHelper.GetItemColor(serie, null, m_Theme, serie.context.colorIndex, highlight); Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, m_Theme, colorIndex);
return color;
}
public Color32 GetItemColor(Serie serie)
{
Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, null, m_Theme);
return color;
} }
} }
} }

View File

@@ -27,6 +27,28 @@ namespace XCharts.Runtime
public SerieHandler handler { get; set; } public SerieHandler handler { get; set; }
public static void ClearVerticesDirty(ChildComponent component)
{
if (component != null)
component.ClearVerticesDirty();
}
public static void ClearComponentDirty(ChildComponent component)
{
if (component != null)
component.ClearComponentDirty();
}
public static bool IsVertsDirty(ChildComponent component)
{
return component == null?false : component.vertsDirty;
}
public static bool IsComponentDirty(ChildComponent component)
{
return component == null?false : component.componentDirty;
}
public virtual void SetVerticesDirty() public virtual void SetVerticesDirty()
{ {
m_VertsDirty = true; m_VertsDirty = true;
@@ -47,8 +69,7 @@ namespace XCharts.Runtime
m_ComponentDirty = false; m_ComponentDirty = false;
} }
public virtual void ClearData() public virtual void ClearData() { }
{ }
public virtual void ClearDirty() public virtual void ClearDirty()
{ {
@@ -68,11 +89,9 @@ namespace XCharts.Runtime
handler.RemoveComponent(); handler.RemoveComponent();
} }
public virtual void OnDataUpdate() public virtual void OnDataUpdate() { }
{ }
public virtual void OnBeforeSerialize() public virtual void OnBeforeSerialize() { }
{ }
public virtual void OnAfterDeserialize() public virtual void OnAfterDeserialize()
{ {

View File

@@ -28,6 +28,28 @@ namespace XCharts.Runtime
public Action refreshComponent { get; set; } public Action refreshComponent { get; set; }
public GameObject gameObject { get; set; } public GameObject gameObject { get; set; }
public static void ClearVerticesDirty(ChildComponent component)
{
if (component != null)
component.ClearVerticesDirty();
}
public static void ClearComponentDirty(ChildComponent component)
{
if (component != null)
component.ClearComponentDirty();
}
public static bool IsVertsDirty(ChildComponent component)
{
return component == null?false : component.vertsDirty;
}
public static bool IsComponentDirty(ChildComponent component)
{
return component == null?false : component.componentDirty;
}
public virtual void SetVerticesDirty() public virtual void SetVerticesDirty()
{ {
m_VertsDirty = true; m_VertsDirty = true;

View File

@@ -845,6 +845,22 @@ namespace XCharts.Runtime
return newColor; return newColor;
} }
public static Color32 GetBlurColor(Color32 color, float a = 0.3f)
{
var newColor = color;
newColor.a = (byte) (a * 255);
return newColor;
}
public static Color32 GetSelectColor(Color32 color, float rate = 0.7f)
{
var newColor = color;
newColor.r = (byte) (color.r * rate);
newColor.g = (byte) (color.g * rate);
newColor.b = (byte) (color.b * rate);
return newColor;
}
public static bool IsPointInQuadrilateral(Vector3 P, Vector3 A, Vector3 B, Vector3 C, Vector3 D) public static bool IsPointInQuadrilateral(Vector3 P, Vector3 A, Vector3 B, Vector3 C, Vector3 D)
{ {
Vector3 v0 = Vector3.Cross(A - D, P - D); Vector3 v0 = Vector3.Cross(A - D, P - D);

View File

@@ -5,8 +5,8 @@ namespace XCharts.Runtime
[SerieConvert(typeof(Line), typeof(Pie))] [SerieConvert(typeof(Line), typeof(Pie))]
[RequireChartComponent(typeof(GridCoord))] [RequireChartComponent(typeof(GridCoord))]
[DefaultAnimation(AnimationType.BottomToTop)] [DefaultAnimation(AnimationType.BottomToTop)]
[SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Ignore")] [SerieDataExtraField("m_Ignore")]
public class Bar : Serie, INeedSerieContainer public class Bar : Serie, INeedSerieContainer
{ {

View File

@@ -81,14 +81,14 @@ namespace XCharts.Runtime
return; return;
} }
m_LastCheckContextFlag = needCheck; m_LastCheckContextFlag = needCheck;
Color32 color, toColor;
if (m_LegendEnter) if (m_LegendEnter)
{ {
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
foreach (var serieData in serie.data) foreach (var serieData in serie.data)
{ {
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, true); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, true); serieData.interact.SetColor(ref needInteract, color, toColor);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
} }
else else
@@ -103,18 +103,14 @@ namespace XCharts.Runtime
serie.context.pointerItemDataIndex = serieData.index; serie.context.pointerItemDataIndex = serieData.index;
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serieData.context.highlight = true; serieData.context.highlight = true;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Emphasis);
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, true);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, true);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
else else
{ {
serieData.context.highlight = false; serieData.context.highlight = false;
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Normal);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, false);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
serieData.interact.SetColor(ref needInteract, color, toColor);
} }
} }
if (needInteract) if (needInteract)
@@ -190,18 +186,18 @@ namespace XCharts.Runtime
if (serieData.IsDataChanged()) if (serieData.IsDataChanged())
dataChanging = true; dataChanging = true;
var highlight = serieData.context.highlight || serie.highlight; var state = SerieHelper.GetSerieState(serie, serieData);
var itemStyle = SerieHelper.GetItemStyle(serie, serieData, highlight); var itemStyle = SerieHelper.GetItemStyle(serie, serieData, state);
var value = axis.IsCategory() ? i : serieData.GetData(0, axis.inverse); var value = axis.IsCategory() ? i : serieData.GetData(0, axis.inverse);
var relativedValue = serieData.GetCurrData(1, dataChangeDuration, relativedAxis.inverse, yMinValue, yMaxValue); var relativedValue = serieData.GetCurrData(1, dataChangeDuration, relativedAxis.inverse, yMinValue, yMaxValue);
var borderWidth = relativedValue == 0 ? 0 : itemStyle.runtimeBorderWidth; var borderWidth = relativedValue == 0 ? 0 : itemStyle.runtimeBorderWidth;
var borderGap = relativedValue == 0 ? 0 : itemStyle.borderGap; var borderGap = relativedValue == 0 ? 0 : itemStyle.borderGap;
var borderGapAndWidth = borderWidth + borderGap; var borderGapAndWidth = borderWidth + borderGap;
var backgroundColor = itemStyle.backgroundColor;
if (!serieData.interact.TryGetColor(ref areaColor, ref areaToColor, ref interacting)) if (!serieData.interact.TryGetColor(ref areaColor, ref areaToColor, ref interacting))
{ {
areaColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, highlight); SerieHelper.GetItemColor(out areaColor, out areaToColor, serie, serieData, chart.theme);
areaToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, highlight);
serieData.interact.SetColor(ref interacting, areaColor, areaToColor); serieData.interact.SetColor(ref interacting, areaColor, areaToColor);
} }
@@ -242,11 +238,11 @@ namespace XCharts.Runtime
{ {
case BarType.Normal: case BarType.Normal:
case BarType.Capsule: case BarType.Capsule:
DrawNormalBar(vh, serie, serieData, itemStyle, colorIndex, highlight, gap, barWidth, DrawNormalBar(vh, serie, serieData, itemStyle, backgroundColor, gap, barWidth,
pX, pY, plb, plt, prt, prb, isY, m_SerieGrid, axis, areaColor, areaToColor, relativedValue); pX, pY, plb, plt, prt, prb, isY, m_SerieGrid, axis, areaColor, areaToColor, relativedValue);
break; break;
case BarType.Zebra: case BarType.Zebra:
DrawZebraBar(vh, serie, serieData, itemStyle, colorIndex, highlight, gap, barWidth, DrawZebraBar(vh, serie, serieData, itemStyle, backgroundColor, gap, barWidth,
pX, pY, plb, plt, prt, prb, isY, m_SerieGrid, axis, areaColor, areaToColor); pX, pY, plb, plt, prt, prb, isY, m_SerieGrid, axis, areaColor, areaToColor);
break; break;
} }
@@ -366,12 +362,11 @@ namespace XCharts.Runtime
} }
} }
private void DrawNormalBar(VertexHelper vh, Serie serie, SerieData serieData, ItemStyle itemStyle, int colorIndex, private void DrawNormalBar(VertexHelper vh, Serie serie, SerieData serieData, ItemStyle itemStyle, Color32 backgroundColor,
bool highlight, float gap, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt, float gap, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt,
Vector3 prb, bool isYAxis, GridCoord grid, Axis axis, Color32 areaColor, Color32 areaToColor, double value) Vector3 prb, bool isYAxis, GridCoord grid, Axis axis, Color32 areaColor, Color32 areaToColor, double value)
{ {
var borderWidth = itemStyle.runtimeBorderWidth; var borderWidth = itemStyle.runtimeBorderWidth;
var backgroundColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, colorIndex, highlight, false);
var cornerRadius = serie.barType == BarType.Capsule && !itemStyle.IsNeedCorner() ? var cornerRadius = serie.barType == BarType.Capsule && !itemStyle.IsNeedCorner() ?
m_CapusleDefaultCornerRadius : m_CapusleDefaultCornerRadius :
itemStyle.cornerRadius; itemStyle.cornerRadius;
@@ -395,11 +390,10 @@ namespace XCharts.Runtime
} }
} }
private void DrawZebraBar(VertexHelper vh, Serie serie, SerieData serieData, ItemStyle itemStyle, int colorIndex, private void DrawZebraBar(VertexHelper vh, Serie serie, SerieData serieData, ItemStyle itemStyle, Color32 backgroundColor,
bool highlight, float gap, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt, float gap, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt,
Vector3 prb, bool isYAxis, GridCoord grid, Axis axis, Color32 barColor, Color32 barToColor) Vector3 prb, bool isYAxis, GridCoord grid, Axis axis, Color32 barColor, Color32 barToColor)
{ {
var backgroundColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, colorIndex, highlight, false);
if (!ChartHelper.IsClearColor(backgroundColor)) if (!ChartHelper.IsClearColor(backgroundColor))
{ {
UGL.DrawRoundRectangle(vh, serieData.context.backgroundRect, backgroundColor, backgroundColor, 0, UGL.DrawRoundRectangle(vh, serieData.context.backgroundRect, backgroundColor, backgroundColor, 0,

View File

@@ -37,6 +37,7 @@ namespace XCharts.Runtime
var needCheck = (chart.isPointerInChart && m_SerieGrid.IsPointerEnter()) || m_LegendEnter; var needCheck = (chart.isPointerInChart && m_SerieGrid.IsPointerEnter()) || m_LegendEnter;
var needInteract = false; var needInteract = false;
Color32 color, toColor;
if (!needCheck) if (!needCheck)
{ {
if (m_LastCheckContextFlag != needCheck) if (m_LastCheckContextFlag != needCheck)
@@ -46,9 +47,8 @@ namespace XCharts.Runtime
serie.context.pointerEnter = false; serie.context.pointerEnter = false;
foreach (var serieData in serie.data) foreach (var serieData in serie.data)
{ {
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Normal);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, false); serieData.interact.SetColor(ref needInteract, color, toColor);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
if (needInteract) if (needInteract)
{ {
@@ -63,9 +63,8 @@ namespace XCharts.Runtime
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
foreach (var serieData in serie.data) foreach (var serieData in serie.data)
{ {
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, true); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Emphasis);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, true); serieData.interact.SetColor(ref needInteract, color, toColor);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
} }
else else
@@ -80,16 +79,14 @@ namespace XCharts.Runtime
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serieData.context.highlight = true; serieData.context.highlight = true;
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, true); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Emphasis);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, true); serieData.interact.SetColor(ref needInteract, color, toColor);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
else else
{ {
serieData.context.highlight = false; serieData.context.highlight = false;
var barColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, SerieState.Normal);
var barToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serie.context.colorIndex, false); serieData.interact.SetColor(ref needInteract, color, toColor);
serieData.interact.SetColor(ref needInteract, barColor, barToColor);
} }
} }
} }
@@ -162,15 +159,14 @@ namespace XCharts.Runtime
dataChanging = true; dataChanging = true;
var highlight = serieData.context.highlight || serie.highlight; var highlight = serieData.context.highlight || serie.highlight;
var itemStyle = SerieHelper.GetItemStyle(serie, serieData, highlight); var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
var value = axis.IsCategory() ? i : serieData.GetData(0, axis.inverse); var value = axis.IsCategory() ? i : serieData.GetData(0, axis.inverse);
var relativedValue = serieData.GetCurrData(1, dataChangeDuration, relativedAxis.inverse, yMinValue, yMaxValue); var relativedValue = serieData.GetCurrData(1, dataChangeDuration, relativedAxis.inverse, yMinValue, yMaxValue);
var borderWidth = relativedValue == 0 ? 0 : itemStyle.runtimeBorderWidth; var borderWidth = relativedValue == 0 ? 0 : itemStyle.runtimeBorderWidth;
if (!serieData.interact.TryGetColor(ref areaColor, ref areaToColor, ref interacting)) if (!serieData.interact.TryGetColor(ref areaColor, ref areaToColor, ref interacting))
{ {
areaColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, highlight); SerieHelper.GetItemColor(out areaColor, out areaToColor, serie, serieData, chart.theme);
areaToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, highlight);
serieData.interact.SetColor(ref interacting, areaColor, areaToColor); serieData.interact.SetColor(ref interacting, areaColor, areaToColor);
} }

View File

@@ -6,7 +6,7 @@ namespace XCharts.Runtime
[SerieHandler(typeof(CandlestickHandler), true)] [SerieHandler(typeof(CandlestickHandler), true)]
[DefaultAnimation(AnimationType.LeftToRight)] [DefaultAnimation(AnimationType.LeftToRight)]
[SerieExtraComponent()] [SerieExtraComponent()]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(EmphasisItemStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()] [SerieDataExtraField()]
public class Candlestick : Serie, INeedSerieContainer public class Candlestick : Serie, INeedSerieContainer
{ {

View File

@@ -29,7 +29,7 @@ namespace XCharts.Runtime
title = category; title = category;
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); var color = chart.GetItemColor(serie, serieData);
var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker); var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker);
var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter); var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter); var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
@@ -113,8 +113,8 @@ namespace XCharts.Runtime
serie.context.dataPoints.Add(Vector3.zero); serie.context.dataPoints.Add(Vector3.zero);
continue; continue;
} }
var highlight = serie.data[i].context.highlight || serie.highlight; var state = SerieHelper.GetSerieState(serie, serieData);
var itemStyle = SerieHelper.GetItemStyle(serie, serieData, highlight); var itemStyle = SerieHelper.GetItemStyle(serie, serieData, state);
var open = serieData.GetCurrData(0, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue); var open = serieData.GetCurrData(0, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var close = serieData.GetCurrData(1, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue); var close = serieData.GetCurrData(1, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var lowest = serieData.GetCurrData(2, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue); var lowest = serieData.GetCurrData(2, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);

View File

@@ -29,7 +29,7 @@ namespace XCharts.Runtime
title = category; title = category;
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); var color = chart.GetItemColor(serie, serieData);
var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker); var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker);
var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter); var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter); var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);

View File

@@ -6,8 +6,8 @@ namespace XCharts.Runtime
[SerieHandler(typeof(HeatmapHandler), true)] [SerieHandler(typeof(HeatmapHandler), true)]
[DefaultAnimation(AnimationType.LeftToRight)] [DefaultAnimation(AnimationType.LeftToRight)]
[RequireChartComponent(typeof(VisualMap))] [RequireChartComponent(typeof(VisualMap))]
[SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()] [SerieDataExtraField()]
public class Heatmap : Serie, INeedSerieContainer public class Heatmap : Serie, INeedSerieContainer
{ {
@@ -20,10 +20,11 @@ namespace XCharts.Runtime
serie.itemStyle.borderWidth = 1; serie.itemStyle.borderWidth = 1;
serie.itemStyle.borderColor = Color.clear; serie.itemStyle.borderColor = Color.clear;
var emphasis = serie.AddExtraComponent<EmphasisItemStyle>(); var emphasis = serie.AddExtraComponent<EmphasisStyle>();
emphasis.show = true; emphasis.show = true;
emphasis.borderWidth = 1; emphasis.itemStyle.show = true;
emphasis.borderColor = Color.black; emphasis.itemStyle.borderWidth = 1;
emphasis.itemStyle.borderColor = Color.black;
return serie; return serie;
} }
} }

View File

@@ -130,7 +130,7 @@ namespace XCharts.Runtime
xAxis.boundaryGap = true; xAxis.boundaryGap = true;
yAxis.boundaryGap = true; yAxis.boundaryGap = true;
var visualMap = chart.GetVisualMapOfSerie(serie); var visualMap = chart.GetVisualMapOfSerie(serie);
var emphasisItemStyle = serie.emphasisItemStyle; var emphasisStyle = serie.emphasisStyle;
var xCount = xAxis.data.Count; var xCount = xAxis.data.Count;
var yCount = yAxis.data.Count; var yCount = yAxis.data.Count;
var xWidth = m_SerieGrid.context.width / xCount; var xWidth = m_SerieGrid.context.width / xCount;
@@ -209,9 +209,10 @@ namespace XCharts.Runtime
{ {
UGL.DrawBorder(vh, pos, rectWid, rectHig, borderWidth, borderColor, borderToColor); UGL.DrawBorder(vh, pos, rectWid, rectHig, borderWidth, borderColor, borderToColor);
} }
if (visualMap.hoverLink && highlight && emphasisItemStyle != null && if (visualMap.hoverLink && highlight && emphasisStyle != null &&
emphasisItemStyle.borderWidth > 0) emphasisStyle.itemStyle.borderWidth > 0)
{ {
var emphasisItemStyle = emphasisStyle.itemStyle;
var emphasisBorderWidth = emphasisItemStyle.borderWidth; var emphasisBorderWidth = emphasisItemStyle.borderWidth;
var emphasisBorderColor = emphasisItemStyle.opacity > 0 ? var emphasisBorderColor = emphasisItemStyle.opacity > 0 ?
emphasisItemStyle.borderColor : ChartConst.clearColor32; emphasisItemStyle.borderColor : ChartConst.clearColor32;

View File

@@ -12,15 +12,17 @@ namespace XCharts.Runtime
typeof(EndLabelStyle), typeof(EndLabelStyle),
typeof(LineArrow), typeof(LineArrow),
typeof(AreaStyle), typeof(AreaStyle),
typeof(EmphasisItemStyle), typeof(EmphasisStyle),
typeof(EmphasisLabelStyle))] typeof(BlurStyle),
typeof(SelectStyle))]
[SerieDataExtraComponent( [SerieDataExtraComponent(
typeof(ItemStyle), typeof(ItemStyle),
typeof(LabelStyle), typeof(LabelStyle),
typeof(SerieSymbol), typeof(SerieSymbol),
typeof(EmphasisItemStyle), typeof(EmphasisStyle),
typeof(EmphasisLabelStyle))] typeof(BlurStyle),
[SerieDataExtraField("m_Ignore")] typeof(SelectStyle))]
[SerieDataExtraField("m_State", "m_Ignore")]
public class Line : Serie, INeedSerieContainer public class Line : Serie, INeedSerieContainer
{ {
public int containerIndex { get; internal set; } public int containerIndex { get; internal set; }

View File

@@ -187,18 +187,18 @@ namespace XCharts.Runtime
serieData.interact.SetValue(ref interacting, symbolSize); serieData.interact.SetValue(ref interacting, symbolSize);
symbolSize = serie.animation.GetSysmbolSize(symbolSize); symbolSize = serie.animation.GetSysmbolSize(symbolSize);
} }
var symbolColor = SerieHelper.GetItemColor(serie, serieData, theme, serie.index, highlight); var state = SerieHelper.GetSerieState(serie, serieData);
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, theme, serie.index, highlight); Color32 symbolColor, symbolToColor,symbolEmptyColor;
var symbolEmptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, theme, serie.index, highlight, false); SerieHelper.GetItemColor(out symbolColor, out symbolToColor,out symbolEmptyColor, serie, serieData, theme, serie.index, state);
if (isVisualMapGradient) if (isVisualMapGradient)
{ {
symbolColor = VisualMapHelper.GetLineGradientColor(visualMap, pos, m_SerieGrid, axis, relativedAxis, symbolColor); symbolColor = VisualMapHelper.GetLineGradientColor(visualMap, pos, m_SerieGrid, axis, relativedAxis, symbolColor);
symbolToColor = symbolColor; symbolToColor = symbolColor;
} }
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, highlight); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, state);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, highlight); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, state);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, highlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, state);
chart.DrawClipSymbol(vh, symbol.type, symbolSize, symbolBorder, pos, chart.DrawClipSymbol(vh, symbol.type, symbolSize, symbolBorder, pos,
symbolColor, symbolToColor, symbolEmptyColor, borderColor, symbol.gap, clip, cornerRadius, m_SerieGrid, symbolColor, symbolToColor, symbolEmptyColor, borderColor, symbol.gap, clip, cornerRadius, m_SerieGrid,
i > 0 ? serie.context.dataPoints[i - 1] : m_SerieGrid.context.position); i > 0 ? serie.context.dataPoints[i - 1] : m_SerieGrid.context.position);
@@ -220,7 +220,7 @@ namespace XCharts.Runtime
if (serie.context.dataPoints.Count < 2) if (serie.context.dataPoints.Count < 2)
return; return;
var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.index, false); var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.index);
var startPos = Vector3.zero; var startPos = Vector3.zero;
var arrowPos = Vector3.zero; var arrowPos = Vector3.zero;
var lineArrow = serie.lineArrow.arrow; var lineArrow = serie.lineArrow.arrow;

View File

@@ -120,7 +120,7 @@ namespace XCharts.Runtime
var firstSerieData = datas[0]; var firstSerieData = datas[0];
var lp = GetPolarPos(m_SeriePolar, m_AngleAxis, firstSerieData, min, max, radius); var lp = GetPolarPos(m_SeriePolar, m_AngleAxis, firstSerieData, min, max, radius);
var cp = Vector3.zero; var cp = Vector3.zero;
var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.index, serie.highlight); var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.index);
var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth); var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
var currDetailProgress = 0f; var currDetailProgress = 0f;
var totalDetailProgress = datas.Count; var totalDetailProgress = datas.Count;
@@ -205,6 +205,7 @@ namespace XCharts.Runtime
continue; continue;
var count = serie.dataCount; var count = serie.dataCount;
Color32 symbolColor, symbolToColor,symbolEmptyColor;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
var serieData = serie.GetSerieData(i); var serieData = serie.GetSerieData(i);
@@ -220,13 +221,11 @@ namespace XCharts.Runtime
var symbolSize = highlight ? var symbolSize = highlight ?
symbol.GetSelectedSize(serieData.data, chart.theme.serie.lineSymbolSize) : symbol.GetSelectedSize(serieData.data, chart.theme.serie.lineSymbolSize) :
symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize); symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
var state = SerieHelper.GetSerieState(serie, serieData);
var symbolColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, n, highlight); SerieHelper.GetItemColor(out symbolColor, out symbolToColor,out symbolEmptyColor, serie, serieData, chart.theme, n);
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, n, highlight); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, state);
var symbolEmptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, n, highlight, false); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, state);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, highlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, state);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, highlight);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, highlight);
symbolSize = serie.animation.GetSysmbolSize(symbolSize); symbolSize = serie.animation.GetSysmbolSize(symbolSize);
chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, serieData.context.position, chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, serieData.context.position,

View File

@@ -24,11 +24,11 @@ namespace XCharts.Runtime
public static void DrawSerieLineArea(VertexHelper vh, Serie serie, Serie lastStackSerie, public static void DrawSerieLineArea(VertexHelper vh, Serie serie, Serie lastStackSerie,
ThemeStyle theme, VisualMap visualMap, bool isY, Axis axis, Axis relativedAxis, GridCoord grid) ThemeStyle theme, VisualMap visualMap, bool isY, Axis axis, Axis relativedAxis, GridCoord grid)
{ {
if (serie.areaStyle == null || !serie.areaStyle.show) Color32 srcAreaColor, srcAreaToColor;
if (!SerieHelper.GetAreaColor(out srcAreaColor, out srcAreaToColor, serie, null, theme, serie.context.colorIndex))
{
return; return;
}
var srcAreaColor = SerieHelper.GetAreaColor(serie, null, theme, serie.context.colorIndex, false);
var srcAreaToColor = SerieHelper.GetAreaToColor(serie, null, theme, serie.context.colorIndex, false);
var gridXY = (isY ? grid.context.x : grid.context.y); var gridXY = (isY ? grid.context.x : grid.context.y);
if (lastStackSerie == null) if (lastStackSerie == null)
{ {
@@ -263,7 +263,7 @@ namespace XCharts.Runtime
var isLineStyleGradient = serie.lineStyle.IsNeedGradient(); var isLineStyleGradient = serie.lineStyle.IsNeedGradient();
//var highlight = serie.highlight || serie.context.pointerEnter; //var highlight = serie.highlight || serie.context.pointerEnter;
var lineColor = SerieHelper.GetLineColor(serie, null, theme, serie.context.colorIndex, false); var lineColor = SerieHelper.GetLineColor(serie, null, theme, serie.context.colorIndex);
var lastDataIsIgnore = datas[0].isIgnoreBreak; var lastDataIsIgnore = datas[0].isIgnoreBreak;
var smooth = serie.lineType == LineType.Smooth; var smooth = serie.lineType == LineType.Smooth;

View File

@@ -6,7 +6,7 @@ namespace XCharts.Runtime
[System.Serializable] [System.Serializable]
[SerieHandler(typeof(ParallelHandler), true)] [SerieHandler(typeof(ParallelHandler), true)]
[RequireChartComponent(typeof(ParallelCoord))] [RequireChartComponent(typeof(ParallelCoord))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()] [SerieDataExtraField()]
public class Parallel : Serie, INeedSerieContainer public class Parallel : Serie, INeedSerieContainer
{ {

View File

@@ -38,7 +38,7 @@ namespace XCharts.Runtime
var animationIndex = serie.animation.GetCurrIndex(); var animationIndex = serie.animation.GetCurrIndex();
var isHorizonal = parallel.orient == Orient.Horizonal; var isHorizonal = parallel.orient == Orient.Horizonal;
var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.context.colorIndex, false); var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.context.colorIndex);
var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth); var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
float currDetailProgress = !isHorizonal ? float currDetailProgress = !isHorizonal ?

View File

@@ -4,8 +4,8 @@ namespace XCharts.Runtime
[SerieConvert(typeof(Line), typeof(Bar))] [SerieConvert(typeof(Line), typeof(Bar))]
[SerieHandler(typeof(PieHandler), true)] [SerieHandler(typeof(PieHandler), true)]
[DefaultAnimation(AnimationType.Clockwise)] [DefaultAnimation(AnimationType.Clockwise)]
[SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(TitleStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle), typeof(EmphasisLabelLine))] [SerieExtraComponent(typeof(LabelStyle), typeof(LabelLine), typeof(TitleStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(LabelLine), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle), typeof(EmphasisLabelLine))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(LabelLine), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Ignore", "m_Selected", "m_Radius")] [SerieDataExtraField("m_Ignore", "m_Selected", "m_Radius")]
public class Pie : Serie public class Pie : Serie
{ {

View File

@@ -108,6 +108,7 @@ namespace XCharts.Runtime
{ {
var needCheck = m_LegendEnter || (chart.isPointerInChart && PointerIsInPieSerie(serie, chart.pointerPos)); var needCheck = m_LegendEnter || (chart.isPointerInChart && PointerIsInPieSerie(serie, chart.pointerPos));
var needInteract = false; var needInteract = false;
Color32 color, toColor;
if (!needCheck) if (!needCheck)
{ {
if (m_LastCheckContextFlag != needCheck) if (m_LastCheckContextFlag != needCheck)
@@ -118,8 +119,7 @@ namespace XCharts.Runtime
foreach (var serieData in serie.data) foreach (var serieData in serie.data)
{ {
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, false); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
var toColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, false);
serieData.context.highlight = false; serieData.context.highlight = false;
serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor); serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor);
} }
@@ -142,8 +142,7 @@ namespace XCharts.Runtime
serieData.context.highlight = true; serieData.context.highlight = true;
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, true); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Emphasis);
var toColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, true);
var value = serieData.context.outsideRadius + chart.theme.serie.pieTooltipExtraRadius; var value = serieData.context.outsideRadius + chart.theme.serie.pieTooltipExtraRadius;
serieData.interact.SetValueAndColor(ref needInteract, value, color, toColor); serieData.interact.SetValueAndColor(ref needInteract, value, color, toColor);
} }
@@ -151,8 +150,7 @@ namespace XCharts.Runtime
{ {
serieData.context.highlight = false; serieData.context.highlight = false;
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, false); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
var toColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, false);
serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor); serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor);
} }
} }
@@ -322,7 +320,7 @@ namespace XCharts.Runtime
if (serieData.IsDataChanged()) if (serieData.IsDataChanged())
dataChanging = true; dataChanging = true;
var itemStyle = SerieHelper.GetItemStyle(serie, serieData, serieData.context.highlight); var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var outsideRadius = 0f; var outsideRadius = 0f;
@@ -334,8 +332,7 @@ namespace XCharts.Runtime
//if (!serieData.interact.TryGetValueAndColor(ref outsideRadius, ref color, ref toColor, ref interacting)) //if (!serieData.interact.TryGetValueAndColor(ref outsideRadius, ref color, ref toColor, ref interacting))
{ {
color = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, serieData.context.highlight); SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex);
toColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, serieData.context.highlight);
outsideRadius = serieData.context.outsideRadius * progress; outsideRadius = serieData.context.outsideRadius * progress;
serieData.interact.SetValueAndColor(ref interacting, outsideRadius, color, toColor); serieData.interact.SetValueAndColor(ref interacting, outsideRadius, color, toColor);
} }

View File

@@ -6,8 +6,8 @@ namespace XCharts.Runtime
[System.Serializable] [System.Serializable]
[SerieHandler(typeof(RadarHandler), true)] [SerieHandler(typeof(RadarHandler), true)]
[RequireChartComponent(typeof(RadarCoord))] [RequireChartComponent(typeof(RadarCoord))]
[SerieExtraComponent(typeof(LabelStyle), typeof(AreaStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(AreaStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(AreaStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(AreaStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()] [SerieDataExtraField()]
public class Radar : Serie, INeedSerieContainer public class Radar : Serie, INeedSerieContainer
{ {

View File

@@ -54,7 +54,8 @@ namespace XCharts.Runtime
if (serieData == null) if (serieData == null)
return; return;
var color = SerieHelper.GetItemColor(serie, serieData, chart.theme, dataIndex, false);; Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, dataIndex, SerieState.Normal);
title = serieData.name; title = serieData.name;
for (int i = 0; i < serieData.data.Count; i++) for (int i = 0; i < serieData.data.Count; i++)
{ {
@@ -96,6 +97,7 @@ namespace XCharts.Runtime
needHideAll = true; needHideAll = true;
} }
m_LastCheckContextFlag = needCheck; m_LastCheckContextFlag = needCheck;
serie.highlight = false;
serie.context.pointerEnter = false; serie.context.pointerEnter = false;
serie.context.pointerItemDataIndex = -1; serie.context.pointerItemDataIndex = -1;
var areaStyle = serie.areaStyle; var areaStyle = serie.areaStyle;
@@ -120,6 +122,7 @@ namespace XCharts.Runtime
{ {
if (Vector3.Distance(chart.pointerPos, pos) < symbolSize * 2) if (Vector3.Distance(chart.pointerPos, pos) < symbolSize * 2)
{ {
serie.highlight = true;
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serie.context.pointerItemDataIndex = i; serie.context.pointerItemDataIndex = i;
serieData.context.highlight = true; serieData.context.highlight = true;
@@ -136,6 +139,7 @@ namespace XCharts.Runtime
var p2 = n >= dataPoints.Count - 1 ? dataPoints[0] : dataPoints[n + 1]; var p2 = n >= dataPoints.Count - 1 ? dataPoints[0] : dataPoints[n + 1];
if (UGLHelper.IsPointInTriangle(p1, center, p2, chart.pointerPos)) if (UGLHelper.IsPointInTriangle(p1, center, p2, chart.pointerPos))
{ {
serie.highlight = true;
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serie.context.pointerItemDataIndex = i; serie.context.pointerItemDataIndex = i;
serieData.context.highlight = true; serieData.context.highlight = true;
@@ -154,6 +158,7 @@ namespace XCharts.Runtime
serieData.index = i; serieData.index = i;
if (Vector3.Distance(chart.pointerPos, serieData.context.position) < serie.symbol.size * 2) if (Vector3.Distance(chart.pointerPos, serieData.context.position) < serie.symbol.size * 2)
{ {
serie.highlight = true;
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serie.context.pointerItemDataIndex = i; serie.context.pointerItemDataIndex = i;
return; return;
@@ -169,6 +174,7 @@ namespace XCharts.Runtime
var p2 = n >= dataPoints.Count - 1 ? dataPoints[0] : dataPoints[n + 1]; var p2 = n >= dataPoints.Count - 1 ? dataPoints[0] : dataPoints[n + 1];
if (UGLHelper.IsPointInTriangle(p1.context.position, center, p2.context.position, chart.pointerPos)) if (UGLHelper.IsPointInTriangle(p1.context.position, center, p2.context.position, chart.pointerPos))
{ {
serie.highlight = true;
serie.context.pointerEnter = true; serie.context.pointerEnter = true;
serie.context.pointerItemDataIndex = n; serie.context.pointerItemDataIndex = n;
p1.context.highlight = true; p1.context.highlight = true;
@@ -209,6 +215,7 @@ namespace XCharts.Runtime
var interacting = false; var interacting = false;
var dataChangeDuration = serie.animation.GetUpdateAnimationDuration(); var dataChangeDuration = serie.animation.GetUpdateAnimationDuration();
SerieHelper.GetAllMinMaxData(serie, m_RadarCoord.ceilRate); SerieHelper.GetAllMinMaxData(serie, m_RadarCoord.ceilRate);
Color32 areaColor, areaToColor;
for (int j = 0; j < serie.data.Count; j++) for (int j = 0; j < serie.data.Count; j++)
{ {
var serieData = serie.data[j]; var serieData = serie.data[j];
@@ -218,13 +225,12 @@ namespace XCharts.Runtime
continue; continue;
} }
var lineStyle = SerieHelper.GetLineStyle(serie, serieData); var lineStyle = SerieHelper.GetLineStyle(serie, serieData);
var areaStyle = SerieHelper.GetAreaStyle(serie, serieData);
var symbol = SerieHelper.GetSerieSymbol(serie, serieData); var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
var isHighlight = serieData.context.highlight; var isHighlight = serieData.context.highlight;
var serieState = SerieHelper.GetSerieState(serie, serieData);
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var areaColor = SerieHelper.GetAreaColor(serie, serieData, chart.theme, colorIndex, isHighlight); var showArea = SerieHelper.GetAreaColor(out areaColor, out areaToColor, serie, serieData, chart.theme, colorIndex);
var areaToColor = SerieHelper.GetAreaToColor(serie, serieData, chart.theme, colorIndex, isHighlight); var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, colorIndex);
var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, colorIndex, isHighlight);
var lineWidth = lineStyle.GetWidth(chart.theme.serie.lineWidth); var lineWidth = lineStyle.GetWidth(chart.theme.serie.lineWidth);
int dataCount = m_RadarCoord.indicatorList.Count; int dataCount = m_RadarCoord.indicatorList.Count;
serieData.context.dataPoints.Clear(); serieData.context.dataPoints.Clear();
@@ -262,7 +268,7 @@ namespace XCharts.Runtime
{ {
toPoint = new Vector3(centerPos.x + radius * Mathf.Sin(currAngle), toPoint = new Vector3(centerPos.x + radius * Mathf.Sin(currAngle),
centerPos.y + radius * Mathf.Cos(currAngle)); centerPos.y + radius * Mathf.Cos(currAngle));
if (areaStyle != null && areaStyle.show && !serie.smooth) if (showArea && !serie.smooth)
{ {
UGL.DrawTriangle(vh, startPoint, toPoint, centerPos, areaColor, areaColor, areaToColor); UGL.DrawTriangle(vh, startPoint, toPoint, centerPos, areaColor, areaColor, areaToColor);
} }
@@ -274,7 +280,7 @@ namespace XCharts.Runtime
} }
serieData.context.dataPoints.Add(startPoint); serieData.context.dataPoints.Add(startPoint);
} }
if (areaStyle != null && areaStyle.show && !serie.smooth) if (showArea && !serie.smooth)
{ {
UGL.DrawTriangle(vh, startPoint, firstPoint, centerPos, areaColor, areaColor, areaToColor); UGL.DrawTriangle(vh, startPoint, firstPoint, centerPos, areaColor, areaColor, areaToColor);
} }
@@ -308,12 +314,11 @@ namespace XCharts.Runtime
serieData.interact.SetValue(ref interacting, symbolSize); serieData.interact.SetValue(ref interacting, symbolSize);
symbolSize = serie.animation.GetSysmbolSize(symbolSize); symbolSize = serie.animation.GetSysmbolSize(symbolSize);
} }
var symbolColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, j, isHighlight); Color32 symbolColor, symbolToColor, symbolEmptyColor;
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, j, isHighlight); SerieHelper.GetItemColor(out symbolColor, out symbolToColor, out symbolEmptyColor, serie, serieData, chart.theme, j, serieState);
var symbolEmptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, j, isHighlight, false); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, serieState);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, isHighlight); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, serieState);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, isHighlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, serieState);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, isHighlight);
chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, point, symbolColor, chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, point, symbolColor,
symbolToColor, symbolEmptyColor, borderColor, symbol.gap, cornerRadius); symbolToColor, symbolEmptyColor, borderColor, symbol.gap, cornerRadius);
} }
@@ -369,11 +374,9 @@ namespace XCharts.Runtime
continue; continue;
} }
var lineStyle = SerieHelper.GetLineStyle(serie, serieData); var lineStyle = SerieHelper.GetLineStyle(serie, serieData);
var areaStyle = SerieHelper.GetAreaStyle(serie, serieData); Color32 areaColor, areaToColor;
var isHighlight = serie.context.pointerEnter; var showArea = SerieHelper.GetAreaColor(out areaColor, out areaToColor, serie, serieData, chart.theme, j);
var areaColor = SerieHelper.GetAreaColor(serie, serieData, chart.theme, j, isHighlight); var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, j);
var areaToColor = SerieHelper.GetAreaToColor(serie, serieData, chart.theme, j, isHighlight);
var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, j, isHighlight);
int dataCount = radar.indicatorList.Count; int dataCount = radar.indicatorList.Count;
var index = serieData.index; var index = serieData.index;
var p = radar.context.center; var p = radar.context.center;
@@ -404,7 +407,7 @@ namespace XCharts.Runtime
{ {
toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle), toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle),
p.y + radius * Mathf.Cos(currAngle)); p.y + radius * Mathf.Cos(currAngle));
if (areaStyle != null && areaStyle.show && !serie.smooth) if (showArea && !serie.smooth)
{ {
UGL.DrawTriangle(vh, startPoint, toPoint, p, areaColor, areaColor, areaToColor); UGL.DrawTriangle(vh, startPoint, toPoint, p, areaColor, areaColor, areaToColor);
} }
@@ -423,7 +426,7 @@ namespace XCharts.Runtime
serieData.context.position = startPoint; serieData.context.position = startPoint;
serieData.context.labelPosition = startPoint; serieData.context.labelPosition = startPoint;
if (areaStyle != null && areaStyle.show && j == endIndex && !serie.smooth) if (showArea && j == endIndex && !serie.smooth)
{ {
UGL.DrawTriangle(vh, startPoint, firstPoint, centerPos, areaColor, areaColor, areaToColor); UGL.DrawTriangle(vh, startPoint, firstPoint, centerPos, areaColor, areaColor, areaToColor);
} }
@@ -439,7 +442,7 @@ namespace XCharts.Runtime
if (serie.smooth) if (serie.smooth)
{ {
var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth); var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.context.colorIndex, false); var lineColor = SerieHelper.GetLineColor(serie, null, chart.theme, serie.context.colorIndex);
UGL.DrawCurves(vh, serie.context.dataPoints, lineWidth, lineColor, UGL.DrawCurves(vh, serie.context.dataPoints, lineWidth, lineColor,
chart.settings.lineSmoothStyle, chart.settings.lineSmoothStyle,
chart.settings.lineSmoothness, chart.settings.lineSmoothness,
@@ -452,17 +455,16 @@ namespace XCharts.Runtime
{ {
var serieData = serie.data[j]; var serieData = serie.data[j];
if (!serieData.show) continue; if (!serieData.show) continue;
var isHighlight = serie.highlight || serieData.context.highlight || serie.context.pointerEnter; var state = SerieHelper.GetSerieState(serie, serieData);
var serieIndex = serieData.index; var serieIndex = serieData.index;
var symbolSize = isHighlight ? var symbolSize = state == SerieState.Emphasis ?
serie.symbol.GetSelectedSize(serieData.data, chart.theme.serie.lineSymbolSelectedSize) : serie.symbol.GetSelectedSize(serieData.data, chart.theme.serie.lineSymbolSelectedSize) :
serie.symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize); serie.symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
var symbolColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serieIndex, isHighlight); Color32 symbolColor, symbolToColor,symbolEmptyColor;
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serieIndex, isHighlight); SerieHelper.GetItemColor(out symbolColor, out symbolToColor,out symbolEmptyColor, serie, serieData, chart.theme, serieIndex, state);
var symbolEmptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, serieIndex, isHighlight, false); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, state);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, isHighlight); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, state);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, isHighlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, state);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, isHighlight);
if (!radar.IsInIndicatorRange(j, serieData.GetData(1))) if (!radar.IsInIndicatorRange(j, serieData.GetData(1)))
{ {
symbolColor = radar.outRangeColor; symbolColor = radar.outRangeColor;
@@ -499,27 +501,5 @@ namespace XCharts.Runtime
} }
return 0; return 0;
} }
private void DrawRadarSymbol(VertexHelper vh, Serie serie, SerieData serieData, int serieIndex, bool isHighlight,
List<Vector3> pointList)
{
if (serie.symbol.show && serie.symbol.type != SymbolType.None)
{
var symbolSize = isHighlight ?
serie.symbol.GetSelectedSize(serieData.data, chart.theme.serie.lineSymbolSelectedSize) :
serie.symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
var symbolColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, serieIndex, isHighlight);
var symbolToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, serieIndex, isHighlight);
var symbolEmptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, serieIndex, isHighlight, false);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, chart.theme, isHighlight);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, chart.theme, isHighlight);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, isHighlight);
foreach (var point in pointList)
{
chart.DrawSymbol(vh, serie.symbol.type, symbolSize, symbolBorder, point, symbolColor,
symbolToColor, symbolEmptyColor, borderColor, serie.symbol.gap, cornerRadius);
}
}
}
} }
} }

View File

@@ -4,8 +4,8 @@ namespace XCharts.Runtime
{ {
[System.Serializable] [System.Serializable]
[SerieHandler(typeof(RingHandler), true)] [SerieHandler(typeof(RingHandler), true)]
[SerieExtraComponent(typeof(LabelStyle), typeof(TitleStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(TitleStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(TitleStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(TitleStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField()] [SerieDataExtraField()]
public class Ring : Serie public class Ring : Serie
{ {

View File

@@ -86,6 +86,8 @@ namespace XCharts.Runtime
var serieData = serie.GetSerieData(dataIndex); var serieData = serie.GetSerieData(dataIndex);
if (serieData == null) if (serieData == null)
return; return;
Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, dataIndex);
var param = serie.context.param; var param = serie.context.param;
param.serieName = serie.serieName; param.serieName = serie.serieName;
@@ -96,7 +98,7 @@ namespace XCharts.Runtime
param.dataCount = serie.dataCount; param.dataCount = serie.dataCount;
param.value = serieData.GetData(0); param.value = serieData.GetData(0);
param.total = serieData.GetData(1); param.total = serieData.GetData(1);
param.color = SerieHelper.GetItemColor(serie, serieData, chart.theme, dataIndex, false); param.color = color;
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker); param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter); param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);; param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);;
@@ -158,10 +160,10 @@ namespace XCharts.Runtime
var degree = (float) (360 * value / max); var degree = (float) (360 * value / max);
var startDegree = GetStartAngle(serie); var startDegree = GetStartAngle(serie);
var toDegree = GetToAngle(serie, degree); var toDegree = GetToAngle(serie, degree);
var itemStyle = SerieHelper.GetItemStyle(serie, serieData, serieData.context.highlight); var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
var itemColor = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, serieData.context.highlight); Color32 itemColor, itemToColor;
var itemToColor = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, serieData.context.highlight); SerieHelper.GetItemColor(out itemColor, out itemToColor, serie, serieData, chart.theme, colorIndex);
var outsideRadius = serie.context.outsideRadius - j * (ringWidth + serie.gap); var outsideRadius = serie.context.outsideRadius - j * (ringWidth + serie.gap);
var insideRadius = outsideRadius - ringWidth; var insideRadius = outsideRadius - ringWidth;
var borderWidth = itemStyle.borderWidth; var borderWidth = itemStyle.borderWidth;
@@ -214,8 +216,7 @@ namespace XCharts.Runtime
chart.RefreshPainter(serie); chart.RefreshPainter(serie);
} }
public override void OnPointerDown(PointerEventData eventData) public override void OnPointerDown(PointerEventData eventData) { }
{ }
private float GetStartAngle(Serie serie) private float GetStartAngle(Serie serie)
{ {
@@ -258,7 +259,12 @@ namespace XCharts.Runtime
private void DrawBackground(VertexHelper vh, Serie serie, SerieData serieData, int index, float insideRadius, float outsideRadius) private void DrawBackground(VertexHelper vh, Serie serie, SerieData serieData, int index, float insideRadius, float outsideRadius)
{ {
var itemStyle = SerieHelper.GetItemStyle(serie, serieData); var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
var backgroundColor = SerieHelper.GetItemBackgroundColor(serie, serieData, chart.theme, index, false); var backgroundColor = itemStyle.backgroundColor;
if (ChartHelper.IsClearColor(backgroundColor))
{
backgroundColor = chart.theme.GetColor(index);
backgroundColor.a = 50;
}
if (itemStyle.backgroundWidth != 0) if (itemStyle.backgroundWidth != 0)
{ {
var centerRadius = (outsideRadius + insideRadius) / 2; var centerRadius = (outsideRadius + insideRadius) / 2;

View File

@@ -36,7 +36,7 @@ namespace XCharts.Runtime
param.dimension = 1; param.dimension = 1;
param.dataCount = serie.dataCount; param.dataCount = serie.dataCount;
param.serieData = serieData; param.serieData = serieData;
param.color = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); param.color = chart.GetItemColor(serie, serieData);
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker); param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter); param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter); param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
@@ -151,12 +151,12 @@ namespace XCharts.Runtime
continue; continue;
var highlight = serie.highlight || serieData.context.highlight; var highlight = serie.highlight || serieData.context.highlight;
var color = SerieHelper.GetItemColor(serie, serieData, theme, colorIndex, highlight); var state = SerieHelper.GetSerieState(serie, serieData);
var toColor = SerieHelper.GetItemToColor(serie, serieData, theme, colorIndex, highlight); Color32 color, toColor, emptyColor;
var emptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, theme, colorIndex, highlight, false); SerieHelper.GetItemColor(out color, out toColor, out emptyColor, serie, serieData, chart.theme, colorIndex, state);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, highlight); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, state);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, highlight); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, state);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, highlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, state);
double xValue = serieData.GetCurrData(0, dataChangeDuration, xAxis.inverse); double xValue = serieData.GetCurrData(0, dataChangeDuration, xAxis.inverse);
double yValue = serieData.GetCurrData(1, dataChangeDuration, yAxis.inverse); double yValue = serieData.GetCurrData(1, dataChangeDuration, yAxis.inverse);
@@ -255,13 +255,12 @@ namespace XCharts.Runtime
if (!symbol.ShowSymbol(serieData.index, maxCount)) if (!symbol.ShowSymbol(serieData.index, maxCount))
continue; continue;
var highlight = serie.highlight || serieData.context.highlight; var state = SerieHelper.GetSerieState(serie, serieData);
var color = SerieHelper.GetItemColor(serie, serieData, theme, colorIndex, highlight); Color32 color, toColor, emptyColor;
var toColor = SerieHelper.GetItemToColor(serie, serieData, theme, colorIndex, highlight); SerieHelper.GetItemColor(out color, out toColor, out emptyColor, serie, serieData, chart.theme, colorIndex, state);
var emptyColor = SerieHelper.GetItemBackgroundColor(serie, serieData, theme, colorIndex, highlight, false); var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, state);
var symbolBorder = SerieHelper.GetSymbolBorder(serie, serieData, theme, highlight); var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, state);
var borderColor = SerieHelper.GetSymbolBorderColor(serie, serieData, theme, highlight); var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, state);
var cornerRadius = SerieHelper.GetSymbolCornerRadius(serie, serieData, highlight);
var xValue = serieData.GetCurrData(0, dataChangeDuration, axis.inverse); var xValue = serieData.GetCurrData(0, dataChangeDuration, axis.inverse);
if (serieData.IsDataChanged()) if (serieData.IsDataChanged())

View File

@@ -5,8 +5,8 @@ namespace XCharts.Runtime
[System.Serializable] [System.Serializable]
[SerieHandler(typeof(EffectScatterHandler), true)] [SerieHandler(typeof(EffectScatterHandler), true)]
[CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))] [CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))]
[SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Radius")] [SerieDataExtraField("m_Radius")]
public class EffectScatter : BaseScatter public class EffectScatter : BaseScatter
{ {

View File

@@ -5,8 +5,8 @@ namespace XCharts.Runtime
[System.Serializable] [System.Serializable]
[SerieHandler(typeof(ScatterHandler), true)] [SerieHandler(typeof(ScatterHandler), true)]
[CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))] [CoordOptions(typeof(GridCoord), typeof(SingleAxisCoord))]
[SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieExtraComponent(typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisItemStyle), typeof(EmphasisLabelStyle))] [SerieDataExtraComponent(typeof(ItemStyle), typeof(LabelStyle), typeof(EmphasisStyle), typeof(BlurStyle), typeof(SelectStyle))]
[SerieDataExtraField("m_Radius")] [SerieDataExtraField("m_Radius")]
public class Scatter : BaseScatter public class Scatter : BaseScatter
{ {

View File

@@ -14,9 +14,9 @@ namespace XCharts.Runtime
{ typeof(LineArrow), "m_LineArrows" }, { typeof(LineArrow), "m_LineArrows" },
{ typeof(AreaStyle), "m_AreaStyles" }, { typeof(AreaStyle), "m_AreaStyles" },
{ typeof(TitleStyle), "m_TitleStyles" }, { typeof(TitleStyle), "m_TitleStyles" },
{ typeof(EmphasisItemStyle), "m_EmphasisItemStyles" }, { typeof(EmphasisStyle), "m_EmphasisStyles" },
{ typeof(EmphasisLabelStyle), "m_EmphasisLabels" }, { typeof(BlurStyle), "m_BlurStyles" },
{ typeof(EmphasisLabelLine), "m_EmphasisLabelLines" }, { typeof(SelectStyle), "m_SelectStyles" },
}; };
[SerializeField][IgnoreDoc] private List<LabelStyle> m_Labels = new List<LabelStyle>(); [SerializeField][IgnoreDoc] private List<LabelStyle> m_Labels = new List<LabelStyle>();
@@ -25,9 +25,9 @@ namespace XCharts.Runtime
[SerializeField][IgnoreDoc] private List<LineArrow> m_LineArrows = new List<LineArrow>(); [SerializeField][IgnoreDoc] private List<LineArrow> m_LineArrows = new List<LineArrow>();
[SerializeField][IgnoreDoc] private List<AreaStyle> m_AreaStyles = new List<AreaStyle>(); [SerializeField][IgnoreDoc] private List<AreaStyle> m_AreaStyles = new List<AreaStyle>();
[SerializeField][IgnoreDoc] private List<TitleStyle> m_TitleStyles = new List<TitleStyle>(); [SerializeField][IgnoreDoc] private List<TitleStyle> m_TitleStyles = new List<TitleStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisItemStyle> m_EmphasisItemStyles = new List<EmphasisItemStyle>(); [SerializeField][IgnoreDoc] private List<EmphasisStyle> m_EmphasisStyles = new List<EmphasisStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisLabelStyle> m_EmphasisLabels = new List<EmphasisLabelStyle>(); [SerializeField][IgnoreDoc] private List<BlurStyle> m_BlurStyles = new List<BlurStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisLabelLine> m_EmphasisLabelLines = new List<EmphasisLabelLine>(); [SerializeField][IgnoreDoc] private List<SelectStyle> m_SelectStyles = new List<SelectStyle>();
/// <summary> /// <summary>
/// The style of area. /// The style of area.
@@ -51,22 +51,25 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
public LineArrow lineArrow { get { return m_LineArrows.Count > 0 ? m_LineArrows[0] : null; } } public LineArrow lineArrow { get { return m_LineArrows.Count > 0 ? m_LineArrows[0] : null; } }
/// <summary> /// <summary>
/// 高亮的图形样式
/// </summary>
public EmphasisItemStyle emphasisItemStyle { get { return m_EmphasisItemStyles.Count > 0 ? m_EmphasisItemStyles[0] : null; } }
/// <summary>
/// 高亮时的标签样式
/// </summary>
public EmphasisLabelStyle emphasisLabel { get { return m_EmphasisLabels.Count > 0 ? m_EmphasisLabels[0] : null; } }
/// <summary>
/// 高亮时的标签引导线样式
/// </summary>
public EmphasisLabelLine emphasisLabelLine { get { return m_EmphasisLabelLines.Count > 0 ? m_EmphasisLabelLines[0] : null; } }
/// <summary>
/// the icon of data. /// the icon of data.
/// |数据项标题样式。 /// |数据项标题样式。
/// </summary> /// </summary>
public TitleStyle titleStyle { get { return m_TitleStyles.Count > 0 ? m_TitleStyles[0] : null; } } public TitleStyle titleStyle { get { return m_TitleStyles.Count > 0 ? m_TitleStyles[0] : null; } }
/// <summary>
/// style of emphasis state.
/// |高亮状态的样式。
/// </summary>
public EmphasisStyle emphasisStyle { get { return m_EmphasisStyles.Count > 0 ? m_EmphasisStyles[0] : null; } }
/// <summary>
/// style of blur state.
/// |淡出状态的样式。
/// </summary>
public BlurStyle blurStyle { get { return m_BlurStyles.Count > 0 ? m_BlurStyles[0] : null; } }
/// <summary>
/// style of select state.
/// |选中状态的样式。
/// </summary>
public SelectStyle selectStyle { get { return m_SelectStyles.Count > 0 ? m_SelectStyles[0] : null; } }
public void RemoveAllExtraComponent() public void RemoveAllExtraComponent()
{ {

View File

@@ -161,6 +161,39 @@ namespace XCharts.Runtime
Right Right
} }
/// <summary>
/// Serie state. Supports normal, emphasis, blur, and select states.
/// |Serie状态。支持正常、高亮、淡出、选中四种状态。
/// </summary>
public enum SerieState
{
/// <summary>
/// Normal state.
/// |正常状态。
/// </summary>
Normal,
/// <summary>
/// Emphasis state.
/// |高亮状态。
/// </summary>
Emphasis,
/// <summary>
/// Blur state.
/// |淡出状态。
/// </summary>
Blur,
/// <summary>
/// Select state.
/// |选中状态。
/// </summary>
Select,
/// <summary>
/// Auto state.
/// |自动保持和父节点一致。一般用在SerieData。
/// </summary>
Auto
}
/// <summary> /// <summary>
/// 系列。 /// 系列。
/// </summary> /// </summary>
@@ -172,6 +205,7 @@ namespace XCharts.Runtime
[SerializeField] private string m_CoordSystem = "GridCoord"; [SerializeField] private string m_CoordSystem = "GridCoord";
[SerializeField] private string m_SerieType = ""; [SerializeField] private string m_SerieType = "";
[SerializeField] private string m_SerieName; [SerializeField] private string m_SerieName;
[SerializeField][Since("v3.2.0")] private SerieState m_State = SerieState.Normal;
[SerializeField] private string m_Stack; [SerializeField] private string m_Stack;
[SerializeField] private int m_XAxisIndex = 0; [SerializeField] private int m_XAxisIndex = 0;
[SerializeField] private int m_YAxisIndex = 0; [SerializeField] private int m_YAxisIndex = 0;
@@ -296,6 +330,15 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
public string legendName { get { return string.IsNullOrEmpty(serieName) ? ChartCached.IntToStr(index) : serieName; } } public string legendName { get { return string.IsNullOrEmpty(serieName) ? ChartCached.IntToStr(index) : serieName; } }
/// <summary> /// <summary>
/// The default state of a serie.
/// |系列的默认状态。
/// </summary>
public SerieState state
{
get { return m_State; }
set { if (PropertyUtil.SetStruct(ref m_State, 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. /// 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值后后一个系列的值会在前一个系列的值上相加。 /// |数据堆叠同个类目轴上系列配置相同的stack值后后一个系列的值会在前一个系列的值上相加。
/// </summary> /// </summary>
@@ -826,12 +869,14 @@ namespace XCharts.Runtime
symbol.vertsDirty || symbol.vertsDirty ||
lineStyle.vertsDirty || lineStyle.vertsDirty ||
itemStyle.vertsDirty || itemStyle.vertsDirty ||
(lineArrow != null && lineArrow.vertsDirty) || IsVertsDirty(lineArrow) ||
(areaStyle != null && areaStyle.vertsDirty) || IsVertsDirty(areaStyle) ||
(label != null && label.vertsDirty) || IsVertsDirty(label) ||
(labelLine != null && labelLine.vertsDirty) || IsVertsDirty(labelLine) ||
(emphasisItemStyle != null && emphasisItemStyle.vertsDirty) || IsVertsDirty(titleStyle) ||
(titleStyle != null && titleStyle.vertsDirty) || IsVertsDirty(emphasisStyle) ||
IsVertsDirty(blurStyle) ||
IsVertsDirty(selectStyle) ||
AnySerieDataVerticesDirty(); AnySerieDataVerticesDirty();
} }
} }
@@ -842,11 +887,12 @@ namespace XCharts.Runtime
{ {
return m_ComponentDirty || return m_ComponentDirty ||
symbol.componentDirty || symbol.componentDirty ||
(titleStyle != null && titleStyle.componentDirty) || IsComponentDirty(titleStyle) ||
(label != null && label.componentDirty) || IsComponentDirty(label) ||
(labelLine != null && labelLine.componentDirty) || IsComponentDirty(labelLine) ||
(emphasisLabel != null && emphasisLabel.componentDirty) || IsComponentDirty(emphasisStyle) ||
(emphasisLabelLine != null && emphasisLabelLine.componentDirty); IsComponentDirty(blurStyle) ||
IsComponentDirty(selectStyle);
} }
} }
public override void ClearVerticesDirty() public override void ClearVerticesDirty()
@@ -860,16 +906,13 @@ namespace XCharts.Runtime
symbol.ClearVerticesDirty(); symbol.ClearVerticesDirty();
lineStyle.ClearVerticesDirty(); lineStyle.ClearVerticesDirty();
itemStyle.ClearVerticesDirty(); itemStyle.ClearVerticesDirty();
if (areaStyle != null) ClearVerticesDirty(areaStyle);
areaStyle.ClearVerticesDirty(); ClearVerticesDirty(label);
if (label != null) ClearVerticesDirty(emphasisStyle);
label.ClearVerticesDirty(); ClearVerticesDirty(blurStyle);
if (emphasisItemStyle != null) ClearVerticesDirty(selectStyle);
emphasisItemStyle.ClearVerticesDirty(); ClearVerticesDirty(lineArrow);
if (lineArrow != null) ClearVerticesDirty(titleStyle);
lineArrow.ClearVerticesDirty();
if (titleStyle != null)
titleStyle.ClearVerticesDirty();
} }
public override void ClearComponentDirty() public override void ClearComponentDirty()
@@ -883,18 +926,13 @@ namespace XCharts.Runtime
symbol.ClearComponentDirty(); symbol.ClearComponentDirty();
lineStyle.ClearComponentDirty(); lineStyle.ClearComponentDirty();
itemStyle.ClearComponentDirty(); itemStyle.ClearComponentDirty();
if (areaStyle != null) ClearComponentDirty(areaStyle);
areaStyle.ClearComponentDirty(); ClearComponentDirty(label);
if (label != null) ClearComponentDirty(emphasisStyle);
label.ClearComponentDirty(); ClearComponentDirty(blurStyle);
if (emphasisLabel != null) ClearComponentDirty(selectStyle);
emphasisLabel.ClearComponentDirty(); ClearComponentDirty(lineArrow);
if (emphasisLabelLine != null) ClearComponentDirty(titleStyle);
emphasisLabelLine.ClearComponentDirty();
if (lineArrow != null)
lineArrow.ClearComponentDirty();
if (titleStyle != null)
titleStyle.ClearComponentDirty();
} }
public override void SetAllDirty() public override void SetAllDirty()

View File

@@ -84,6 +84,10 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
public int vertCount; public int vertCount;
/// <summary> /// <summary>
/// theme的颜色索引
/// </summary>
public int colorIndex;
/// <summary>
/// 数据对应的位置坐标。 /// 数据对应的位置坐标。
/// </summary> /// </summary>
public List<Vector3> dataPoints = new List<Vector3>(); public List<Vector3> dataPoints = new List<Vector3>();
@@ -97,10 +101,6 @@ namespace XCharts.Runtime
public List<SerieData> sortedData = new List<SerieData>(); public List<SerieData> sortedData = new List<SerieData>();
public List<SerieData> rootData = new List<SerieData>(); public List<SerieData> rootData = new List<SerieData>();
/// <summary> /// <summary>
/// theme的颜色索引
/// </summary>
public int colorIndex;
/// <summary>
/// 绘制点 /// 绘制点
/// </summary> /// </summary>
public List<PointInfo> drawPoints = new List<PointInfo>(); public List<PointInfo> drawPoints = new List<PointInfo>();

View File

@@ -18,7 +18,7 @@ namespace XCharts.Runtime
"m_ParentId", "m_ParentId",
"m_Ignore", "m_Ignore",
"m_Selected", "m_Selected",
"m_Radius" "m_Radius",
}; };
public static Dictionary<Type, string> extraComponentMap = new Dictionary<Type, string> public static Dictionary<Type, string> extraComponentMap = new Dictionary<Type, string>
{ { typeof(ItemStyle), "m_ItemStyles" }, { { typeof(ItemStyle), "m_ItemStyles" },
@@ -28,9 +28,9 @@ namespace XCharts.Runtime
{ typeof(LineStyle), "m_LineStyles" }, { typeof(LineStyle), "m_LineStyles" },
{ typeof(AreaStyle), "m_AreaStyles" }, { typeof(AreaStyle), "m_AreaStyles" },
{ typeof(TitleStyle), "m_TitleStyles" }, { typeof(TitleStyle), "m_TitleStyles" },
{ typeof(EmphasisItemStyle), "m_EmphasisItemStyles" }, { typeof(EmphasisStyle), "m_EmphasisStyles" },
{ typeof(EmphasisLabelStyle), "m_EmphasisLabels" }, { typeof(BlurStyle), "m_BlurStyles" },
{ typeof(EmphasisLabelLine), "m_EmphasisLabelLines" }, { typeof(SelectStyle), "m_SelectStyles" },
}; };
[SerializeField] private int m_Index; [SerializeField] private int m_Index;
@@ -40,6 +40,7 @@ namespace XCharts.Runtime
[SerializeField] private bool m_Ignore; [SerializeField] private bool m_Ignore;
[SerializeField] private bool m_Selected; [SerializeField] private bool m_Selected;
[SerializeField] private float m_Radius; [SerializeField] private float m_Radius;
[SerializeField][Since("v3.2.0")] private SerieState m_State = SerieState.Auto;
[SerializeField][IgnoreDoc] private List<ItemStyle> m_ItemStyles = new List<ItemStyle>(); [SerializeField][IgnoreDoc] private List<ItemStyle> m_ItemStyles = new List<ItemStyle>();
[SerializeField][IgnoreDoc] private List<LabelStyle> m_Labels = new List<LabelStyle>(); [SerializeField][IgnoreDoc] private List<LabelStyle> m_Labels = new List<LabelStyle>();
[SerializeField][IgnoreDoc] private List<LabelLine> m_LabelLines = new List<LabelLine>(); [SerializeField][IgnoreDoc] private List<LabelLine> m_LabelLines = new List<LabelLine>();
@@ -47,9 +48,9 @@ namespace XCharts.Runtime
[SerializeField][IgnoreDoc] private List<LineStyle> m_LineStyles = new List<LineStyle>(); [SerializeField][IgnoreDoc] private List<LineStyle> m_LineStyles = new List<LineStyle>();
[SerializeField][IgnoreDoc] private List<AreaStyle> m_AreaStyles = new List<AreaStyle>(); [SerializeField][IgnoreDoc] private List<AreaStyle> m_AreaStyles = new List<AreaStyle>();
[SerializeField][IgnoreDoc] private List<TitleStyle> m_TitleStyles = new List<TitleStyle>(); [SerializeField][IgnoreDoc] private List<TitleStyle> m_TitleStyles = new List<TitleStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisItemStyle> m_EmphasisItemStyles = new List<EmphasisItemStyle>(); [SerializeField][IgnoreDoc] private List<EmphasisStyle> m_EmphasisStyles = new List<EmphasisStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisLabelStyle> m_EmphasisLabels = new List<EmphasisLabelStyle>(); [SerializeField][IgnoreDoc] private List<BlurStyle> m_BlurStyles = new List<BlurStyle>();
[SerializeField][IgnoreDoc] private List<EmphasisLabelLine> m_EmphasisLabelLines = new List<EmphasisLabelLine>(); [SerializeField][IgnoreDoc] private List<SelectStyle> m_SelectStyles = new List<SelectStyle>();
[SerializeField] private List<double> m_Data = new List<double>(); [SerializeField] private List<double> m_Data = new List<double>();
[NonSerialized] public SerieDataContext context = new SerieDataContext(); [NonSerialized] public SerieDataContext context = new SerieDataContext();
@@ -97,6 +98,11 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
public bool selected { get { return m_Selected; } set { m_Selected = value; } } public bool selected { get { return m_Selected; } set { m_Selected = value; } }
/// <summary> /// <summary>
/// the state of serie data.
/// |数据项的默认状态。
/// </summary>
public SerieState state { get { return m_State; } set { m_State = value; } }
/// <summary>
/// 数据项图例名称。当数据项名称不为空时图例名称即为系列名称反之则为索引index。 /// 数据项图例名称。当数据项名称不为空时图例名称即为系列名称反之则为索引index。
/// </summary> /// </summary>
/// <value></value> /// <value></value>
@@ -119,17 +125,17 @@ namespace XCharts.Runtime
public AreaStyle areaStyle { get { return m_AreaStyles.Count > 0 ? m_AreaStyles[0] : null; } } public AreaStyle areaStyle { get { return m_AreaStyles.Count > 0 ? m_AreaStyles[0] : null; } }
public TitleStyle titleStyle { get { return m_TitleStyles.Count > 0 ? m_TitleStyles[0] : null; } } public TitleStyle titleStyle { get { return m_TitleStyles.Count > 0 ? m_TitleStyles[0] : null; } }
/// <summary> /// <summary>
/// 高亮的图形样式 /// 高亮状态的样式
/// </summary> /// </summary>
public EmphasisItemStyle emphasisItemStyle { get { return m_EmphasisItemStyles.Count > 0 ? m_EmphasisItemStyles[0] : null; } } public EmphasisStyle emphasisStyle { get { return m_EmphasisStyles.Count > 0 ? m_EmphasisStyles[0] : null; } }
/// <summary> /// <summary>
/// 高亮时的标签样式 /// 淡出状态的样式
/// </summary> /// </summary>
public EmphasisLabelStyle emphasisLabel { get { return m_EmphasisLabels.Count > 0 ? m_EmphasisLabels[0] : null; } } public BlurStyle blurStyle { get { return m_BlurStyles.Count > 0 ? m_BlurStyles[0] : null; } }
/// <summary> /// <summary>
/// 高亮时的标签引导线样式 /// 选中状态的样式
/// </summary> /// </summary>
public EmphasisLabelLine emphasisLabelLine { get { return m_EmphasisLabelLines.Count > 0 ? m_EmphasisLabelLines[0] : null; } } public SelectStyle selectStyle { get { return m_SelectStyles.Count > 0 ? m_SelectStyles[0] : null; } }
/// <summary> /// <summary>
/// An arbitrary dimension data list of data item. /// An arbitrary dimension data list of data item.
@@ -152,12 +158,14 @@ namespace XCharts.Runtime
get get
{ {
return m_VertsDirty || return m_VertsDirty ||
(labelLine != null && labelLine.vertsDirty) || IsVertsDirty(labelLine) ||
(itemStyle != null && itemStyle.vertsDirty) || IsVertsDirty(itemStyle) ||
(symbol != null && symbol.vertsDirty) || IsVertsDirty(symbol) ||
(lineStyle != null && lineStyle.vertsDirty) || IsVertsDirty(lineStyle) ||
(areaStyle != null && areaStyle.vertsDirty) || IsVertsDirty(areaStyle) ||
(emphasisItemStyle != null && emphasisItemStyle.vertsDirty); IsVertsDirty(emphasisStyle) ||
IsVertsDirty(blurStyle) ||
IsVertsDirty(selectStyle);
} }
} }
public override bool componentDirty public override bool componentDirty
@@ -165,35 +173,38 @@ namespace XCharts.Runtime
get get
{ {
return m_ComponentDirty || return m_ComponentDirty ||
(labelStyle != null && labelStyle.componentDirty) || IsComponentDirty(labelStyle) ||
(labelLine != null && labelLine.componentDirty) || IsComponentDirty(labelLine) ||
(titleStyle != null && titleStyle.componentDirty) || IsComponentDirty(titleStyle) ||
(emphasisLabel != null && emphasisLabel.componentDirty) || IsComponentDirty(emphasisStyle) ||
(emphasisLabelLine != null && emphasisLabelLine.componentDirty); IsComponentDirty(blurStyle) ||
IsComponentDirty(selectStyle);
} }
} }
public override void ClearVerticesDirty() public override void ClearVerticesDirty()
{ {
base.ClearVerticesDirty(); base.ClearVerticesDirty();
if (labelLine != null) labelLine.ClearVerticesDirty(); ClearVerticesDirty(labelLine);
if (itemStyle != null) itemStyle.ClearVerticesDirty(); ClearVerticesDirty(itemStyle);
if (lineStyle != null) lineStyle.ClearVerticesDirty(); ClearVerticesDirty(lineStyle);
if (areaStyle != null) areaStyle.ClearVerticesDirty(); ClearVerticesDirty(areaStyle);
if (symbol != null) symbol.ClearVerticesDirty(); ClearVerticesDirty(emphasisStyle);
if (emphasisItemStyle != null) emphasisItemStyle.ClearVerticesDirty(); ClearVerticesDirty(blurStyle);
ClearVerticesDirty(selectStyle);
} }
public override void ClearComponentDirty() public override void ClearComponentDirty()
{ {
base.ClearComponentDirty(); base.ClearComponentDirty();
if (labelLine != null) labelLine.ClearComponentDirty(); ClearComponentDirty(labelLine);
if (itemStyle != null) itemStyle.ClearComponentDirty(); ClearComponentDirty(itemStyle);
if (lineStyle != null) lineStyle.ClearComponentDirty(); ClearComponentDirty(lineStyle);
if (areaStyle != null) areaStyle.ClearComponentDirty(); ClearComponentDirty(areaStyle);
if (symbol != null) symbol.ClearComponentDirty(); ClearComponentDirty(symbol);
if (emphasisLabel != null) emphasisLabel.ClearComponentDirty(); ClearComponentDirty(emphasisStyle);
if (emphasisLabelLine != null) emphasisLabelLine.ClearComponentDirty(); ClearComponentDirty(blurStyle);
ClearComponentDirty(selectStyle);
} }
public void Reset() public void Reset()
@@ -217,9 +228,9 @@ namespace XCharts.Runtime
m_LineStyles.Clear(); m_LineStyles.Clear();
m_AreaStyles.Clear(); m_AreaStyles.Clear();
m_TitleStyles.Clear(); m_TitleStyles.Clear();
m_EmphasisItemStyles.Clear(); m_EmphasisStyles.Clear();
m_EmphasisLabels.Clear(); m_BlurStyles.Clear();
m_EmphasisLabelLines.Clear(); m_SelectStyles.Clear();
} }
public T GetOrAddComponent<T>() where T : ChildComponent, ISerieDataComponent public T GetOrAddComponent<T>() where T : ChildComponent, ISerieDataComponent
@@ -247,23 +258,23 @@ namespace XCharts.Runtime
m_LabelLines.Add(new LabelLine() { show = true }); m_LabelLines.Add(new LabelLine() { show = true });
return m_LabelLines[0]; return m_LabelLines[0];
} }
else if (type == typeof(EmphasisItemStyle)) else if (type == typeof(EmphasisStyle))
{ {
if (m_EmphasisItemStyles.Count == 0) if (m_EmphasisStyles.Count == 0)
m_EmphasisItemStyles.Add(new EmphasisItemStyle() { show = true }); m_EmphasisStyles.Add(new EmphasisStyle() { show = true });
return m_EmphasisItemStyles[0]; return m_EmphasisStyles[0];
} }
else if (type == typeof(EmphasisLabelStyle)) else if (type == typeof(BlurStyle))
{ {
if (m_EmphasisLabels.Count == 0) if (m_BlurStyles.Count == 0)
m_EmphasisLabels.Add(new EmphasisLabelStyle() { show = true }); m_BlurStyles.Add(new BlurStyle() { show = true });
return m_EmphasisLabels[0]; return m_BlurStyles[0];
} }
else if (type == typeof(EmphasisLabelLine)) else if (type == typeof(SelectStyle))
{ {
if (m_EmphasisLabelLines.Count == 0) if (m_SelectStyles.Count == 0)
m_EmphasisLabelLines.Add(new EmphasisLabelLine() { show = true }); m_SelectStyles.Add(new SelectStyle() { show = true });
return m_EmphasisLabelLines[0]; return m_SelectStyles[0];
} }
else if (type == typeof(SerieSymbol)) else if (type == typeof(SerieSymbol))
{ {
@@ -301,9 +312,9 @@ namespace XCharts.Runtime
m_Labels.Clear(); m_Labels.Clear();
m_LabelLines.Clear(); m_LabelLines.Clear();
m_Symbols.Clear(); m_Symbols.Clear();
m_EmphasisItemStyles.Clear(); m_EmphasisStyles.Clear();
m_EmphasisLabels.Clear(); m_BlurStyles.Clear();
m_EmphasisLabelLines.Clear(); m_SelectStyles.Clear();
m_LineStyles.Clear(); m_LineStyles.Clear();
m_AreaStyles.Clear(); m_AreaStyles.Clear();
m_TitleStyles.Clear(); m_TitleStyles.Clear();
@@ -322,12 +333,12 @@ namespace XCharts.Runtime
m_Labels.Clear(); m_Labels.Clear();
else if (type == typeof(LabelLine)) else if (type == typeof(LabelLine))
m_LabelLines.Clear(); m_LabelLines.Clear();
else if (type == typeof(EmphasisItemStyle)) else if (type == typeof(EmphasisStyle))
m_EmphasisItemStyles.Clear(); m_EmphasisStyles.Clear();
else if (type == typeof(EmphasisLabelStyle)) else if (type == typeof(BlurStyle))
m_EmphasisLabels.Clear(); m_BlurStyles.Clear();
else if (type == typeof(EmphasisLabelLine)) else if (type == typeof(SelectStyle))
m_EmphasisLabelLines.Clear(); m_SelectStyles.Clear();
else if (type == typeof(SerieSymbol)) else if (type == typeof(SerieSymbol))
m_Symbols.Clear(); m_Symbols.Clear();
else if (type == typeof(LineStyle)) else if (type == typeof(LineStyle))

View File

@@ -240,11 +240,9 @@ namespace XCharts.Runtime
if (count == -1) count = serie.dataCount; if (count == -1) count = serie.dataCount;
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData); var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
if (serieLabel == null) if (serieLabel == null || !serieLabel.show)
{ {
serieLabel = SerieHelper.GetSerieEmphasisLabel(serie, serieData); return false;
if (serieLabel == null || !serieLabel.show)
return false;
} }
var dataAutoColor = GetSerieDataAutoColor(serieData); var dataAutoColor = GetSerieDataAutoColor(serieData);
@@ -375,14 +373,10 @@ namespace XCharts.Runtime
{ {
if (serieData.labelObject == null && serieData.context.dataLabels.Count <= 0) if (serieData.labelObject == null && serieData.context.dataLabels.Count <= 0)
continue; continue;
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData); var currLabel = SerieHelper.GetSerieLabel(serie, serieData);
var emphasisLabel = SerieHelper.GetSerieEmphasisLabel(serie, serieData);
var isHighlight = (serieData.context.highlight && emphasisLabel != null && emphasisLabel.show);
var isIgnore = serie.IsIgnoreIndex(serieData.index, defaultDimension); var isIgnore = serie.IsIgnoreIndex(serieData.index, defaultDimension);
var currLabel = isHighlight && emphasisLabel != null ? emphasisLabel : serieLabel;
if (serie.show && if (serie.show &&
currLabel != null && currLabel != null &&
(currLabel.show || isHighlight) &&
serieData.context.canShowLabel && serieData.context.canShowLabel &&
!isIgnore) !isIgnore)
{ {
@@ -396,7 +390,7 @@ namespace XCharts.Runtime
var labelObject = serieData.context.dataLabels[i]; var labelObject = serieData.context.dataLabels[i];
var value = serieData.GetCurrData(i, dataChangeDuration); var value = serieData.GetCurrData(i, dataChangeDuration);
var content = string.IsNullOrEmpty(currLabel.formatter) ? var content = string.IsNullOrEmpty(currLabel.formatter) ?
ChartCached.NumberToStr(value, serieLabel.numericFormatter) : ChartCached.NumberToStr(value, currLabel.numericFormatter) :
SerieLabelHelper.GetFormatterContent(serie, serieData, value, total, SerieLabelHelper.GetFormatterContent(serie, serieData, value, total,
currLabel, color); currLabel, color);
var offset = GetSerieDataLabelOffset(serieData, currLabel); var offset = GetSerieDataLabelOffset(serieData, currLabel);
@@ -418,7 +412,7 @@ namespace XCharts.Runtime
var total = serie.GetDataTotal(defaultDimension, serieData); var total = serie.GetDataTotal(defaultDimension, serieData);
var color = chart.GetItemColor(serie, serieData); var color = chart.GetItemColor(serie, serieData);
var content = string.IsNullOrEmpty(currLabel.formatter) ? var content = string.IsNullOrEmpty(currLabel.formatter) ?
ChartCached.NumberToStr(value, serieLabel.numericFormatter) : ChartCached.NumberToStr(value, currLabel.numericFormatter) :
SerieLabelHelper.GetFormatterContent(serie, serieData, value, total, SerieLabelHelper.GetFormatterContent(serie, serieData, value, total,
currLabel, color); currLabel, color);
serieData.SetLabelActive(!isIgnore); serieData.SetLabelActive(!isIgnore);
@@ -492,7 +486,9 @@ namespace XCharts.Runtime
public virtual Color GetSerieDataAutoColor(SerieData serieData) public virtual Color GetSerieDataAutoColor(SerieData serieData)
{ {
var colorIndex = serie.useDataNameForColor ? serieData.index : serie.index; var colorIndex = serie.useDataNameForColor ? serieData.index : serie.index;
return (Color) SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, false, false); Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal, false);
return (Color) color;
} }
protected void UpdateCoordSerieParams(ref List<SerieParams> paramList, ref string title, protected void UpdateCoordSerieParams(ref List<SerieParams> paramList, ref string title,
@@ -522,7 +518,7 @@ namespace XCharts.Runtime
param.dataCount = serie.dataCount; param.dataCount = serie.dataCount;
param.value = serieData.GetData(1); param.value = serieData.GetData(1);
param.total = serie.yTotal; param.total = serie.yTotal;
param.color = SerieHelper.GetItemColor(serie, serieData, chart.theme, serie.context.colorIndex, false); param.color = chart.GetItemColor(serie, serieData);
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker); param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
param.itemFormatter = itemFormatter; param.itemFormatter = itemFormatter;
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter); param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
@@ -554,6 +550,8 @@ namespace XCharts.Runtime
return; return;
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.name); var colorIndex = chart.GetLegendRealShowNameIndex(serieData.name);
Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
var param = serie.context.param; var param = serie.context.param;
param.serieName = serie.serieName; param.serieName = serie.serieName;
@@ -564,7 +562,7 @@ namespace XCharts.Runtime
param.dataCount = serie.dataCount; param.dataCount = serie.dataCount;
param.value = serieData.GetData(param.dimension); param.value = serieData.GetData(param.dimension);
param.total = SerieHelper.GetMaxData(serie, dimension); param.total = SerieHelper.GetMaxData(serie, dimension);
param.color = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, false); param.color = color;
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker); param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
param.itemFormatter = itemFormatter; param.itemFormatter = itemFormatter;
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter); param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);

View File

@@ -242,105 +242,150 @@ namespace XCharts.Runtime
} }
} }
public static SerieState GetSerieState(Serie serie)
{
if (serie.highlight || serie.context.pointerEnter) return SerieState.Emphasis;
return serie.state;
}
public static SerieState GetSerieState(Serie serie, SerieData serieData)
{
if (serieData == null || serieData.state == SerieState.Auto) return GetSerieState(serie);
if (serieData.context.highlight) return SerieState.Emphasis;
return serieData.state;
}
public static Color32 GetItemBackgroundColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, public static Color32 GetItemBackgroundColor(Serie serie, SerieData serieData, ThemeStyle theme, int index,
bool highlight, bool useDefault = true) SerieState state = SerieState.Auto, bool useDefault = false)
{ {
var color = ChartConst.clearColor32; var color = ChartConst.clearColor32;
if (highlight) var stateStyle = GetStateStyle(serie, serieData, state);
{ if (stateStyle == null)
var itemStyleEmphasis = GetItemStyleEmphasis(serie, serieData); color = GetItemStyle(serie, serieData, SerieState.Normal).backgroundColor;
if (itemStyleEmphasis != null && !ChartHelper.IsClearColor(itemStyleEmphasis.backgroundColor)) else
{ color = stateStyle.itemStyle.backgroundColor;
color = itemStyleEmphasis.backgroundColor; if (useDefault && ChartHelper.IsClearColor(color))
ChartHelper.SetColorOpacity(ref color, itemStyleEmphasis.opacity);
return color;
}
}
var itemStyle = GetItemStyle(serie, serieData);
if (!ChartHelper.IsClearColor(itemStyle.backgroundColor))
{
color = itemStyle.backgroundColor;
if (highlight) color = ChartHelper.GetHighlightColor(color);
ChartHelper.SetColorOpacity(ref color, itemStyle.opacity);
return color;
}
else if (useDefault)
{ {
color = theme.GetColor(index); color = theme.GetColor(index);
if (highlight) color = ChartHelper.GetHighlightColor(color);
color.a = 50; color.a = 50;
return color;
} }
return color; return color;
} }
public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true) public static void GetItemColor(out Color32 color, out Color32 toColor,
Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)
{ {
if (serie == null) GetItemColor(out color, out toColor, serie, serieData, theme, serie.context.colorIndex, state, true);
return ChartConst.clearColor32;
ItemStyle itemStyle = null;
if (highlight)
itemStyle = GetItemStyleEmphasis(serie, serieData);
if (itemStyle == null)
itemStyle = GetItemStyle(serie, serieData);
var color = ChartHelper.IsClearColor(itemStyle.color) ?
theme.GetColor(index) :
itemStyle.color;
if (highlight)
color = ChartHelper.GetHighlightColor(color);
if (opacity)
ChartHelper.SetColorOpacity(ref color, itemStyle.opacity);
return color;
}
public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)
{
if (serie == null)
return ChartConst.clearColor32;
ItemStyle itemStyle = null;
if (highlight)
itemStyle = GetItemStyleEmphasis(serie, serieData);
if (itemStyle == null)
itemStyle = GetItemStyle(serie, serieData);
var color = ChartHelper.IsClearColor(itemStyle.color0) ?
defaultColor :
itemStyle.color0;
if (highlight)
color = ChartHelper.GetHighlightColor(color);
ChartHelper.SetColorOpacity(ref color, itemStyle.opacity);
return color;
} }
public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true) public static void GetItemColor(out Color32 color, out Color32 toColor,
Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto, bool opacity = true)
{ {
if (serie == null) color = ColorUtil.clearColor32;
return ChartConst.clearColor32; toColor = ColorUtil.clearColor32;
if (serie == null) return;
ItemStyle itemStyle = null; if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
if (highlight) var stateStyle = GetStateStyle(serie, serieData, state);
itemStyle = GetItemStyleEmphasis(serie, serieData); if (stateStyle == null)
if (itemStyle == null)
itemStyle = GetItemStyle(serie, serieData);
var color = itemStyle.toColor;
if (ChartHelper.IsClearColor(color))
{ {
color = ChartHelper.IsClearColor(itemStyle.color) ? var style = GetItemStyle(serie, serieData, SerieState.Normal);
theme.GetColor(index) : GetColor(ref color, style.color, style.color, style.opacity, theme, index, opacity);
itemStyle.color; GetColor(ref toColor, style.toColor, color, style.opacity, theme, index, opacity);
switch (state)
{
case SerieState.Emphasis:
color = ChartHelper.GetHighlightColor(color);
toColor = ChartHelper.GetHighlightColor(toColor);
break;
case SerieState.Blur:
color = ChartHelper.GetBlurColor(color);
toColor = ChartHelper.GetBlurColor(toColor);
break;
case SerieState.Select:
color = ChartHelper.GetSelectColor(color);
toColor = ChartHelper.GetSelectColor(toColor);
break;
default:
break;
}
} }
else
{
GetColor(ref color, stateStyle.itemStyle.color, stateStyle.itemStyle.color, stateStyle.itemStyle.opacity, theme, index, opacity);
GetColor(ref toColor, stateStyle.itemStyle.toColor, color, stateStyle.itemStyle.opacity, theme, index, opacity);
}
}
if (highlight) public static void GetItemColor(out Color32 color, out Color32 toColor, out Color32 backgroundColor,
color = ChartHelper.GetHighlightColor(color); Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto, bool opacity = true)
{
color = ColorUtil.clearColor32;
toColor = ColorUtil.clearColor32;
backgroundColor = ColorUtil.clearColor32;
if (serie == null) return;
if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
var stateStyle = GetStateStyle(serie, serieData, state);
if (stateStyle == null)
{
var style = GetItemStyle(serie, serieData, SerieState.Normal);
GetColor(ref color, style.color, style.color, style.opacity, theme, index, opacity);
GetColor(ref toColor, style.toColor, color, style.opacity, theme, index, opacity);
backgroundColor = style.backgroundColor;
switch (state)
{
case SerieState.Emphasis:
color = ChartHelper.GetHighlightColor(color);
toColor = ChartHelper.GetHighlightColor(toColor);
break;
case SerieState.Blur:
color = ChartHelper.GetBlurColor(color);
toColor = ChartHelper.GetBlurColor(toColor);
break;
case SerieState.Select:
color = ChartHelper.GetSelectColor(color);
toColor = ChartHelper.GetSelectColor(toColor);
break;
default:
break;
}
}
else
{
backgroundColor = stateStyle.itemStyle.backgroundColor;
GetColor(ref color, stateStyle.itemStyle.color, stateStyle.itemStyle.color, stateStyle.itemStyle.opacity, theme, index, opacity);
GetColor(ref toColor, stateStyle.itemStyle.toColor, color, stateStyle.itemStyle.opacity, theme, index, opacity);
}
}
if (opacity) public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto, bool opacity = true)
ChartHelper.SetColorOpacity(ref color, itemStyle.opacity); {
var color = ColorUtil.clearColor32;
if (serie == null) return color;
if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
var stateStyle = GetStateStyle(serie, serieData, state);
if (stateStyle == null || !stateStyle.itemStyle.show)
{
var style = GetItemStyle(serie, serieData);
GetColor(ref color, style.color, style.color, style.opacity, theme, index, opacity);
switch (state)
{
case SerieState.Emphasis:
color = ChartHelper.GetHighlightColor(color);
break;
case SerieState.Blur:
color = ChartHelper.GetBlurColor(color);
break;
case SerieState.Select:
color = ChartHelper.GetSelectColor(color);
break;
default:
break;
}
}
else
{
GetColor(ref color, stateStyle.itemStyle.color, stateStyle.itemStyle.color, stateStyle.itemStyle.opacity, theme, index, opacity);
}
return color; return color;
} }
@@ -370,66 +415,32 @@ namespace XCharts.Runtime
} }
} }
public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false) public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)
{ {
if (highlight) if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
if (state == SerieState.Normal)
{ {
var style = GetItemStyleEmphasis(serie, serieData); return serieData != null && serieData.itemStyle != null? serieData.itemStyle : serie.itemStyle;
if (style == null) return GetItemStyle(serie, serieData, false);
else return style;
}
else if (serie.IsPerformanceMode()) return serie.itemStyle;
else if (serieData != null && serieData.itemStyle != null) return serieData.itemStyle;
else return serie.itemStyle;
}
public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)
{
if (!serie.IsPerformanceMode() && serieData != null && serieData.emphasisItemStyle != null && serieData.emphasisItemStyle.show)
return serieData.emphasisItemStyle;
else if (serie.emphasisItemStyle != null && serie.emphasisItemStyle.show) return serie.emphasisItemStyle;
else return null;
}
public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, bool highlight = false)
{
if (serieData == null) return serie.label;
if (highlight)
{
if (!serie.IsPerformanceMode() && serieData.emphasisLabel != null && serieData.emphasisLabel.show)
return serieData.emphasisLabel;
else if (serie.emphasisLabel != null && serie.emphasisLabel.show) return serie.emphasisLabel;
else return serie.label;
} }
else else
{ {
if (!serie.IsPerformanceMode() && serieData.labelStyle != null) return serieData.labelStyle; var stateStyle = GetStateStyle(serie, serieData, state);
else return serie.label; return stateStyle == null?serie.itemStyle : stateStyle.itemStyle;
} }
} }
public static LabelStyle GetSerieEmphasisLabel(Serie serie, SerieData serieData) public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)
{ {
if (!serie.IsPerformanceMode() && serieData.emphasisLabel != null && serieData.emphasisLabel.show) if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
return serieData.emphasisLabel; var stateStyle = GetStateStyle(serie, serieData, state);
else if (serie.emphasisLabel != null && serie.emphasisLabel.show) return serie.emphasisLabel; return stateStyle == null?serie.label : stateStyle.label;
else return null;
} }
public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, bool highlight = false) public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)
{ {
if (highlight) if (state == SerieState.Auto) state = GetSerieState(serie, serieData);
{ var stateStyle = GetStateStyle(serie, serieData, state);
if (!serie.IsPerformanceMode() && serieData.emphasisLabelLine != null && serieData.emphasisLabelLine.show) return stateStyle == null?serie.labelLine : stateStyle.labelLine;
return serieData.emphasisLabelLine;
else if (serie.emphasisLabelLine != null && serie.emphasisLabelLine.show) return serie.emphasisLabelLine;
else return serie.labelLine;
}
else
{
if (!serie.IsPerformanceMode() && serieData.labelLine != null) return serieData.labelLine;
else return serie.labelLine;
}
} }
public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData) public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData)
@@ -456,92 +467,139 @@ namespace XCharts.Runtime
else return serie.titleStyle; else return serie.titleStyle;
} }
public static Color32 GetAreaColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight) public static EmphasisStyle GetEmphasisStyle(Serie serie, SerieData serieData)
{ {
Color32 color = ChartConst.clearColor32; if (serieData != null && serieData.emphasisStyle != null) return serieData.emphasisStyle;
var areaStyle = GetAreaStyle(serie, serieData); else return serie.emphasisStyle;
if (areaStyle == null || !areaStyle.show)
return color;
if (!ChartHelper.IsClearColor(areaStyle.color)) color = areaStyle.color;
else if (!ChartHelper.IsClearColor(serie.itemStyle.color)) color = serie.itemStyle.color;
else color = theme.GetColor(index);
ChartHelper.SetColorOpacity(ref color, areaStyle.opacity);
if (highlight)
{
if (!ChartHelper.IsClearColor(areaStyle.highlightColor))
color = areaStyle.highlightColor;
else
color = ChartHelper.GetHighlightColor(color);
}
return color;
} }
public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight) public static BlurStyle GetBlurStyle(Serie serie, SerieData serieData)
{ {
Color32 color = ChartConst.clearColor32; if (serieData != null && serieData.blurStyle != null) return serieData.blurStyle;
var areaStyle = GetAreaStyle(serie, serieData); else return serie.blurStyle;
if (areaStyle == null || !areaStyle.show) }
return color; public static SelectStyle GetSelectStyle(Serie serie, SerieData serieData)
if (!ChartHelper.IsClearColor(areaStyle.toColor)) color = areaStyle.toColor; {
else if (!ChartHelper.IsClearColor(serie.itemStyle.toColor)) color = serie.itemStyle.toColor; if (serieData != null && serieData.selectStyle != null) return serieData.selectStyle;
else color = theme.GetColor(index); else return serie.selectStyle;
ChartHelper.SetColorOpacity(ref color, areaStyle.opacity);
if (highlight)
{
if (!ChartHelper.IsClearColor(areaStyle.highlightToColor))
color = areaStyle.highlightToColor;
else
color = ChartHelper.GetHighlightColor(color);
}
return color;
} }
public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight) public static StateStyle GetStateStyle(Serie serie, SerieData serieData, SerieState state)
{ {
Color32 color = ChartConst.clearColor32; switch (state)
var lineStyle = GetLineStyle(serie, serieData);
if (highlight)
{ {
var itemStyleEmphasis = GetItemStyleEmphasis(serie, null); case SerieState.Emphasis:
if (itemStyleEmphasis != null && !ChartHelper.IsClearColor(itemStyleEmphasis.color)) return GetEmphasisStyle(serie, serieData);
case SerieState.Blur:
return GetBlurStyle(serie, serieData);
case SerieState.Select:
return GetSelectStyle(serie, serieData);
default:
return null;
}
}
public static bool GetAreaColor(out Color32 color, out Color32 toColor,
Serie serie, SerieData serieData, ThemeStyle theme, int index)
{
color = ChartConst.clearColor32;
toColor = ChartConst.clearColor32;
var state = GetSerieState(serie, serieData);
var stateStyle = GetStateStyle(serie, serieData, state);
if (stateStyle == null)
{
var areaStyle = GetAreaStyle(serie, serieData);
if (areaStyle == null || !areaStyle.show) return false;
GetColor(ref color, areaStyle.color, serie.itemStyle.color, areaStyle.opacity, theme, index);
GetColor(ref toColor, areaStyle.toColor, color, areaStyle.opacity, theme, index);
switch (state)
{ {
color = itemStyleEmphasis.color; case SerieState.Emphasis:
ChartHelper.SetColorOpacity(ref color, itemStyleEmphasis.opacity); color = ChartHelper.GetHighlightColor(color);
return color; toColor = ChartHelper.GetHighlightColor(toColor);
break;
case SerieState.Blur:
color = ChartHelper.GetBlurColor(color);
toColor = ChartHelper.GetBlurColor(toColor);
break;
case SerieState.Select:
color = ChartHelper.GetSelectColor(color);
toColor = ChartHelper.GetSelectColor(toColor);
break;
default:
break;
} }
} }
if (!ChartHelper.IsClearColor(lineStyle.color)) color = lineStyle.color; else
else if (!ChartHelper.IsClearColor(serie.itemStyle.color)) color = serie.itemStyle.GetColor(); {
if (ChartHelper.IsClearColor(color)) color = theme.GetColor(index); if (stateStyle.areaStyle.show)
ChartHelper.SetColorOpacity(ref color, lineStyle.opacity); {
if (highlight) color = ChartHelper.GetHighlightColor(color); GetColor(ref color, stateStyle.areaStyle.color, stateStyle.itemStyle.color, stateStyle.areaStyle.opacity, theme, index);
return color; GetColor(ref color, stateStyle.areaStyle.toColor, color, stateStyle.areaStyle.opacity, theme, index);
}
else
{
return false;
}
}
return true;
} }
public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight) public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, SerieState state = SerieState.Auto)
{ {
var itemStyle = GetItemStyle(serie, serieData, highlight); Color32 color = ChartConst.clearColor32;
if (state == SerieState.Auto)
state = GetSerieState(serie, serieData);
var stateStyle = GetStateStyle(serie, serieData, state);
if (stateStyle == null)
{
var lineStyle = GetLineStyle(serie, serieData);
GetColor(ref color, lineStyle.color, serie.itemStyle.color, lineStyle.opacity, theme, index);
switch (state)
{
case SerieState.Emphasis:
return ChartHelper.GetHighlightColor(color);
case SerieState.Blur:
return ChartHelper.GetBlurColor(color);
case SerieState.Select:
return ChartHelper.GetSelectColor(color);
default:
return color;
}
}
else
{
GetColor(ref color, stateStyle.lineStyle.color, stateStyle.itemStyle.color, stateStyle.lineStyle.opacity, theme, index);
return color;
}
}
private static void GetColor(ref Color32 color, Color32 checkColor, Color32 itemColor,
float opacity, ThemeStyle theme, int colorIndex, bool setOpacity = true)
{
if (!ChartHelper.IsClearColor(checkColor)) color = checkColor;
else if (!ChartHelper.IsClearColor(itemColor)) color = itemColor;
if (ChartHelper.IsClearColor(color)) color = theme.GetColor(colorIndex);
if (setOpacity) ChartHelper.SetColorOpacity(ref color, opacity);
}
public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)
{
var itemStyle = GetItemStyle(serie, serieData, state);
if (itemStyle != null && itemStyle.borderWidth != 0) return itemStyle.borderWidth; if (itemStyle != null && itemStyle.borderWidth != 0) return itemStyle.borderWidth;
else return serie.lineStyle.GetWidth(theme.serie.lineWidth) * 2; else return serie.lineStyle.GetWidth(theme.serie.lineWidth) * 2;
} }
public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight) public static Color32 GetSymbolBorderColor(Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)
{ {
var itemStyle = GetItemStyle(serie, serieData, highlight); var itemStyle = GetItemStyle(serie, serieData, state);
if (itemStyle != null && !ChartHelper.IsClearColor(itemStyle.borderColor)) return itemStyle.borderColor; if (itemStyle != null && !ChartHelper.IsClearColor(itemStyle.borderColor)) return itemStyle.borderColor;
else return serie.itemStyle.borderColor; else return serie.itemStyle.borderColor;
} }
public static float GetSymbolBorder(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, float defaultWidth) public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, SerieState state = SerieState.Auto)
{ {
var itemStyle = GetItemStyle(serie, serieData, highlight); var itemStyle = GetItemStyle(serie, serieData, state);
if (itemStyle != null && itemStyle.borderWidth != 0) return itemStyle.borderWidth;
else return defaultWidth;
}
public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, bool highlight)
{
var itemStyle = GetItemStyle(serie, serieData, highlight);
if (itemStyle != null) return itemStyle.cornerRadius; if (itemStyle != null) return itemStyle.cornerRadius;
else return null; else return null;
} }

View File

@@ -106,7 +106,9 @@ namespace XCharts.Runtime
break; break;
} }
} }
return SerieHelper.GetItemColor(destSerie, destSerieData, chart.theme, index, false); Color32 color, toColor;
SerieHelper.GetItemColor(out color, out toColor, destSerie, destSerieData, chart.theme, index, SerieState.Normal);
return color;
} }
/// <summary> /// <summary>