mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
v2.0.0-preview.1
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
* (2021.01.19) Release `v2.0.0-preview.1` version
|
||||||
* (2021.01.02) Release `v1.6.3` 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
|
* (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.12.01) fixed an issue where a newly created chart on `Unity2020` could not be drawn properly
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
* (2021.01.19) 发布`v2.0.0-preview.1`版本
|
||||||
* (2021.01.02) 发布`v1.6.3`版本
|
* (2021.01.02) 发布`v1.6.3`版本
|
||||||
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题
|
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题
|
||||||
* (2020.12.01) 修复`Unity2020`上新创建的图表无法正常绘制的问题
|
* (2020.12.01) 修复`Unity2020`上新创建的图表无法正常绘制的问题
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ namespace XCharts
|
|||||||
[CustomEditor(typeof(BaseChart), false)]
|
[CustomEditor(typeof(BaseChart), false)]
|
||||||
public class BaseChartEditor : Editor
|
public class BaseChartEditor : Editor
|
||||||
{
|
{
|
||||||
|
private const float k_IconWidth = 14;
|
||||||
|
private const float k_IconGap = 0f;
|
||||||
|
private const float k_IconXOffset = 10f;
|
||||||
|
private const float k_IconYOffset = -5f;
|
||||||
|
|
||||||
protected BaseChart m_Chart;
|
protected BaseChart m_Chart;
|
||||||
protected SerializedProperty m_Script;
|
protected SerializedProperty m_Script;
|
||||||
protected SerializedProperty m_MultiComponentMode;
|
protected SerializedProperty m_MultiComponentMode;
|
||||||
@@ -191,32 +196,32 @@ namespace XCharts
|
|||||||
prop.arraySize = EditorGUILayout.IntField("Size", prop.arraySize);
|
prop.arraySize = EditorGUILayout.IntField("Size", prop.arraySize);
|
||||||
for (int i = 0; i < prop.arraySize; i++)
|
for (int i = 0; i < prop.arraySize; i++)
|
||||||
{
|
{
|
||||||
SerializedProperty element = prop.GetArrayElementAtIndex(i);
|
EditorGUILayout.PropertyField(prop.GetArrayElementAtIndex(i), true);
|
||||||
|
EditorGUILayout.Space(-EditorGUIUtility.singleLineHeight - EditorGUIUtility.standardVerticalSpacing);
|
||||||
var currRect = EditorGUILayout.GetControlRect();
|
var currRect = EditorGUILayout.GetControlRect();
|
||||||
var iconWidth = 14;
|
|
||||||
var iconGap = 0f;
|
var rect1 = new Rect(currRect.width + k_IconXOffset,
|
||||||
var xDiff = 10f;
|
currRect.y + k_IconYOffset,
|
||||||
var yDiff = 3f;
|
k_IconWidth, EditorGUIUtility.singleLineHeight);
|
||||||
var rect1 = new Rect(currRect.width + xDiff, currRect.y + yDiff,
|
|
||||||
iconWidth, EditorGUIUtility.singleLineHeight);
|
|
||||||
if (GUI.Button(rect1, ChartEditorHelper.Styles.iconRemove, ChartEditorHelper.Styles.invisibleButton))
|
if (GUI.Button(rect1, ChartEditorHelper.Styles.iconRemove, ChartEditorHelper.Styles.invisibleButton))
|
||||||
{
|
{
|
||||||
if (i < prop.arraySize && i >= 0) prop.DeleteArrayElementAtIndex(i);
|
if (i < prop.arraySize && i >= 0) prop.DeleteArrayElementAtIndex(i);
|
||||||
}
|
}
|
||||||
var rect2 = new Rect(currRect.width + xDiff - iconWidth - iconGap, currRect.y + yDiff,
|
var rect2 = new Rect(currRect.width + k_IconXOffset - k_IconWidth - k_IconGap,
|
||||||
iconWidth, EditorGUIUtility.singleLineHeight);
|
currRect.y + k_IconYOffset,
|
||||||
|
k_IconWidth, EditorGUIUtility.singleLineHeight);
|
||||||
if (GUI.Button(rect2, ChartEditorHelper.Styles.iconDown, ChartEditorHelper.Styles.invisibleButton))
|
if (GUI.Button(rect2, ChartEditorHelper.Styles.iconDown, ChartEditorHelper.Styles.invisibleButton))
|
||||||
{
|
{
|
||||||
if (i < prop.arraySize - 1) prop.MoveArrayElement(i, i + 1);
|
if (i < prop.arraySize - 1) prop.MoveArrayElement(i, i + 1);
|
||||||
}
|
}
|
||||||
var rect3 = new Rect(currRect.width + xDiff - 2 * (iconWidth + iconGap), currRect.y + yDiff,
|
var rect3 = new Rect(currRect.width + k_IconXOffset - 2 * (k_IconWidth + k_IconGap),
|
||||||
iconWidth, EditorGUIUtility.singleLineHeight);
|
currRect.y + k_IconYOffset,
|
||||||
|
k_IconWidth, EditorGUIUtility.singleLineHeight);
|
||||||
if (GUI.Button(rect3, ChartEditorHelper.Styles.iconUp, ChartEditorHelper.Styles.invisibleButton))
|
if (GUI.Button(rect3, ChartEditorHelper.Styles.iconUp, ChartEditorHelper.Styles.invisibleButton))
|
||||||
{
|
{
|
||||||
if (i > 0) prop.MoveArrayElement(i, i - 1);
|
if (i > 0) prop.MoveArrayElement(i, i - 1);
|
||||||
}
|
}
|
||||||
EditorGUILayout.Space(-EditorGUIUtility.singleLineHeight - EditorGUIUtility.standardVerticalSpacing);
|
|
||||||
EditorGUILayout.PropertyField(element, true);
|
|
||||||
}
|
}
|
||||||
EditorGUI.indentLevel--;
|
EditorGUI.indentLevel--;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,11 @@ The following is the relationship structure of LineChart:
|
|||||||
|
|
||||||
* See more examples of code dynamic control: [Tutorial - Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md).
|
* See more examples of code dynamic control: [Tutorial - Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md).
|
||||||
|
|
||||||
|
* Enable TextMeshPro:
|
||||||
|
1. `XCharts -> TextMeshPro Enable` or `Project Setting -> XCharts -> Enable TextMeshPro`
|
||||||
|
2. `Project Setting -> XCharts -> Settings -> TMP Font` set the TextMeshPro font.
|
||||||
|
3. If the chart does not initialize properly, you can use the `Remove All Chart Object` button to clean up the chart and reinitialize it.
|
||||||
|
|
||||||
## Documents
|
## Documents
|
||||||
|
|
||||||
* [XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
|
* [XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace XCharts
|
namespace XCharts
|
||||||
{
|
{
|
||||||
public partial class PolarChart
|
public partial class BaseChart
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 极坐标。
|
/// 极坐标。
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ namespace XCharts
|
|||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
public class XChartsMgr : MonoBehaviour
|
public class XChartsMgr : MonoBehaviour
|
||||||
{
|
{
|
||||||
internal static string _version = "2.0.0";
|
internal static string _version = "2.0.0-preview.1";
|
||||||
internal static int _versionDate = 20210117;
|
internal static int _versionDate = 20210119;
|
||||||
public static string version { get { return _version; } }
|
public static string version { get { return _version; } }
|
||||||
public static int versionDate { get { return _versionDate; } }
|
public static int versionDate { get { return _versionDate; } }
|
||||||
public static string fullVersion { get { return version + "_" + versionDate; } }
|
public static string fullVersion { get { return version + "-" + versionDate; } }
|
||||||
|
|
||||||
[SerializeField] private string m_NowVersion;
|
[SerializeField] private string m_NowVersion;
|
||||||
[SerializeField] private string m_NewVersion;
|
[SerializeField] private string m_NewVersion;
|
||||||
@@ -173,7 +173,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
isNetworkError = false;
|
isNetworkError = false;
|
||||||
var cv = JsonUtility.FromJson<XChartsVersion>(web.downloadHandler.text);
|
var cv = JsonUtility.FromJson<XChartsVersion>(web.downloadHandler.text);
|
||||||
m_NewVersion = cv.version + "_" + cv.date;
|
m_NewVersion = cv.version + "-" + cv.date;
|
||||||
newDate = cv.date;
|
newDate = cv.date;
|
||||||
newCheckDate = cv.checkdate;
|
newCheckDate = cv.checkdate;
|
||||||
desc = cv.desc;
|
desc = cv.desc;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "com.monitor1394.xcharts",
|
"name": "com.monitor1394.xcharts",
|
||||||
"displayName": "XCharts",
|
"displayName": "XCharts",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0-preview.1",
|
||||||
"date": "20210117",
|
"date": "20210119",
|
||||||
"checkdate": "20210117",
|
"checkdate": "20210119",
|
||||||
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
|
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"description": "A charting and data visualization library for Unity.",
|
"description": "A charting and data visualization library for Unity.",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0-preview.1",
|
||||||
"date": "20210117",
|
"date": "20210119",
|
||||||
"checkdate": "20210117",
|
"checkdate": "20210119",
|
||||||
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
|
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
|
||||||
"homepage": "https://github.com/monitor1394/unity-ugui-XCharts"
|
"homepage": "https://github.com/monitor1394/unity-ugui-XCharts"
|
||||||
}
|
}
|
||||||
BIN
Doc/screenshot/op_textmeshpro.png
Normal file
BIN
Doc/screenshot/op_textmeshpro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 308 KiB |
BIN
Doc/screenshot/op_textmeshpro2.png
Normal file
BIN
Doc/screenshot/op_textmeshpro2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
BIN
Doc/screenshot/op_textmeshpro3.png
Normal file
BIN
Doc/screenshot/op_textmeshpro3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
@@ -120,6 +120,15 @@ for (int i = 0; i < 10; i++)
|
|||||||
|
|
||||||
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XChartsAPI.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
|
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XChartsAPI.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
|
||||||
|
|
||||||
|
## 使用TextMeshPro
|
||||||
|
|
||||||
|
XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换。可通过一下两种方式开启和关闭:
|
||||||
|

|
||||||
|

|
||||||
|
开启后需要设置好TextMeshPro要用的全局字体,也可以在主题Theme里单独设置:
|
||||||
|

|
||||||
|
建议在项目初就规划好是否使用TextMeshPro,在有很多图表的情况下再切换,可能导致某些图表无法正常初始化,这时可能需要每个图表单独的使用`Remove All Chart Object`来清理让图表重新初始化。
|
||||||
|
|
||||||
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
|
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
|
||||||
[XCharts问答](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)
|
[XCharts问答](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)
|
||||||
[XChartsAPI接口](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XChartsAPI.md)
|
[XChartsAPI接口](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XChartsAPI.md)
|
||||||
|
|||||||
Reference in New Issue
Block a user