增加Tooltipformatter{.}{c:0}{c1:1}的支持

This commit is contained in:
monitor1394
2020-04-23 13:07:49 +08:00
parent cc5c5d3078
commit 9e3e569396
9 changed files with 343 additions and 61 deletions

View File

@@ -22,11 +22,10 @@ namespace XCharts
private static Dictionary<float, string> s_ValueToEStr = new Dictionary<float, string>(1000);
private static Dictionary<int, string> s_IntToStr = new Dictionary<int, string>(1000);
private static Dictionary<int, string> s_IntToFn = new Dictionary<int, string>(20);
private static Dictionary<Color, string> s_ColorToStr = new Dictionary<Color, string>(1000);
private static Dictionary<Color, string> s_ColorToStr = new Dictionary<Color, string>(100);
private static Dictionary<int, string> s_SerieLabelName = new Dictionary<int, string>(1000);
private static Dictionary<int, string> s_AxisLabelName = new Dictionary<int, string>(1000);
private static Dictionary<Color, string> s_ColorDotStr = new Dictionary<Color, string>(100);
public static string FloatToStr(float value, int f = 0, bool forceE = false)
{
@@ -88,6 +87,15 @@ namespace XCharts
}
}
public static string ColorToDotStr(Color color)
{
if (!s_ColorDotStr.ContainsKey(color))
{
s_ColorDotStr[color] = "<color=#" + ColorToStr(color) + ">● </color>";
}
return s_ColorDotStr[color];
}
internal static string GetSerieLabelName(string prefix, int i, int j)
{
int key = i * 10000000 + j;