优化Log对数轴

This commit is contained in:
monitor1394
2023-10-19 23:06:26 +08:00
parent 6b931497ab
commit 68d5bc36d6
3 changed files with 14 additions and 22 deletions

View File

@@ -828,6 +828,8 @@ namespace XCharts.Runtime
public double GetLogMinIndex()
{
if (context.minValue <= 0 || context.minValue == 1)
return 0;
return logBaseE ?
Math.Log(context.minValue) :
Math.Log(context.minValue, logBase);
@@ -835,6 +837,8 @@ namespace XCharts.Runtime
public double GetLogMaxIndex()
{
if (context.maxValue <= 0 || context.maxValue == 1)
return 0;
return logBaseE ?
Math.Log(context.maxValue) :
Math.Log(context.maxValue, logBase);