Compare commits

...

5 Commits

Author SHA1 Message Date
monitor1394
77f17c7dec 发布v1.6.3版本 2021-01-02 14:08:43 +08:00
monitor1394
e8737ec50e 修复Animation不启用时更新数据会导致图表一直刷新的问题 2020-12-18 19:06:34 +08:00
monitor1394
045e1576b6 XCharts 2.0 is comming soon! 2020-12-12 13:14:29 +08:00
monitor1394
b1c9f36a30 去掉调试日志 2020-12-01 12:18:52 +08:00
monitor1394
1b4e3a449d 修复Unity2020上新创建的图表无法正常绘制的问题 2020-12-01 09:29:11 +08:00
11 changed files with 51 additions and 21 deletions

View File

@@ -1,6 +1,9 @@
# 更新日志
* (2021.01.02) Release `v1.6.3` version
* (2020.12.18) fixed an issue where updating data when `Animation` was not enabled caused the chart to keep refreshing
* (2020.12.01) fixed an issue where a newly created chart on `Unity2020` could not be drawn properly
* (2020.11.22) Release `v1.6.2` version
* (2020.11.22) Fixed an issue where `LineChart` draws an exception when the data is too dense #99
* (2020.11.21) Fixed an issue where the scale position of `LineChart` could be abnormal if `alignWithLabel` was `true`

View File

@@ -1,6 +1,9 @@
# 更新日志
* (2021.01.02) 发布`v1.6.3`版本
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题
* (2020.12.01) 修复`Unity2020`上新创建的图表无法正常绘制的问题
* (2020.11.22) 发布`v1.6.2`版本
* (2020.11.22) 修复`LineChart`在数据过于密集时折线绘制异常的问题 #99
* (2020.11.21) 修复`LineChart`的刻度位置在`alignWithLabel``true`时可能异常的问题

View File

@@ -5,6 +5,18 @@
[![downloads per month](http://img.shields.io/npm/dm/unity-ugui-xcharts.svg)](https://www.npmjs.org/package/unity-ugui-xcharts)
![qq](https://img.shields.io/badge/QQ群-202030963-green)
---
__XCharts 2.0 is comming soon!__
* Framework reconstruction, layered rendering, support more data
* Support TextMeshPro
* Support multi-chart, multi-component mode
* A friendlier editing interface
* More …
---
A powerful, easy-to-use, configurable charting and data visualization library for Unity. Supporting line, bar, pie, radar, scatter, heatmap, gauge, ring, polar, liquid and other common chart.
[XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)

View File

@@ -24,11 +24,7 @@ namespace XCharts
var serie = m_Series.GetSerie(serieIndex);
if (serie != null)
{
var serieData = serie.GetSerieData(dataIndex);
if (serieData != null)
{
return serieData.UpdateData(1, value, serie.animation.GetUpdateAnimationDuration());
}
return serie.UpdateData(dataIndex, 1, value);
}
return false;
}
@@ -45,10 +41,9 @@ namespace XCharts
if (serie != null)
{
var flag = true;
foreach (var serieData in serie.data)
for (int i = 0; i < serie.dataCount; i++)
{
if (!serieData.UpdateData(1, value, serie.animation.GetUpdateAnimationDuration()))
flag = false;
if (serie.UpdateData(i, 1, value)) flag = false;
}
return flag;
}

View File

@@ -1095,7 +1095,7 @@ namespace XCharts
{
if (sdata.show)
total += sdata.GetCurrData(1, animation.GetUpdateAnimationDuration());
//total += sdata.GetData(1);
//total += sdata.GetData(1);
}
return total;
}
@@ -1504,7 +1504,9 @@ namespace XCharts
{
if (index >= 0 && index < m_Data.Count)
{
var flag = m_Data[index].UpdateData(dimension, value, animation.GetUpdateAnimationDuration());
var animationOpen = animation.enable;
var animationDuration = animation.GetUpdateAnimationDuration();
var flag = m_Data[index].UpdateData(dimension, value, animationOpen, animationDuration);
if (flag) SetVerticesDirty();
return flag;
}
@@ -1524,8 +1526,10 @@ namespace XCharts
if (index >= 0 && index < m_Data.Count && values != null)
{
var serieData = m_Data[index];
var animationOpen = animation.enable;
var animationDuration = animation.GetUpdateAnimationDuration();
for (int i = 0; i < values.Count; i++)
serieData.UpdateData(i, values[i], animation.GetUpdateAnimationDuration());
serieData.UpdateData(i, values[i], animationOpen, animationDuration);
SetVerticesDirty();
return true;
}

View File

@@ -280,7 +280,7 @@ namespace XCharts
}
}
public bool UpdateData(int dimension, float value, float animationDuration = 500f)
public bool UpdateData(int dimension, float value, bool updateAnimation, float animationDuration = 500f)
{
if (dimension >= 0 && dimension < data.Count)
{
@@ -288,7 +288,7 @@ namespace XCharts
m_PreviousData[dimension] = GetCurrData(dimension, animationDuration);
//m_PreviousData[dimension] = data[dimension];;
m_DataUpdateTime[dimension] = Time.time;
m_DataUpdateFlag[dimension] = true;
m_DataUpdateFlag[dimension] = updateAnimation;
data[dimension] = value;
return true;
}

View File

@@ -12,6 +12,7 @@ using UnityEngine.EventSystems;
namespace XCharts
{
[RequireComponent(typeof(CanvasRenderer))]
public partial class BaseGraph : MaskableGraphic, IPointerDownHandler, IPointerUpHandler,
IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IPointerClickHandler,
IDragHandler, IEndDragHandler, IScrollHandler

View File

@@ -29,8 +29,8 @@ namespace XCharts
[ExecuteInEditMode]
public class XChartsMgr : MonoBehaviour
{
public const string version = "1.6.2";
public const int date = 20201122;
public const string version = "1.6.3";
public const int date = 20210102;
[SerializeField] private string m_NowVersion;
[SerializeField] private string m_NewVersion;

View File

@@ -1,9 +1,9 @@
{
"name": "com.monitor1394.xcharts",
"displayName": "XCharts",
"version": "1.6.2",
"date": "20201122",
"checkdate": "20201122",
"version": "1.6.3",
"date": "20210102",
"checkdate": "20210102",
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
"unity": "2018.3",
"description": "A charting and data visualization library for Unity.",

View File

@@ -1,7 +1,7 @@
{
"version": "1.6.2",
"date": "20201122",
"checkdate": "20201122",
"version": "1.6.3",
"date": "20210102",
"checkdate": "20210102",
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
"homepage": "https://github.com/monitor1394/unity-ugui-XCharts"
}

View File

@@ -9,6 +9,18 @@ A powerful, easy-to-use, configurable charting and data visualization library fo
[English Documents](Assets/XCharts/README.md)
---
__号外__
XCharts 2.0 is comming soon!
* 底层重构,分层绘制,支持更多数据
* 支持TextMeshPro
* 支持一图多表,多组件模式
* 更友好的编辑界面
* ...
---
一款基于`UGUI`的功能强大、易用、参数可配置的数据可视化图表插件。支持折线图、柱状图、饼图、雷达图、散点图、热力图、仪表盘、环形图、极坐标、水位图等常见图表。
[XCharts问答](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)