增加LineChart的普通折线图可通过设置ingore参数过滤数据的支持

This commit is contained in:
monitor1394
2020-03-10 09:12:47 +08:00
parent d010c9d986
commit 705652d50c
9 changed files with 147 additions and 30 deletions

View File

@@ -421,6 +421,7 @@ namespace XCharts
string key = serie.name;
float xValue, yValue;
serie.GetXYData(index, m_DataZoom, out xValue, out yValue);
var isIngore = ChartHelper.IsIngore(serie.dataPoints[index]);
if (isCartesian)
{
var serieData = serie.GetSerieData(index, m_DataZoom);
@@ -433,10 +434,12 @@ namespace XCharts
}
else
{
var valueTxt = isIngore ? m_Tooltip.ingoreDataDefaultContent :
ChartCached.FloatToStr(yValue, 0, m_Tooltip.forceENotation);
sb.Append("\n")
.Append("<color=#").Append(m_ThemeInfo.GetColorStr(i)).Append(">● </color>")
.Append(key).Append(!string.IsNullOrEmpty(key) ? " : " : "")
.Append(ChartCached.FloatToStr(yValue, 0, m_Tooltip.forceENotation));
.Append(valueTxt);
}
}
}
@@ -1438,7 +1441,8 @@ namespace XCharts
for (int j = 0; j < serie.data.Count; j++)
{
var serieData = serie.data[j];
if (serie.label.show || serieData.iconStyle.show)
var isIngore = ChartHelper.IsIngore(serie.dataPoints[j]);
if ((serie.label.show || serieData.iconStyle.show) && !isIngore)
{
var pos = serie.dataPoints[j];
var value = serieData.data[1];