mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
3.0 - optimize code
This commit is contained in:
@@ -19,7 +19,6 @@ namespace XCharts.Runtime
|
||||
private static Dictionary<Color, string> s_ColorDotStr = new Dictionary<Color, string>(100);
|
||||
private static Dictionary<Type, Dictionary<int, string>> s_ComponentObjectName = new Dictionary<Type, Dictionary<int, string>>();
|
||||
private static Dictionary<int, string> s_AxisLabelName = new Dictionary<int, string>();
|
||||
private static Dictionary<string, string> s_AxisLabel = new Dictionary<string, string>();
|
||||
private static Dictionary<Type, string> s_TypeName = new Dictionary<Type, string>();
|
||||
|
||||
|
||||
@@ -158,15 +157,6 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetAxisTooltipLabel(string axisName)
|
||||
{
|
||||
if (!s_AxisLabel.ContainsKey(axisName))
|
||||
{
|
||||
s_AxisLabel[axisName] = axisName + "_label";
|
||||
}
|
||||
return s_AxisLabel[axisName];
|
||||
}
|
||||
|
||||
internal static string GetTypeName<T>()
|
||||
{
|
||||
return GetTypeName(typeof(T));
|
||||
|
||||
@@ -794,9 +794,6 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static Vector3 RotateRound(Vector3 position, Vector3 center, Vector3 axis, float angle)
|
||||
{
|
||||
Vector3 point = Quaternion.AngleAxis(angle, axis) * (position - center);
|
||||
@@ -857,23 +854,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public static float GetRuntimeRelativeOrAbsoluteValue(float check, float total)
|
||||
{
|
||||
if (check <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (check <= 1)
|
||||
{
|
||||
return total * check;
|
||||
}
|
||||
else
|
||||
{
|
||||
return check;
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 GetLastPoint(List<Vector3> list)
|
||||
public static Vector3 GetLastValue(List<Vector3> list)
|
||||
{
|
||||
if (list.Count <= 0) return Vector3.zero;
|
||||
else return list[list.Count - 1];
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static RadiusAxis GetRadiusAxis(List<MainComponent> components, int polarIndex)
|
||||
{
|
||||
foreach (var component in components)
|
||||
@@ -32,32 +33,6 @@ namespace XCharts.Runtime
|
||||
return null;
|
||||
}
|
||||
|
||||
public static YAxis GetYAxisRelatedWitchXAxis(List<MainComponent> components, XAxis axis)
|
||||
{
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (component is YAxis)
|
||||
{
|
||||
var yAxis = component as YAxis;
|
||||
if (yAxis.gridIndex == axis.gridIndex) return yAxis;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static XAxis GetXAxisRelatedWithYAxis(List<MainComponent> components, YAxis axis)
|
||||
{
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (component is XAxis)
|
||||
{
|
||||
var xAxis = component as XAxis;
|
||||
if (xAxis.gridIndex == axis.gridIndex) return xAxis;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static float GetXAxisOnZeroOffset(List<MainComponent> components, XAxis axis)
|
||||
{
|
||||
if (!axis.axisLine.onZero) return 0;
|
||||
|
||||
Reference in New Issue
Block a user