mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 13:30:10 +00:00
增加HeatmapChart热力图
This commit is contained in:
@@ -9,6 +9,7 @@ namespace XCharts
|
||||
private static Dictionary<float, string> s_ValueToF2Str = new Dictionary<float, string>(1000);
|
||||
private static Dictionary<float, string> s_ValueToStr = new Dictionary<float, string>(1000);
|
||||
private static Dictionary<int, string> s_IntToStr = new Dictionary<int, string>(1000);
|
||||
private static Dictionary<Color, string> s_ColorToStr = new Dictionary<Color, string>(1000);
|
||||
|
||||
public static string FloatToStr(float value, int f = 0)
|
||||
{
|
||||
@@ -42,5 +43,18 @@ namespace XCharts
|
||||
return s_IntToStr[value];
|
||||
}
|
||||
}
|
||||
|
||||
public static string ColorToStr(Color color)
|
||||
{
|
||||
if (s_ColorToStr.ContainsKey(color))
|
||||
{
|
||||
return s_ColorToStr[color];
|
||||
}
|
||||
else
|
||||
{
|
||||
s_ColorToStr[color] = ColorUtility.ToHtmlStringRGBA(color);
|
||||
return s_ColorToStr[color];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user