mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 10:20:10 +00:00
3.0
This commit is contained in:
@@ -481,5 +481,11 @@ namespace XCharts.Runtime
|
||||
m_PainterTop.material = material;
|
||||
}
|
||||
}
|
||||
|
||||
public Color32 GetChartBackgroundColor()
|
||||
{
|
||||
var background = GetChartComponent<Background>();
|
||||
return theme.GetBackgroundColor(background);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace XCharts.Runtime
|
||||
Vector3 pos, Color32 color, Color32 toColor, Color32 emptyColor, Color32 borderColor,
|
||||
float gap, float[] cornerRadius, Vector3 startPos)
|
||||
{
|
||||
var backgroundColor = theme.GetBackgroundColor(GetChartComponent<Background>());
|
||||
var backgroundColor = GetChartBackgroundColor();
|
||||
if (ChartHelper.IsClearColor(emptyColor))
|
||||
emptyColor = backgroundColor;
|
||||
var smoothness = settings.cicleSmoothness;
|
||||
|
||||
@@ -597,7 +597,9 @@ namespace XCharts.Runtime
|
||||
|
||||
protected virtual void DrawBackground(VertexHelper vh)
|
||||
{
|
||||
if (HasChartComponent<Background>()) return;
|
||||
var background = GetChartComponent<Background>();
|
||||
if (background != null && background.show)
|
||||
return;
|
||||
Vector3 p1 = new Vector3(chartX, chartY + chartHeight);
|
||||
Vector3 p2 = new Vector3(chartX + chartWidth, chartY + chartHeight);
|
||||
Vector3 p3 = new Vector3(chartX + chartWidth, chartY);
|
||||
|
||||
@@ -86,6 +86,33 @@ namespace XCharts.Runtime
|
||||
return chartList.Contains(chart);
|
||||
}
|
||||
|
||||
public static bool IsRepeatChartName(BaseChart chart, string chartName = null)
|
||||
{
|
||||
if (chartName == null)
|
||||
chartName = chart.chartName;
|
||||
if (string.IsNullOrEmpty(chartName))
|
||||
return false;
|
||||
foreach (var temp in chartList)
|
||||
{
|
||||
if (temp != chart && chartName.Equals(temp.chartName))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetRepeatChartNameInfo(BaseChart chart, string chartName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(chartName))
|
||||
return string.Empty;
|
||||
string result = "";
|
||||
foreach (var temp in chartList)
|
||||
{
|
||||
if (temp != chart && chartName.Equals(temp.chartName))
|
||||
result += ChartHelper.GetFullName(temp.transform) + "\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void RemoveAllChartObject()
|
||||
{
|
||||
if (chartList.Count == 0)
|
||||
|
||||
Reference in New Issue
Block a user