mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
增加Radar对通配符{b}的支持
This commit is contained in:
@@ -66,6 +66,7 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2023.04.12) 增加`RadarChart`对通配符`{b}`的支持
|
||||
* (2023.04.11) 修复动态添加组件时`Inspector`可能异常的问题
|
||||
|
||||
## v3.6.0
|
||||
|
||||
@@ -429,6 +429,13 @@ namespace XCharts.Runtime
|
||||
return indicatorList[indicatorIndex];
|
||||
}
|
||||
|
||||
public string GetIndicatorName(int indicatorIndex)
|
||||
{
|
||||
var indicator = GetIndicator(indicatorIndex);
|
||||
if (indicator == null) return string.Empty;
|
||||
return indicator.name;
|
||||
}
|
||||
|
||||
public override void ClearData()
|
||||
{
|
||||
indicatorList.Clear();
|
||||
|
||||
@@ -38,18 +38,19 @@ namespace XCharts.Runtime
|
||||
if (dataIndex < 0)
|
||||
return;
|
||||
|
||||
var radar = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
|
||||
if (radar == null)
|
||||
return;
|
||||
|
||||
if (serie.radarType == RadarType.Single)
|
||||
{
|
||||
var colorIndex1 = serie.colorByData ? dataIndex : serie.context.colorIndex;
|
||||
category = radar.GetIndicatorName(dataIndex);
|
||||
UpdateItemSerieParams(ref paramList, ref title, dataIndex, category,
|
||||
marker, itemFormatter, numericFormatter, ignoreDataDefaultContent, 1, colorIndex1);
|
||||
return;
|
||||
}
|
||||
|
||||
var radar = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
|
||||
if (radar == null)
|
||||
return;
|
||||
|
||||
var serieData = serie.GetSerieData(dataIndex);
|
||||
if (serieData == null)
|
||||
return;
|
||||
@@ -72,6 +73,7 @@ namespace XCharts.Runtime
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = indicator.max;
|
||||
param.color = color;
|
||||
param.category = radar.GetIndicatorName(i);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
|
||||
Reference in New Issue
Block a user