修复Tooltip在对数轴时指示不准确的问题

This commit is contained in:
monitor1394
2023-11-28 10:04:15 +08:00
parent 7ea260b986
commit 0a19b2a6cc
8 changed files with 81 additions and 22 deletions

View File

@@ -22,6 +22,7 @@ namespace XCharts.Runtime
private static Dictionary<double, Dictionary<string, string>> s_NumberToStr = new Dictionary<double, Dictionary<string, string>>();
private static Dictionary<int, Dictionary<string, string>> s_PrecisionToStr = new Dictionary<int, Dictionary<string, string>>();
private static Dictionary<string, Dictionary<int, string>> s_StringIntDict = new Dictionary<string, Dictionary<int, string>>();
public static string FloatToStr(double value, string numericFormatter = "F", int precision = 0)
{
@@ -113,6 +114,19 @@ namespace XCharts.Runtime
}
}
public static string GetString(string prefix, int suffix)
{
if (!s_StringIntDict.ContainsKey(prefix))
{
s_StringIntDict[prefix] = new Dictionary<int, string>();
}
if (!s_StringIntDict[prefix].ContainsKey(suffix))
{
s_StringIntDict[prefix][suffix] = prefix + suffix;
}
return s_StringIntDict[prefix][suffix];
}
internal static string GetComponentObjectName(MainComponent component)
{
Dictionary<int, string> dict;