增加GridCoord3D3D坐标系

This commit is contained in:
monitor1394
2024-04-22 22:25:12 +08:00
parent e2120b3da6
commit 120c6d5408
55 changed files with 2062 additions and 51 deletions

View File

@@ -386,8 +386,8 @@ namespace XCharts.Runtime
}
}
public float runtimeRangeMinHeight { get { return (float) ((rangeMin - min) / (max - min) * itemHeight); } }
public float runtimeRangeMaxHeight { get { return (float) ((rangeMax - min) / (max - min) * itemHeight); } }
public float runtimeRangeMinHeight { get { return (float)((rangeMin - min) / (max - min) * itemHeight); } }
public float runtimeRangeMaxHeight { get { return (float)((rangeMax - min) / (max - min) * itemHeight); } }
public void AddColors(List<Color32> colors)
{
@@ -413,6 +413,25 @@ namespace XCharts.Runtime
}
}
public Color32 GetColor(double xValue, double yValue, double zValue, byte alpha = 255)
{
Color32 color;
if (m_Dimension == 0)
{
color = GetColor(xValue);
}
else if (m_Dimension == 1)
{
color = GetColor(yValue);
}
else
{
color = GetColor(zValue);
}
color.a = alpha;
return color;
}
public Color32 GetColor(double value)
{
int index = GetIndex(value);
@@ -437,7 +456,7 @@ namespace XCharts.Runtime
if (index == splitNumber - 1)
return m_InRange[index].color;
else
return Color32.Lerp(m_InRange[index].color, m_InRange[index + 1].color, (float) rate);
return Color32.Lerp(m_InRange[index].color, m_InRange[index + 1].color, (float)rate);
}
}