---恢复内容开始---
以“3D BarChart”为例。
1.Select a theme.(选择一个主题模板)
2.Set up categories and groups.(设置类型和组)
3.You can set values from the inspector.(你可以从检查面板中设置值)
4.Creat a new script.(创建一个新脚本)
Note:(1)Names should be as defined in the editor (名字应该在编辑器中被定义过)
(2)Set the value of a bar using the category name and group that are defined in the inspector.(使用检查器中定义的类别名称和组设置栏的值)
5.Creat an object with the sample script! (建立空物体挂在脚本)
6.Experiment with setting view size in the editor.
7.Experiment with values customization.
8.在Categories中设置Bar的样式。
9.Bar Clickded
using System.Collections;
using System.Collections.Generic;
using ChartAndGraph;
using UnityEngine; public class MyBarSample : MonoBehaviour
{
public BarChart chart;
// Start is called before the first frame update
void Start()
{ chart.DataSource.SetValue("koko","one",);
chart.DataSource.SlideValue("koko","one",,3f);
chart.DataSource.SlideValue("juhnko","one",,5f);
}
//lets handle a bar click event
public void OnBarClick(BarChart.BarEventArgs args)
{
Debug.Log("点击的类型是:"+args.Category+"所在的组是:"+args.Group+"值为:"+args.Value);
} }
Hover can be handled the same way.