优化PieChart支持设置ignoreValue不显示指定数据

This commit is contained in:
monitor1394
2020-05-30 10:27:54 +08:00
parent 0dd194a6cf
commit 51c973a7ea
6 changed files with 18 additions and 4 deletions

View File

@@ -80,6 +80,11 @@ namespace XCharts
serieData.labelObject.label.fontStyle = label.fontStyle;
}
public static bool CanShowLabel(Serie serie, SerieData serieData, SerieLabel label, int dimesion)
{
return serie.show && serieData.canShowLabel && !serie.IsIgnoreValue(serieData.GetData(dimesion));
}
public static string GetFormatterContent(Serie serie, SerieData serieData,
float dataValue, float dataTotal, SerieLabel serieLabel = null)
{

View File

@@ -102,6 +102,7 @@ namespace XCharts
case SerieType.Ring:
for (int i = 0; i < serie.data.Count; i++)
{
if (serie.type == SerieType.Pie && serie.IsIgnoreValue(serie.data[i].GetData(1))) continue;
if (string.IsNullOrEmpty(serie.data[i].name))
serieNameList.Add(ChartCached.IntToStr(i));
else if (!serieNameList.Contains(serie.data[i].name))