增加XChartsSettingseditorShowAllListData参数配置是否在Inspector中显示列表的所有数据

This commit is contained in:
monitor1394
2021-01-19 23:18:41 +08:00
parent 0a5d923592
commit f8d882c046
6 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2021.01.19) Add `XChartsSettings` `editorShowAllListData` parameter to configure whether to display all the list's data in Inspector
* (2021.01.19) Release `v2.0.0-preview.1` version
* (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

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2021.01.19) 增加`XChartsSettings``editorShowAllListData`参数配置是否在`Inspector`中显示列表的所有数据
* (2021.01.19) 发布`v2.0.0-preview.1`版本
* (2021.01.02) 发布`v1.6.3`版本
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题

View File

@@ -427,7 +427,7 @@ namespace XCharts
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
}
if (listSize > 30)
if (listSize > 30 && !XChartsSettings.editorShowAllListData)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)

View File

@@ -328,7 +328,7 @@ public class ChartEditorHelper
while (listSize < listProp.arraySize) listProp.arraySize--;
}
}
if (listSize > 30)
if (listSize > 30 && !XChartsSettings.editorShowAllListData)
{
SerializedProperty element;
int num = listSize > 10 ? 10 : listSize;
@@ -360,8 +360,8 @@ public class ChartEditorHelper
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
var isSerie = "Serie".Equals(element.type);
var elementRect = isSerie
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH, drawRect.height)
var elementRect = isSerie
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH, drawRect.height)
: new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
var iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);

View File

@@ -17,7 +17,7 @@ namespace XCharts
[ExcludeFromPresetAttribute]
public class XChartsSettings : ScriptableObject
{
[SerializeField] private Font m_Font;
#if dUI_TextMeshPro
[SerializeField] private TMP_FontAsset m_TMPFont;
@@ -49,6 +49,7 @@ namespace XCharts
[SerializeField] [Range(0, 200)] private float m_SerieScatterSymbolSelectedSize = 30f;
[SerializeField] private bool m_EditorBlockEnable = true;
[SerializeField] private bool m_EditorShowAllListData = false;
[SerializeField] [Range(1, 20)] protected int m_MaxPainter = 10;
[SerializeField] [Range(1, 10)] protected float m_LineSmoothStyle = 3f;
@@ -97,6 +98,7 @@ namespace XCharts
#region editor
public static bool editorBlockEnable { get { return Instance.m_EditorBlockEnable; } }
public static bool editorShowAllListData { get { return Instance.m_EditorShowAllListData; } }
#endregion
#region graphic

View File

@@ -1,8 +1,10 @@
# XCharts
![license](https://img.shields.io/github/license/monitor1394/unity-ugui-XCharts)
[![npm Package](https://img.shields.io/npm/v/unity-ugui-xcharts.svg)](https://www.npmjs.org/package/unity-ugui-xcharts)
[![downloads per month](http://img.shields.io/npm/dm/unity-ugui-xcharts.svg)](https://www.npmjs.org/package/unity-ugui-xcharts)
![github release](https://img.shields.io/github/v/release/monitor1394/unity-ugui-XCharts?include_prereleases)
![github download](https://img.shields.io/github/downloads/monitor1394/unity-ugui-XCharts/total?label=github%20download)
[![npm downloads](https://img.shields.io/npm/dt/unity-ugui-xcharts?label=npm%20downloads%20)](https://www.npmjs.org/package/unity-ugui-xcharts)
[![npm downloads](https://img.shields.io/npm/dm/unity-ugui-xcharts?label=%20)](https://www.npmjs.org/package/unity-ugui-xcharts)
![qq](https://img.shields.io/badge/QQ群-202030963-green)
A powerful, easy-to-use, configurable charting and data visualization library for Unity.