diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index afd8e400..0657a686 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -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 diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 78c44187..221ead9d 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -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`不启用时更新数据会导致图表一直刷新的问题 diff --git a/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs b/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs index 685dd74d..00120f52 100644 --- a/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs +++ b/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs @@ -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++) diff --git a/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs b/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs index 9267929a..e6854813 100644 --- a/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs +++ b/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs @@ -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); diff --git a/Assets/XCharts/Runtime/XChartsSettings.cs b/Assets/XCharts/Runtime/XChartsSettings.cs index 87b7d3cd..d7e3a511 100644 --- a/Assets/XCharts/Runtime/XChartsSettings.cs +++ b/Assets/XCharts/Runtime/XChartsSettings.cs @@ -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 diff --git a/README.md b/README.md index b85db0b0..dddec213 100644 --- a/README.md +++ b/README.md @@ -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.