Graph and Chart Study
1.选择主题 “Themes”,以"Graph"——“preset7” 为例;
2.选择“Canvas”——“GraphChart”预制体,1.Set data categories 即“设置数据类型”,each category has it's own visual settings 每个类别都有自己的视觉设置,Line Thickness等‘
3.Now lets feed the chart with data _现在让我们用数据填充图表; Use category names from the inspector(使用检查器中的类别名称)
4.Drag the chart in to the script property(将图表拖到script属性中)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ChartAndGraph; public class MyGraphSample : MonoBehaviour
{
public GraphChart chart; private float Timer = 1f; private float X = 10f;
// Start is called before the first frame update
void Start()
{
//It is also best practice to enclose graph changes in StartBatch and EndBatch calls chart.DataSource.StartBatch(); //It is best practice to clear a category before filing it with new data
chart.DataSource.ClearCategory("KOKO");
chart.DataSource.AddPointToCategory("KOKO",,);
chart.DataSource.AddPointToCategory("KOKO", , );
chart.DataSource.AddPointToCategory("KOKO",,);
chart.DataSource.AddPointToCategory("KOKO", , ); ////now we do the same for the second category
//chart.DataSource.ClearCategory("Juhnko");
//chart.DataSource.AddPointToCategory("KOKO", 0, 0);
//chart.DataSource.AddPointToCategory("KOKO", 5, 5);
//chart.DataSource.AddPointToCategory("KOKO", 8, 7);
//chart.DataSource.AddPointToCategory("KOKO", 15, 10); //now we do the same for the three category
chart.DataSource.ClearCategory("liang");
chart.DataSource.AddPointToCategory("liang", , );
chart.DataSource.AddPointToCategory("liang", , );
chart.DataSource.AddPointToCategory("liang", , );
chart.DataSource.AddPointToCategory("liang", , ); //each startBatch call must be matched with an EndBath call !!!
chart.DataSource.EndBatch(); //graph is redrawn after EndBath is called
}
//lets handle a click event
public void OnItemClick(GraphChartBase.GraphEventArgs args)
{
Debug.Log("点击的类型是:"+args.Category+" 索引点为:"+args.Index);
} // Update is called once per frame
void Update()
{
//now let's add a streaming data update the goes every 1 second.
Timer -= Time.deltaTime;
if (Timer<=0f)
{
Timer = 1f;
chart.DataSource.AddPointToCategory("KOKO",X, Random.value);
chart.DataSource.AddPointToCategory("liang", X, Random.value);
X++;
}
}
}
Graph and Chart Study的更多相关文章
- How To Build Compelling Stories From Your Data Sets
How To Build Compelling Stories From Your Data Sets Every number has a story. As a data scientist, y ...
- github上所有大于800 star OC框架
https://github.com/XCGit/awesome-objc-frameworks#awesome-objc-frameworks awesome-objc-frameworks ID ...
- Jmeter_初步认识随笔
1. 简介 Apache JMeter是100%纯java桌面应用程序,被设计用来测试客户端/服务器结构的软件(例如web应用程序).它可以用来测试包括基于静态和动态资源程序的性能,例如静态文件,Ja ...
- amchart
amchart能够根据提供的数据便捷的生成好看的图标,曾在项目中遇到使用falsh版以支持对js支持不好的低版本浏览器,但是现在官网上都是js版本的,flash版的文档都没有,搜索结果一般都是链接到博 ...
- extjs+amcharts生成3D柱状图和数据表格使用总结
废话不多说,使用extjs+amcharts创建3d柱状图和数据表实例,如下: 1.首先定义一个数据模型 Ext.define("cacheHijack", { extend : ...
- IAB303 Data Analytics Assessment Task
Assessment TaskIAB303 Data Analyticsfor Business InsightSemester I 2019Assessment 2 – Data Analytics ...
- vba编程基础2
安装office2010的时候, 最好是 完全安装/完整安装 , 这样可以查阅 excel的 "帮助文档" 帮助文档中包含了更多的/更详细的 参考信息. 普通模块无事件, 只有 子 ...
- 创建XML的用法
注意:在实际开发中,注意createElement().createAttribute().createTextNode().appendchild()等方法的具体使用. // root根节点的属性数 ...
- FusionCharts之我用
fusioncharts:(此控件需flash支持) 介绍:http://baike.baidu.com/link?url=SOheR7sQlb93S5TqYmeI7FhtJ0V9ABNwH6OsAa ...
随机推荐
- vue 辅助开发工具(利用node自动生成相关文件,自动注册路由)
vue 辅助开发工具 前言 有没有因为新建view,component,store的繁琐操作而苦恼,需要新建文件件,新建vue文件,新建js文件,注册路由...等一系列无价值操作浪费时间,为了解决这个 ...
- python练习题-1
1.输出正方形 x=input("请输入:") x=int(x) for i in range(0,x): if (i==0) or (i==x-1): print("* ...
- 通俗易懂--循环神经网络(RNN)的网络结构!(TensorFlow实现)
1. 什么是RNN 循环神经网络(Recurrent Neural Network, RNN)是一类以序列(sequence)数据为输入,在序列的演进方向进行递归(recursion)且所有节点(循环 ...
- 一段代码分清global和nonlocal
废话不多说,直接代码啊~~~ a=999 b=99999 def test1(): a=888 b=88888 print('a={}'.format(a)) print('b={}'.format( ...
- MTFlexbox自动化埋点探索
1. 背景 跨平台动态化技术是目前移动互联网领域的重点关注方向,它既能节约人力,又能实现业务快速上线的需求.经过十年的发展,美团App已经变成了一个承载众多业务的超级平台,众多的业务方对业务形态的快速 ...
- Nginx 502 Bad Gateway 错误的解决方法
502 bad gateway 的解决方法 通用配置 proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 proxy_buffers 4 32k; # ...
- 使用 media 实现响应式布局
最近工作有一个需求是将一个界面改为响应式布局,由于UI还没有给设计,于是自己先查了一下资料做了一个demo.其实实现响应式布局的方式有很多,利用media实现就是其中一种,但是他也有一些缺点,比如说要 ...
- [Spring cloud 一步步实现广告系统] 2. 配置&Eureka服务
父项目管理 首先,我们在创建投放系统之前,先看一下我们的工程结构: mscx-ad-sponsor就是我们的广告投放系统.如上结构,我们需要首先创建一个Parent Project mscx-ad 来 ...
- Python模块之snmp-cmds,easysnmp
一.简介 snmp-cmds模块通过SNMP与目标设备进行通信,此模块适用于windows,此模块是基于系统已安装了net-snmp环境easysnmp模块通过SNMP与谬表设备进行通信,此模块用于l ...
- lombok 下的@Builder注解用法
pom依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId& ...