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 ...
随机推荐
- kpm字符串匹配算法
首先是简单的朴素匹配算法 /* * 返回子串t在主串s的位置,若不存在则返回0 */ public static int index(String s, String t) { int i = 0;/ ...
- 从Dictionary源码看哈希表
一.基本概念 哈希:哈希是一种查找算法,在关键字和元素的存储地址之间建立一个确定的对应关系,每个关键字对应唯一的存储地址,这些存储地址构成了有限.连续的存储地址. 哈希函数:在关键字和元素的存储地址之 ...
- 记忆化搜索模板题---leetcode 1155. 掷骰子的N种方法
1155. 掷骰子的N种方法 这里有 d 个一样的骰子,每个骰子上都有 f 个面,分别标号为 1, 2, ..., f. 我们约定:掷骰子的得到总点数为各骰子面朝上的数字的总和. 如果需要掷出的总点数 ...
- 使用MTA HTML5统计API来分析数据
使用MTA HTML5统计API来分析数据 在开发个人博客的时候,用到了腾讯移动分析(MTA),相比其他数据统计平台来说我喜欢她的简洁高效,易上手,同时文档也比较全面,提供了数据接口供用户调用. 在看 ...
- linux 下 VSCODE 使用CMake编译STM32程序
项目在做什么 项目地址 本项目是为了研究MCU在linux下开发而做的 --build 存放cmake编译生成的文件 --cmake 存放cmake编译时会用到的文件,比如工具链检查.编译选项等 -- ...
- 2018年蓝桥杯b组国赛真题
1.标题:换零钞x星球的钞票的面额只有:100元,5元,2元,1元,共4种.小明去x星旅游,他手里只有2张100元的x星币,太不方便,恰好路过x星银行就去换零钱.小明有点强迫症,他坚持要求200元换出 ...
- springBoot配置activeMq点对点模式消费信息以及独占模式消费如何设置
1.在pom文件中引入对应jar包 <!--activeMQ start--> <dependency> <groupId>org.springframework. ...
- Leetcode之分治法专题-169. 求众数(Majority Element)
Leetcode之分治法专题-169. 求众数(Majority Element) 给定一个大小为 n 的数组,找到其中的众数.众数是指在数组中出现次数大于 ⌊ n/2 ⌋ 的元素. 你可以假设数组是 ...
- ZAO 换脸不安全?用 python 轻松实现 AI
最近两天一款名为 「ZAO」 的 App 刷爆了朋友圈,它的主打功能是 AI 换脸,宣称「只需一张照片,就能出演天下好戏」 : 现实中不能实现当明星的梦,在这个 App 里你可以,想演谁演谁.新鲜.好 ...
- OpenCvSharp 通过特征点匹配图片
现在的手游基本都是重复操作,一个动作要等好久,结束之后继续另一个动作.很麻烦,所以动起了自己写一个游戏辅助的心思. 这个辅助本身没什么难度,就是通过不断的截图,然后从这个截图中找出预先截好的能代表相应 ...