3.0 - radar chart

This commit is contained in:
monitor1394
2022-01-22 21:08:26 +08:00
parent a8b2068029
commit d9840bef52
29 changed files with 471 additions and 249 deletions

View File

@@ -42,7 +42,7 @@ namespace XCharts
private void InitLegend(Legend legend)
{
legend.painter = null; // legend component does not need to paint
legend.painter = null;
legend.refreshComponent = delegate ()
{
legend.OnChanged();
@@ -55,9 +55,10 @@ namespace XCharts
if (legend.show && legend.data.Count > 0)
{
datas = new List<string>();
for (int i = 0; i < chart.m_LegendRealShowName.Count; i++)
foreach (var data in legend.data)
{
if (legend.data.Contains(chart.m_LegendRealShowName[i])) datas.Add(chart.m_LegendRealShowName[i]);
if (chart.m_LegendRealShowName.Contains(data) || chart.IsSerieName(data))
datas.Add(data);
}
}
else
@@ -130,13 +131,6 @@ namespace XCharts
chart.OnLegendButtonExit(index, selectedName);
});
}
if (legend.selectedMode == Legend.SelectedMode.Single)
{
for (int n = 0; n < chart.m_LegendRealShowName.Count; n++)
{
chart.OnLegendButtonClick(n, chart.m_LegendRealShowName[n], n == 0 ? true : false);
}
}
LegendHelper.ResetItemPosition(legend, chart.chartPosition, chart.chartWidth, chart.chartHeight);
};
legend.refreshComponent();