mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
3.10.0
This commit is contained in:
@@ -779,7 +779,7 @@ Bar chart shows different data through the height of a bar, which is used in rec
|
||||
|HasChartComponent<T>()||public bool HasChartComponent<T>()|
|
||||
|HasSerie()||public bool HasSerie(Type type)|
|
||||
|HasSerie<T>()||public bool HasSerie<T>() where T : Serie|
|
||||
|Init()||public void Init(bool defaultChart = true) { }|
|
||||
|Init()||public void Init(bool defaultChart = true)|
|
||||
|InitAxisRuntimeData()||public virtual void InitAxisRuntimeData(Axis axis) { }|
|
||||
|InsertSerie()||public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)|
|
||||
|InsertSerie<T>()||public T InsertSerie<T>(int index, string serieName = null, bool show = true) where T : Serie|
|
||||
|
||||
@@ -779,7 +779,7 @@ slug: /api
|
||||
|HasChartComponent<T>()||public bool HasChartComponent<T>()|
|
||||
|HasSerie()||public bool HasSerie(Type type)|
|
||||
|HasSerie<T>()||public bool HasSerie<T>() where T : Serie|
|
||||
|Init()||public void Init(bool defaultChart = true) { }|
|
||||
|Init()||public void Init(bool defaultChart = true)|
|
||||
|InitAxisRuntimeData()||public virtual void InitAxisRuntimeData(Axis axis) { }|
|
||||
|InsertSerie()||public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)|
|
||||
|InsertSerie<T>()||public T InsertSerie<T>(int index, string serieName = null, bool show = true) where T : Serie|
|
||||
|
||||
@@ -72,7 +72,6 @@ slug: /changelog
|
||||
|
||||
* (2024.01.18) 修复`Animation`的`type`代码动态修改无效的问题
|
||||
* (2024.01.13) 增加`Chart`的更多快捷创建图表菜单
|
||||
* (2024.01.12) 屏蔽`Chart`的`Init()`接口,动态创建图表不再需要调用
|
||||
* (2024.01.09) 增加`Background`的`borderStyle`,给图表默认设置圆角
|
||||
* (2024.01.07) 修复`Tooltop`的第一个`ContentLabelStyle`设置`color`无效的问题
|
||||
* (2024.01.01) 增加`BorderStyle`边框样式
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<BarChart>();
|
||||
chart.Init();
|
||||
}
|
||||
var serie = chart.GetSerie(0);
|
||||
serie.animation.enable = true;
|
||||
|
||||
@@ -40,7 +40,10 @@ namespace XCharts.Example
|
||||
IEnumerator AddSimpleLine()
|
||||
{
|
||||
chart = gameObject.GetComponent<LineChart>();
|
||||
if (chart == null) chart = gameObject.AddComponent<LineChart>();
|
||||
if (chart == null){
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.Init();
|
||||
}
|
||||
chart.GetChartComponent<Title>().text = "LineChart - 折线图";
|
||||
chart.GetChartComponent<Title>().subText = "普通折线图";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.Init();
|
||||
}
|
||||
chart.EnsureChartComponent<Title>().show = true;
|
||||
chart.EnsureChartComponent<Title>().text = "Sin Curve";
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.SetSize(580, 300);
|
||||
chart.Init();
|
||||
}
|
||||
chart.EnsureChartComponent<Title>().show = true;
|
||||
chart.EnsureChartComponent<Title>().text = "Line Simple";
|
||||
|
||||
@@ -38,7 +38,11 @@ namespace XCharts.Example
|
||||
IEnumerator AddSimpleBar()
|
||||
{
|
||||
chart = gameObject.GetComponent<BarChart>();
|
||||
if (chart == null) chart = gameObject.AddComponent<BarChart>();
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<BarChart>();
|
||||
chart.Init();
|
||||
}
|
||||
chart.EnsureChartComponent<Title>().text = "BarChart - 柱状图";
|
||||
chart.EnsureChartComponent<Title>().subText = "普通柱状图";
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@ namespace XCharts.Example
|
||||
IEnumerator PieAdd()
|
||||
{
|
||||
chart = gameObject.GetComponent<PieChart>();
|
||||
if (chart == null) chart = gameObject.AddComponent<PieChart>();
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<PieChart>();
|
||||
chart.Init();
|
||||
}
|
||||
yield return null;
|
||||
chart.GetChartComponent<Title>().text = "PieChart - 饼图";
|
||||
chart.GetChartComponent<Title>().subText = "基础饼图";
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<PieChart>();
|
||||
chart.Init();
|
||||
}
|
||||
var serieIndex = 0;
|
||||
var serie = chart.GetSerie(serieIndex);
|
||||
|
||||
@@ -40,7 +40,11 @@ namespace XCharts.Example
|
||||
IEnumerator RadarAdd()
|
||||
{
|
||||
chart = gameObject.GetComponent<RadarChart>();
|
||||
if (chart == null) chart = gameObject.AddComponent<RadarChart>();
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<RadarChart>();
|
||||
chart.Init();
|
||||
}
|
||||
|
||||
chart.RemoveChartComponents<RadarCoord>();
|
||||
chart.RemoveData();
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<RadarChart>();
|
||||
chart.Init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<HeatmapChart>();
|
||||
chart.Init();
|
||||
}
|
||||
chart.GetChartComponent<Title>().text = "HeatmapChart";
|
||||
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.None;
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<BaseChart>();
|
||||
chart.Init();
|
||||
}
|
||||
chart.EnsureChartComponent<PolarCoord>();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace XCharts.Example
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<CandlestickChart>();
|
||||
chart.Init();
|
||||
}
|
||||
AddData();
|
||||
}
|
||||
|
||||
@@ -166,8 +166,18 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public Action<Legend, int, string> onLegendExit { set { m_OnLegendExit = value; } internal get { return m_OnLegendExit; } }
|
||||
|
||||
[Obsolete("No need to call Init() anymore.", true)]
|
||||
public void Init(bool defaultChart = true) { }
|
||||
public void Init(bool defaultChart = true)
|
||||
{
|
||||
if (defaultChart)
|
||||
{
|
||||
OnInit();
|
||||
DefaultChart();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnBeforeSerialize();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redraw chart in next frame.
|
||||
|
||||
@@ -136,7 +136,6 @@ namespace XCharts.Runtime
|
||||
m_Settings = Settings.DefaultSettings;
|
||||
CheckTheme(true);
|
||||
base.Awake();
|
||||
CheckChartInit();
|
||||
InitComponentHandlers();
|
||||
InitSerieHandlers();
|
||||
AnimationReset();
|
||||
|
||||
Reference in New Issue
Block a user