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 ...
随机推荐
- 洛谷 P3628 特别行动队
洛谷题目页面传送门 题意见洛谷. 这题一看就是DP... 设\(dp_i\)表示前\(i\)个士兵的最大战斗力.显然,最终答案为\(dp_n\),DP边界为\(dp_0=0\),状态转移方程为\(dp ...
- Flink 源码解析 —— Standalone session 模式启动流程
Standalone session 模式启动流程 https://t.zsxq.com/EemAEIi 博客 1.Flink 从0到1学习 -- Apache Flink 介绍 2.Flink 从0 ...
- Spring参数的自解析--还在自己转换?你out了!
背景前段时间开发一个接口,因为调用我接口的同事脾气特别好,我也就不客气,我就直接把源代码发给他当接口定义了. 没想到同事看到我的代码问:要么 get a,b,c 要么 post [a,b,c]. ...
- Selenium + python 测试环境搭建扩展-HTMLUNIT的使用
尝试给公司的网站写每日例行检查的脚本时,不需要去打开浏览器,这是就用到HTMLUNIT的使用 HTMLUNIT是基于Selenium服务端的,所以需要selenium-server-standalon ...
- SSH开发模式——Struts2(第三小节)
struts2框架的知识点,虽然分了几个小节,感觉内容还是挺多的,但是你仅仅是入门了而已,想要进一步地提升自己,你得有一颗持之以恒的学习的心,最后的内容我都将在这篇博客中讲到,所以篇幅可能会有点长,希 ...
- nginx之location详解
location有定位的意思,根据uri来进行不同的定位,在虚拟主机中是必不可少的,location可以定位网站的不同部分,定位到不同的处理方式上. location匹配分类 精准匹配 一般匹配 正则 ...
- 微服务API通过ip可访问,域名不可访问问题分析
摘要 经常会有同学遇到api通过ip可以访问,但是通过域名却不可以访问.本篇文章总结了造成这种情况可能的原因. 因为与具体技术的选型.规则配置有关,所以没有深入讨论,只是列出可能性,仅供参考. 分析 ...
- JS如何重写一个函数
分享一些自己在开发上遇到的问题,比如我们页面上用了大量的打印语句,但是在某些时候,我们不想要了. 解决方案1 : 我们删除这里的代码,如果太多了,那工作量太大好累,想想都不想干 解决方案2 :我们将c ...
- Linux Capabilities 简介
为了执行权限检查,Linux 区分两类进程:特权进程(其有效用户标识为 0,也就是超级用户 root)和非特权进程(其有效用户标识为非零). 特权进程绕过所有内核权限检查,而非特权进程则根据进程凭证( ...
- 前端测试工具之 postman
1.不论你是一个前端工程师还是一个后端工程师相信这款工具都会使你的开发更加简便. 2.在此我推荐的一款软件工具是 postman . 在这里我对 postman 做一个简单的介绍: ①它能够模拟表单发 ...