mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 07:20:08 +00:00
更新教程
This commit is contained in:
@@ -19,6 +19,7 @@ namespace XCharts.Examples
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.SetSize(580, 300);//代码动态添加图表需要设置尺寸,或直接操作chart.rectTransform
|
||||
}
|
||||
chart.title.show = true;
|
||||
chart.title.text = "Line Simple";
|
||||
|
||||
@@ -49,13 +49,14 @@
|
||||
|
||||
## 用代码添加折线图
|
||||
|
||||
给`gameObject`挂上`LineChart`脚本:
|
||||
给`gameObject`挂上`LineChart`脚本,需要调用`SetSize()`接口设置图表尺寸,或者直接操作`chart.rectTransfrom`:
|
||||
|
||||
```C#
|
||||
var chart = gameObject.GetComponent<LineChart>();
|
||||
if (chart == null)
|
||||
{
|
||||
chart = gameObject.AddComponent<LineChart>();
|
||||
chart.SetSize(580, 300);//代码动态添加图表需要设置尺寸,或直接操作chart.rectTransform
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user