增加折线图对数轴Log的支持

This commit is contained in:
monitor1394
2020-01-15 19:41:21 +08:00
parent 4e709ab253
commit f5037dafb1
9 changed files with 198 additions and 34 deletions

View File

@@ -146,10 +146,17 @@ namespace XCharts
}
}
public string GetFormatterContent(float value, float minValue, float maxValue)
public string GetFormatterContent(float value, float minValue, float maxValue, bool isLog = false)
{
if (string.IsNullOrEmpty(m_Formatter))
{
if (isLog)
{
if (value - (int)value == 0)
return ChartCached.IntToStr((int)value);
else
return ChartCached.FloatToStr(value);
}
if (minValue >= -1 && minValue <= 1 && maxValue >= -1 && maxValue <= 1)
{
int minAcc = ChartHelper.GetFloatAccuracy(minValue);