mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 16:00:24 +00:00
[code] refactor the code
This commit is contained in:
@@ -8,18 +8,19 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serieLabel = data.label;
|
||||
var numericFormatter = serieLabel.numericFormatter;
|
||||
if (serieLabel.formatterFunction != null)
|
||||
{
|
||||
return serieLabel.formatterFunction(data.index, data.runtimeValue, null);
|
||||
}
|
||||
if (string.IsNullOrEmpty(serieLabel.formatter))
|
||||
return ChartCached.NumberToStr(data.runtimeValue, numericFormatter);
|
||||
{
|
||||
var content = ChartCached.NumberToStr(data.runtimeValue, numericFormatter);
|
||||
return serieLabel.formatterFunction == null? content:
|
||||
serieLabel.formatterFunction(data.index, data.runtimeValue, null, content);
|
||||
}
|
||||
else
|
||||
{
|
||||
var content = serieLabel.formatter;
|
||||
FormatterHelper.ReplaceSerieLabelContent(ref content, numericFormatter, serie.dataCount, data.runtimeValue,
|
||||
0, serie.serieName, data.name, data.name, Color.clear, null);
|
||||
return content;
|
||||
return serieLabel.formatterFunction == null? content:
|
||||
serieLabel.formatterFunction(data.index, data.runtimeValue, null, content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user