mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
[feature][serie] support the colorBy of serie
This commit is contained in:
@@ -57,11 +57,13 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2022.07.24) 增加`StateStyle`的`Symbol`用于配置状态下的标记样式
|
||||
* (2022.07.24) 去掉`SerieSymbol`的`selectedSize`配置
|
||||
* (2022.07.28) 优化`Radar`雷达图效果
|
||||
* (2022.07.28) 增加`Serie`的`colorBy`参数配置取色策略
|
||||
* (2022.07.27) 增加`StateStyle`的`Symbol`用于配置状态下的标记样式
|
||||
* (2022.07.27) 去掉`SerieSymbol`的`selectedSize`参数
|
||||
* (2022.07.24) 增加`Serie`和`SerieData`的`state`设置默认状态
|
||||
* (2022.07.22) 增加`Serie`的三种状态`EmphasisStyle`,`BlurStyle`,`SelectStyle`
|
||||
* (2022.07.22) 去掉`AreaStyle`的`highlightColor`和`highlightToColor`配置
|
||||
* (2022.07.22) 去掉`AreaStyle`的`highlightColor`和`highlightToColor`参数
|
||||
* (2022.07.22) 去掉`Emphasis`,`EmphasisItemStyle`,`EmphasisLabelStyle`,`EmphasisLabelLine`组件
|
||||
* (2022.07.20) 文档支持用`Since`标识类从哪个版本开始支持
|
||||
* (2022.07.20) 修复`Axis`在`Value`轴时,`AxisLabel`的`showStartLabel`和`showEndLabel`参数设置不生效的问题
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
public override void OnCustomInspectorGUI()
|
||||
{
|
||||
PropertyField("m_ColorBy");
|
||||
PropertyField("m_Stack");
|
||||
if (serie.IsUseCoord<PolarCoord>())
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
public override void OnCustomInspectorGUI()
|
||||
{
|
||||
PropertyField("m_ColorBy");
|
||||
PropertyField("m_RadarType");
|
||||
PropertyField("m_RadarIndex");
|
||||
PropertyField("m_Smooth");
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace XCharts.Runtime
|
||||
{
|
||||
public virtual bool vertsDirty { get { return m_VertsDirty; } }
|
||||
public virtual bool componentDirty { get { return m_ComponentDirty; } }
|
||||
public virtual bool useDataNameForColor { get { return false; } }
|
||||
|
||||
public virtual SerieColorBy defaultColorBy { get { return SerieColorBy.Serie; } }
|
||||
public virtual bool titleJustForSerie { get { return false; } }
|
||||
public virtual bool useSortData { get { return false; } }
|
||||
public virtual bool multiDimensionLabel { get { return false; } }
|
||||
@@ -27,6 +28,8 @@ namespace XCharts.Runtime
|
||||
|
||||
public SerieHandler handler { get; set; }
|
||||
|
||||
|
||||
|
||||
public static void ClearVerticesDirty(ChildComponent component)
|
||||
{
|
||||
if (component != null)
|
||||
|
||||
@@ -836,7 +836,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public static Color32 GetHighlightColor(Color32 color, float rate = 1.2f)
|
||||
public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)
|
||||
{
|
||||
var newColor = color;
|
||||
newColor.r = (byte) (color.r * rate);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace XCharts.Runtime
|
||||
[SerieDataExtraField("m_Ignore", "m_Selected", "m_Radius")]
|
||||
public class Pie : Serie
|
||||
{
|
||||
public override bool useDataNameForColor { get { return true; } }
|
||||
public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
|
||||
public override bool titleJustForSerie { get { return true; } }
|
||||
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public int containerIndex { get; internal set; }
|
||||
public int containterInstanceId { get; internal set; }
|
||||
public override bool useDataNameForColor { get { return radarType == RadarType.Multiple; } }
|
||||
public override SerieColorBy defaultColorBy { get { return radarType == RadarType.Multiple?SerieColorBy.Serie : SerieColorBy.Data; } }
|
||||
public override bool multiDimensionLabel { get { return radarType == RadarType.Multiple; } }
|
||||
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
|
||||
@@ -41,8 +41,9 @@ namespace XCharts.Runtime
|
||||
|
||||
if (serie.radarType == RadarType.Single)
|
||||
{
|
||||
var colorIndex1 = serie.colorByData ? dataIndex : serie.context.colorIndex;
|
||||
UpdateItemSerieParams(ref paramList, ref title, dataIndex, category,
|
||||
marker, itemFormatter, numericFormatter);
|
||||
marker, itemFormatter, numericFormatter, 1, colorIndex1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,7 +56,8 @@ namespace XCharts.Runtime
|
||||
return;
|
||||
|
||||
Color32 color, toColor;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, dataIndex, SerieState.Normal);
|
||||
var colorIndex = serie.colorByData ? chart.GetLegendRealShowNameIndex(serieData.legendName) : serie.context.colorIndex;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
|
||||
title = serieData.name;
|
||||
for (int i = 0; i < serieData.data.Count; i++)
|
||||
{
|
||||
@@ -101,6 +103,7 @@ namespace XCharts.Runtime
|
||||
serie.context.pointerEnter = false;
|
||||
serie.context.pointerItemDataIndex = -1;
|
||||
var areaStyle = serie.areaStyle;
|
||||
var themeSymbolSize = chart.theme.serie.lineSymbolSize;
|
||||
switch (serie.radarType)
|
||||
{
|
||||
case RadarType.Multiple:
|
||||
@@ -156,12 +159,13 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serieData = serie.data[i];
|
||||
serieData.index = i;
|
||||
if (Vector3.Distance(chart.pointerPos, serieData.context.position) < serie.symbol.size * 2)
|
||||
var size = SerieHelper.GetSysmbolSize(serie, serieData, chart.theme, themeSymbolSize);
|
||||
if (Vector3.Distance(chart.pointerPos, serieData.context.position) < size * 2)
|
||||
{
|
||||
serie.highlight = true;
|
||||
serie.context.pointerEnter = true;
|
||||
serie.context.pointerItemDataIndex = i;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!serie.context.pointerEnter && areaStyle != null)
|
||||
@@ -228,7 +232,7 @@ namespace XCharts.Runtime
|
||||
var lineStyle = SerieHelper.GetLineStyle(serie, serieData);
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData, serieState);
|
||||
|
||||
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.legendName);
|
||||
var colorIndex = serie.colorByData ? chart.GetLegendRealShowNameIndex(serieData.legendName) : serie.context.colorIndex;
|
||||
var showArea = SerieHelper.GetAreaColor(out areaColor, out areaToColor, serie, serieData, chart.theme, colorIndex);
|
||||
var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, colorIndex);
|
||||
var lineWidth = lineStyle.GetWidth(chart.theme.serie.lineWidth);
|
||||
@@ -313,7 +317,8 @@ namespace XCharts.Runtime
|
||||
serieData.interact.SetValue(ref interacting, symbolSize);
|
||||
symbolSize = serie.animation.GetSysmbolSize(symbolSize);
|
||||
}
|
||||
SerieHelper.GetItemColor(out symbolColor, out symbolToColor, out symbolEmptyColor, serie, serieData, chart.theme, j, serieState);
|
||||
colorIndex = serie.colorByData ? m : colorIndex;
|
||||
SerieHelper.GetItemColor(out symbolColor, out symbolToColor, out symbolEmptyColor, serie, serieData, chart.theme, colorIndex, serieState);
|
||||
SerieHelper.GetSymbolInfo(out borderColor, out symbolBorder, out cornerRadius, serie, serieData, chart.theme, serieState);
|
||||
chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, point, symbolColor,
|
||||
symbolToColor, symbolEmptyColor, borderColor, symbol.gap, cornerRadius);
|
||||
@@ -333,13 +338,13 @@ namespace XCharts.Runtime
|
||||
|
||||
private void DrawSingleRadar(VertexHelper vh)
|
||||
{
|
||||
var radar = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
|
||||
if (radar == null)
|
||||
m_RadarCoord = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
|
||||
if (m_RadarCoord == null)
|
||||
return;
|
||||
|
||||
var indicatorNum = radar.indicatorList.Count;
|
||||
var indicatorNum = m_RadarCoord.indicatorList.Count;
|
||||
var angle = 2 * Mathf.PI / indicatorNum;
|
||||
var centerPos = radar.context.center;
|
||||
var centerPos = m_RadarCoord.context.center;
|
||||
serie.animation.InitProgress(0, 1);
|
||||
serie.context.dataPoints.Clear();
|
||||
if (!serie.show || serie.animation.HasFadeOut())
|
||||
@@ -357,7 +362,7 @@ namespace XCharts.Runtime
|
||||
var dataChangeDuration = serie.animation.GetUpdateAnimationDuration();
|
||||
var startIndex = GetStartShowIndex(serie);
|
||||
var endIndex = GetEndShowIndex(serie);
|
||||
SerieHelper.UpdateMinMaxData(serie, 1, radar.ceilRate);
|
||||
SerieHelper.UpdateMinMaxData(serie, 1, m_RadarCoord.ceilRate);
|
||||
for (int j = 0; j < serie.data.Count; j++)
|
||||
{
|
||||
var serieData = serie.data[j];
|
||||
@@ -371,25 +376,26 @@ namespace XCharts.Runtime
|
||||
}
|
||||
var lineStyle = SerieHelper.GetLineStyle(serie, serieData);
|
||||
Color32 areaColor, areaToColor;
|
||||
var showArea = SerieHelper.GetAreaColor(out areaColor, out areaToColor, serie, serieData, chart.theme, j);
|
||||
var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, j);
|
||||
int dataCount = radar.indicatorList.Count;
|
||||
var colorIndex = serie.colorByData?j : serie.context.colorIndex;
|
||||
var showArea = SerieHelper.GetAreaColor(out areaColor, out areaToColor, serie, serieData, chart.theme, colorIndex);
|
||||
var lineColor = SerieHelper.GetLineColor(serie, serieData, chart.theme, colorIndex);
|
||||
int dataCount = m_RadarCoord.indicatorList.Count;
|
||||
var index = serieData.index;
|
||||
var p = radar.context.center;
|
||||
var max = radar.GetIndicatorMax(index);
|
||||
var p = m_RadarCoord.context.center;
|
||||
var max = m_RadarCoord.GetIndicatorMax(index);
|
||||
var value = serieData.GetCurrData(1, dataChangeDuration);
|
||||
if (serieData.IsDataChanged()) dataChanging = true;
|
||||
if (max == 0)
|
||||
{
|
||||
max = serie.context.dataMax;
|
||||
}
|
||||
if (!radar.IsInIndicatorRange(j, serieData.GetData(1)))
|
||||
if (!m_RadarCoord.IsInIndicatorRange(j, serieData.GetData(1)))
|
||||
{
|
||||
lineColor = radar.outRangeColor;
|
||||
lineColor = m_RadarCoord.outRangeColor;
|
||||
}
|
||||
var radius = (float) (max < 0 ? radar.context.dataRadius - radar.context.dataRadius * value / max :
|
||||
radar.context.dataRadius * value / max);
|
||||
var currAngle = (index + (radar.positionType == RadarCoord.PositionType.Between ? 0.5f : 0)) * angle;
|
||||
var radius = (float) (max < 0 ? m_RadarCoord.context.dataRadius - m_RadarCoord.context.dataRadius * value / max :
|
||||
m_RadarCoord.context.dataRadius * value / max);
|
||||
var currAngle = (index + (m_RadarCoord.positionType == RadarCoord.PositionType.Between ? 0.5f : 0)) * angle;
|
||||
radius *= rate;
|
||||
if (index == startIndex)
|
||||
{
|
||||
@@ -409,11 +415,11 @@ namespace XCharts.Runtime
|
||||
}
|
||||
if (lineStyle.show && !serie.smooth)
|
||||
{
|
||||
if (radar.connectCenter)
|
||||
if (m_RadarCoord.connectCenter)
|
||||
ChartDrawer.DrawLineStyle(vh, lineStyle, startPoint, centerPos,
|
||||
chart.theme.serie.lineWidth, LineStyle.Type.Solid, lastColor, lastColor);
|
||||
ChartDrawer.DrawLineStyle(vh, lineStyle, startPoint, toPoint, chart.theme.serie.lineWidth,
|
||||
LineStyle.Type.Solid, radar.lineGradient ? lastColor : lineColor, lineColor);
|
||||
LineStyle.Type.Solid, m_RadarCoord.lineGradient ? lastColor : lineColor, lineColor);
|
||||
}
|
||||
startPoint = toPoint;
|
||||
lastColor = lineColor;
|
||||
@@ -428,11 +434,11 @@ namespace XCharts.Runtime
|
||||
}
|
||||
if (lineStyle.show && j == endIndex && !serie.smooth)
|
||||
{
|
||||
if (radar.connectCenter)
|
||||
if (m_RadarCoord.connectCenter)
|
||||
ChartDrawer.DrawLineStyle(vh, lineStyle, startPoint, centerPos,
|
||||
chart.theme.serie.lineWidth, LineStyle.Type.Solid, lastColor, lastColor);
|
||||
ChartDrawer.DrawLineStyle(vh, lineStyle, startPoint, firstPoint, chart.theme.serie.lineWidth,
|
||||
LineStyle.Type.Solid, lineColor, radar.lineGradient ? firstColor : lineColor);
|
||||
LineStyle.Type.Solid, lineColor, m_RadarCoord.lineGradient ? firstColor : lineColor);
|
||||
}
|
||||
}
|
||||
if (serie.smooth)
|
||||
@@ -455,14 +461,14 @@ namespace XCharts.Runtime
|
||||
var serieData = serie.data[j];
|
||||
if (!serieData.show) continue;
|
||||
var state = SerieHelper.GetSerieState(serie, serieData);
|
||||
var serieIndex = serieData.index;
|
||||
var symbolSize = SerieHelper.GetSysmbolSize(serie, serieData, chart.theme, chart.theme.serie.lineSymbolSize, state);
|
||||
SerieHelper.GetItemColor(out symbolColor, out symbolToColor, out symbolEmptyColor, serie, serieData, chart.theme, serieIndex, state);
|
||||
var colorIndex = serie.colorByData ? serieData.index : serie.context.colorIndex;
|
||||
SerieHelper.GetItemColor(out symbolColor, out symbolToColor, out symbolEmptyColor, serie, serieData, chart.theme, colorIndex, state);
|
||||
SerieHelper.GetSymbolInfo(out borderColor, out symbolBorder, out cornerRadius, serie, serieData, chart.theme, state);
|
||||
if (!radar.IsInIndicatorRange(j, serieData.GetData(1)))
|
||||
if (!m_RadarCoord.IsInIndicatorRange(j, serieData.GetData(1)))
|
||||
{
|
||||
symbolColor = radar.outRangeColor;
|
||||
symbolToColor = radar.outRangeColor;
|
||||
symbolColor = m_RadarCoord.outRangeColor;
|
||||
symbolToColor = m_RadarCoord.outRangeColor;
|
||||
}
|
||||
chart.DrawSymbol(vh, serie.symbol.type, symbolSize, symbolBorder, serieData.context.labelPosition, symbolColor,
|
||||
symbolToColor, symbolEmptyColor, borderColor, serie.symbol.gap, cornerRadius);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace XCharts.Runtime
|
||||
[SerieDataExtraField()]
|
||||
public class Ring : Serie
|
||||
{
|
||||
public override bool useDataNameForColor { get { return true; } }
|
||||
public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
{
|
||||
var serie = chart.AddSerie<Ring>(serieName);
|
||||
|
||||
@@ -194,6 +194,29 @@ namespace XCharts.Runtime
|
||||
Auto
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The policy to take color from theme.
|
||||
/// |从主题中取色策略。
|
||||
/// </summary>
|
||||
public enum SerieColorBy
|
||||
{
|
||||
/// <summary>
|
||||
/// Select state.
|
||||
/// |默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略,Pie默认是Data策略
|
||||
/// </summary>
|
||||
Default,
|
||||
/// <summary>
|
||||
/// assigns the colors in the palette by serie, so that all data in the same series are in the same color;.
|
||||
/// |按照系列分配调色盘中的颜色,同一系列中的所有数据都是用相同的颜色。
|
||||
/// </summary>
|
||||
Serie,
|
||||
/// <summary>
|
||||
/// assigns colors in the palette according to data items, with each data item using a different color..
|
||||
/// |按照数据项分配调色盘中的颜色,每个数据项都使用不同的颜色。
|
||||
/// </summary>
|
||||
Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 系列。
|
||||
/// </summary>
|
||||
@@ -206,6 +229,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private string m_SerieType = "";
|
||||
[SerializeField] private string m_SerieName;
|
||||
[SerializeField][Since("v3.2.0")] private SerieState m_State = SerieState.Normal;
|
||||
[SerializeField][Since("v3.2.0")] private SerieColorBy m_ColorBy = SerieColorBy.Default;
|
||||
[SerializeField] private string m_Stack;
|
||||
[SerializeField] private int m_XAxisIndex = 0;
|
||||
[SerializeField] private int m_YAxisIndex = 0;
|
||||
@@ -339,6 +363,16 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_State, value)) { SetAllDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// The policy to take color from theme.
|
||||
/// |从主题中取色的策略。
|
||||
/// </summary>
|
||||
public SerieColorBy colorBy
|
||||
{
|
||||
//get { return m_ColorBy; }
|
||||
get { return m_ColorBy == SerieColorBy.Default?defaultColorBy : m_ColorBy; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_ColorBy, value)) { SetAllDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|
||||
/// |数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
|
||||
/// </summary>
|
||||
@@ -860,7 +894,10 @@ namespace XCharts.Runtime
|
||||
/// 系列中的数据内容数组。SerieData可以设置1到n维数据。
|
||||
/// </summary>
|
||||
public List<SerieData> data { get { return m_Data; } }
|
||||
|
||||
/// <summary>
|
||||
/// 取色策略是否为按数据项分配。
|
||||
/// </summary>
|
||||
public bool colorByData { get { return colorBy == SerieColorBy.Data; } }
|
||||
public override bool vertsDirty
|
||||
{
|
||||
get
|
||||
@@ -1703,7 +1740,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public bool IsLegendName(string legendName)
|
||||
{
|
||||
if (useDataNameForColor)
|
||||
if (colorBy == SerieColorBy.Data)
|
||||
{
|
||||
return IsSerieDataLegendName(legendName) || IsSerieLegendName(legendName);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public override void OnLegendButtonClick(int index, string legendName, bool show)
|
||||
{
|
||||
if (serie.useDataNameForColor && serie.IsSerieDataLegendName(legendName))
|
||||
if (serie.colorByData && serie.IsSerieDataLegendName(legendName))
|
||||
{
|
||||
LegendHelper.CheckDataShow(serie, legendName, show);
|
||||
chart.UpdateLegendColor(legendName, show);
|
||||
@@ -159,7 +159,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public override void OnLegendButtonEnter(int index, string legendName)
|
||||
{
|
||||
if (serie.useDataNameForColor && serie.IsSerieDataLegendName(legendName))
|
||||
if (serie.colorByData && serie.IsSerieDataLegendName(legendName))
|
||||
{
|
||||
LegendHelper.CheckDataHighlighted(serie, legendName, true);
|
||||
chart.RefreshPainter(serie);
|
||||
@@ -173,7 +173,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public override void OnLegendButtonExit(int index, string legendName)
|
||||
{
|
||||
if (serie.useDataNameForColor && serie.IsSerieDataLegendName(legendName))
|
||||
if (serie.colorByData && serie.IsSerieDataLegendName(legendName))
|
||||
{
|
||||
LegendHelper.CheckDataHighlighted(serie, legendName, false);
|
||||
chart.RefreshPainter(serie);
|
||||
@@ -485,7 +485,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public virtual Color GetSerieDataAutoColor(SerieData serieData)
|
||||
{
|
||||
var colorIndex = serie.useDataNameForColor ? serieData.index : serie.index;
|
||||
var colorIndex = serie.colorByData ? serieData.index : serie.index;
|
||||
Color32 color, toColor;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal, false);
|
||||
return (Color) color;
|
||||
@@ -533,7 +533,7 @@ namespace XCharts.Runtime
|
||||
|
||||
protected void UpdateItemSerieParams(ref List<SerieParams> paramList, ref string title,
|
||||
int dataIndex, string category, string marker,
|
||||
string itemFormatter, string numericFormatter, int dimension = 1)
|
||||
string itemFormatter, string numericFormatter, int dimension = 1, int colorIndex = -1)
|
||||
{
|
||||
if (dataIndex < 0)
|
||||
dataIndex = serie.context.pointerItemDataIndex;
|
||||
@@ -549,10 +549,11 @@ namespace XCharts.Runtime
|
||||
if (serie.placeHolder || TooltipHelper.IsIgnoreFormatter(itemFormatter))
|
||||
return;
|
||||
|
||||
var colorIndex = chart.GetLegendRealShowNameIndex(serieData.name);
|
||||
if (colorIndex < 0)
|
||||
colorIndex = serie.colorByData?dataIndex : 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;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
|
||||
@@ -282,7 +282,8 @@ namespace XCharts.Runtime
|
||||
public static void GetItemColor(out Color32 color, out Color32 toColor,
|
||||
Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)
|
||||
{
|
||||
GetItemColor(out color, out toColor, serie, serieData, theme, serie.context.colorIndex, state, true);
|
||||
var colorIndex = serie.colorByData? serieData.index : serie.context.colorIndex;
|
||||
GetItemColor(out color, out toColor, serie, serieData, theme, colorIndex, state, true);
|
||||
}
|
||||
|
||||
public static void GetItemColor(out Color32 color, out Color32 toColor,
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serie = series[n];
|
||||
if (serie.placeHolder) continue;
|
||||
if (serie.useDataNameForColor)
|
||||
if (serie.colorByData)
|
||||
{
|
||||
for (int i = 0; i < serie.data.Count; i++)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serie = chart.series[n];
|
||||
if (serie.placeHolder) continue;
|
||||
if (serie.useDataNameForColor)
|
||||
if (serie.colorByData)
|
||||
{
|
||||
for (int i = 0; i < serie.data.Count; i++)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serie = series[n];
|
||||
if (serie.placeHolder) continue;
|
||||
if (serie.useDataNameForColor)
|
||||
if (serie.colorByData)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < serie.data.Count; i++)
|
||||
|
||||
Reference in New Issue
Block a user