3.0 - unitypackage

This commit is contained in:
monitor1394
2022-01-05 21:40:48 +08:00
parent c160867765
commit 228a4b2840
846 changed files with 105 additions and 467693 deletions

22
.gitignore vendored
View File

@@ -1,28 +1,6 @@
/.vs
/.vscode
.vs
/XCharts-ios
/Library
/Temp
/Logs
/obj
/UnityPackageManager
/Packages
/ProjectSettings/XRSettings.asset
/Assets/Res
/Assets/Res.meta
/Assets/Package
/Assets/Package.meta
/Assets/TextMesh Pro
/Assets/TextMesh Pro.meta
/Assets/XChartsExtensions
/Assets/XChartsExtensions.meta
/Doc/*.meta
/Assets/XChartsDemo/demo_test.unity
/Assets/XChartsDemo/demo_test.unity.meta
/Assets/XChartsDemo/empty.unity
/Assets/XChartsDemo/empty.unity.meta
*.sln
*.csproj

View File

@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 3e77b3cfd5a4d2646964841d2b14dcb2
folderAsset: yes
timeCreated: 1536101212
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,210 +0,0 @@
<p align="center">
<a href="">
<img src="" alt="" width="" height="">
</a>
</p>
<h2 align="center">XCharts</h3>
<p align="center">
A powerful, easy-to-use, configurable charting and data visualization library for Unity.
<br>
一款基于UGUI的数据可视化图表插件。
<br>
</p>
<p align="center">
<a href="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/monitor1394/unity-ugui-XCharts">
</a>
<a href="https://github.com/monitor1394/unity-ugui-XCharts/releases">
<img src="https://img.shields.io/github/v/release/monitor1394/unity-ugui-XCharts?include_prereleases">
</a>
<a href="">
<img src="https://img.shields.io/github/languages/code-size/monitor1394/unity-ugui-xcharts">
</a>
<a href="https://www.npmjs.org/package/unity-ugui-xcharts">
<img src="https://img.shields.io/npm/dm/unity-ugui-xcharts?label=npm%20downloads%20">
</a>
<a href="">
<img src="https://img.shields.io/badge/Unity-5.6+-green">
</a>
<a href="">
<img src="https://img.shields.io/badge/TextMeshPro-YES-green">
</a>
</p>
<p align="center">
<a href="">
<img src="https://img.shields.io/github/stars/monitor1394/unity-ugui-XCharts?style=social">
</a>
<a href="">
<img src="https://img.shields.io/github/forks/monitor1394/unity-ugui-XCharts?style=social">
</a>
<a href="">
<img src="https://img.shields.io/github/issues-closed/monitor1394/unity-ugui-XCharts?color=green&label=%20%20%20%20issues&logoColor=green&style=social">
</a>
</p>
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)
[XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
[XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
[XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)
[XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG-EN.md)
[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)
## XCharts 2.0
* Underlevel reconstruction, layered rendering, optimized scalability, support more data.
* Support for multi-component patterns.
* Support for any combination of most charts.
* Support theme customization, import and export, and more theme configuration parameters.
* Support global adjustment of configuration parameters.
* Added support for `TextMeshPro`.
* Added `CandlestickChart`.
* __ Note:__ `2.0` has undergone a lot of refactoring and adjustments and is not fully compatible with version `1.0`, so `1.0` should not be directly upgraded to `2.0`. Some parameter Settings may be reset to default values after upgrading.
## Features
* Rich built-in examples and templates, parameter visualization configuration, effect real-time preview, pure code drawing.
* Support line, bar, pie, radar, scatter, heatmaps, gauge, ring, polar, liquid and other common chart.
* Support line graph, curve graph, area graph, step graph and other LineChart.
* Support parallel bar, stack bar, stack percentage bar, zebra bar and other BarChart.
* Support ring, rose and other PieChart.
* Support line-bar chart, scatter-line chart and other combination chart.
* Support solid line, curve, ladder line, dotted line, dash line, dot line, double dot line and other lines.
* Support custom theme, built-in theme switching.
* Support custom chart content drawing, drawing points, line, curve, triangle, quadrilateral, circle, ring, sector, border, arrow and other drawing API.
* Support interactive operations such as data filtering, view zooming and detail display on PC and mobile terminals.
* Support 10,000-level big data rendering.
## Screenshot
![linechart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-line.png)
![barchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-bar.png)
![piechart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-pie.png)
![radarchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-radar.png)
![scatterchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-scatter.png)
![heatmapchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-heatmap.png)
![gaugechart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-gauge.png)
![ringchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-ring.png)
![polarchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-polar.png)
![liquidchart](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-liquid.png)
![combinations](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-combinations.png)
## Cheat Sheet
![cheatsheet](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-cheatsheet.gif)
`XCharts` consist of components and data. Different components and data can be combined into different types of charts. The component is divided into main component and sub component. The main component contains the sub components.
`XCharts` main components:
* `Theme` theme component, which can configure the default colors, fonts and so on.
* `Title` title component, which contains the main title and subtitle.
* `Legend` legend component, which represent different sets of symbols, colors, and names. You can control which series are not displayed by clicking on the legend.
* `Grid` grid component, drawing grid in rectangular coordinate system. Up to two X axes and two Y axes can be placed within a grid component. You can draw line, bar and scatter chart on the grid.
* `Axis` axis component, the axis of a rectangular coordinate system. Supports the upper and lower X axes and the left and right Y axes.
* `Series` series component, a list of serie. A chart can contain many different series, and each series determines its own chart type by type.
* `Tooltip` tooltip component, feedback more details of the data indicated by the mouse at the time.
* `DataZoom` data zoom component, used for area zooming so you can focus on detailed data information, or overview the data as a whole, or remove the impact of outliers.
* `VisualMap` visual mapping component, you can map data in different colors.
* `Radar` radar component, suitable for radar chart only.
* `Settings` global Settings component, Some global parameters can be adjusted. Use the default values in general and adjust them as needed.
`XCharts` support chart:
* `LineChart`
* `BarChart`
* `PieChart`
* `RadarChart`
* `ScatterChart`
* `HeatmapChart`
* `GuageChart`
* `RingChart`
* `PolarChart`
* `LiquidChart`
The following is the relationship structure of LineChart:
``` js
.
├── LineChart
. ├── ThemeInfo
├── Title
│ └── Location
├── Legend
│ └── Location
├── Tooltip
├── DataZoom
├── VisualMap
├── Grid
├── Axis
│ ├── AxisLine
│ ├── AxisName
│ ├── AxisLabel
│ ├── AxisTick
│ └── AxisSplitArea
├── Series
│ ├── ItemStyle
│ ├── AreaStyle
│ ├── SerieSymbol
│ ├── LineStyle
│ ├── LineArrow
│ ├── SerieLabel
│ ├── Emphasis
│ ├── Animation
│ └── SerieData
└── Settings
```
## Environment
* Unity2017.4.27f1
* .Net 3.5
* macOS 10.15.4
## Usage
* This project was developed under `Unity 2017.4.27f1` and `.net 3.5`, tested normally on `Unity 5`, `Unity 2018` and `Unity 2019`. It can theoretically run on any version that supports `UGUI`.
* Download the source code or `unitypackage` to import into your project. If `Unity` version are `2018.3` or above, it is recommended to import packages through `Package Manager`:
1. Open the `manifest.json` file under `Packages` directory and add under `dependencies`:
``` json
"com.monitor1394.xcharts": "https://github.com/monitor1394/unity-ugui-XCharts.git#2.0-upm",
```
2. Going back to `Unity`, it may take 3 to 5 minutes to download.
3. If you want to delete `XCharts`, just delete the content added in step 1.
4. If you want to update `XCharts`, open `manifest.json` file , delete the content about `com.monitor1394.xcharts` under `lock`, it will download anagain. Also can check For update in `components-> XCharts -> Check For Update`.
* Add a chart in Editor quickly:
1. In `Hierarchy`, right-click menu `XChart->LineChart`.
2. In unity menu bar, `Component->XCharts->LineChart`.
3. In `Inspector`,`Add Component->LineChart`.
4. Then a simple line chart is done.
5. In `Inspector` you can adjust the parameters of components, and in `Game` will feedback the adjustment effect in realtime 。the detail of parameters go to see: [XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-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
* [XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
* [XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
* [XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
* [XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)
* [XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG-EN.md)
* [XCharts 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)
## Changelog
[XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG.md)
## Licenses
[MIT License](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/LICENSE.md)
## Contact
gmail: monitor1394@gmail.com

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 926cd5f4d8406451cb0c54e3ae6f71cd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e7c05fe198b1e46eabc5896450bf9cec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,234 +0,0 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts;
namespace XChartsDemo
{
[CustomPropertyDrawer(typeof(ChartModule), true)]
internal class ChartModuleDrawer : PropertyDrawer
{
public class Styles
{
public static readonly GUIContent iconAdd = new GUIContent("+", "Add");
public static readonly GUIContent iconRemove = new GUIContent("-", "Remove");
public static readonly GUIContent iconUp = new GUIContent("↑", "Up");
public static readonly GUIContent iconDown = new GUIContent("↓", "Down");
public static readonly GUIStyle invisibleButton = "InvisibleButton";
}
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
var lastX = drawRect.x;
var lastWid = drawRect.width;
SerializedProperty m_Column = prop.FindPropertyRelative("m_Column");
SerializedProperty m_Name = prop.FindPropertyRelative("m_Name");
SerializedProperty m_SubName = prop.FindPropertyRelative("m_SubName");
SerializedProperty m_Title = prop.FindPropertyRelative("m_Title");
SerializedProperty m_Selected = prop.FindPropertyRelative("m_Selected");
SerializedProperty m_Panel = prop.FindPropertyRelative("m_Panel");
prop.isExpanded = EditorGUI.Toggle(new Rect(pos.x - 10, pos.y, 10, 10), prop.isExpanded, EditorStyles.foldout);
var fieldWid = EditorGUIUtility.currentViewWidth - 30 - 5 - 40 - 80 - 50 - 100 - 6 * 2 - 70;
drawRect.width = 15;
EditorGUI.BeginChangeCheck();
var oldFlag = m_Selected.boolValue;
EditorGUI.PropertyField(drawRect, m_Selected, GUIContent.none);
if (EditorGUI.EndChangeCheck())
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
var selectedIndex = demo.GetSelectedModule();
if (selectedIndex != index)
{
for (int i = 0; i < demo.chartModules.Count; i++)
{
demo.chartModules[i].select = i == index && m_Selected.boolValue;
}
demo.InitModuleButton();
}
else
{
m_Selected.boolValue = oldFlag;
}
}
drawRect.x += 17;
drawRect.width = 80;
EditorGUI.PropertyField(drawRect, m_Name, GUIContent.none);
drawRect.x += 82;
drawRect.width = 50;
EditorGUI.PropertyField(drawRect, m_SubName, GUIContent.none);
drawRect.x += 52;
drawRect.width = fieldWid;
EditorGUI.PropertyField(drawRect, m_Title, GUIContent.none);
drawRect.x += fieldWid + 2;
drawRect.width = 100;
EditorGUI.PropertyField(drawRect, m_Panel, GUIContent.none);
drawRect.x += 102;
drawRect.width = 40;
EditorGUI.PropertyField(drawRect, m_Column, GUIContent.none);
var btnWidth = 12;
drawRect.x += 42;
drawRect.width = btnWidth;
if (GUI.Button(drawRect, Styles.iconUp, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
Swap(demo.chartModules, index, index - 1);
demo.InitModuleButton();
}
}
drawRect.x += btnWidth + 1;
if (GUI.Button(drawRect, Styles.iconDown, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
Swap(demo.chartModules, index, index + 1);
demo.InitModuleButton();
}
}
drawRect.x += btnWidth + 1;
if (GUI.Button(drawRect, Styles.iconAdd, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
demo.chartModules.Insert(index + 1, new ChartModule());
demo.InitModuleButton();
}
}
drawRect.x += 16;
if (GUI.Button(drawRect, Styles.iconRemove, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
demo.chartModules.RemoveAt(index);
demo.InitModuleButton();
}
}
if (prop.isExpanded)
{
drawRect = pos;
EditorGUI.indentLevel++;
var m_ChartPrefabs = prop.FindPropertyRelative("m_ChartPrefabs");
drawRect.x = pos.x;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.height = EditorGUIUtility.singleLineHeight;
var chartSize = EditorGUI.IntField(drawRect, "Chart Size", m_ChartPrefabs.arraySize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (chartSize != m_ChartPrefabs.arraySize)
{
while (chartSize > m_ChartPrefabs.arraySize) m_ChartPrefabs.arraySize++;
while (chartSize < m_ChartPrefabs.arraySize) m_ChartPrefabs.arraySize--;
}
for (int i = 0; i < chartSize; i++)
{
var element = m_ChartPrefabs.GetArrayElementAtIndex(i);
drawRect.width -= btnWidth * 5;
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + i));
drawRect.x += drawRect.width;
drawRect.width = btnWidth;
if (GUI.Button(drawRect, Styles.iconUp, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
var chartIndex = GetIndex(element);
Swap(demo.chartModules[index].chartPrefabs, chartIndex, chartIndex - 1);
demo.InitChartList(demo.chartModules[index]);
}
}
drawRect.x += btnWidth + 1;
if (GUI.Button(drawRect, Styles.iconDown, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
var chartIndex = GetIndex(element);
Swap(demo.chartModules[index].chartPrefabs, chartIndex, chartIndex + 1);
demo.InitChartList(demo.chartModules[index]);
}
}
drawRect.x += btnWidth + 1;
if (GUI.Button(drawRect, Styles.iconAdd, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
var chartIndex = GetIndex(element);
demo.chartModules[index].chartPrefabs.Insert(chartIndex + 1, null);
demo.InitChartList(demo.chartModules[index]);
}
}
drawRect.x += 16;
if (GUI.Button(drawRect, Styles.iconRemove, Styles.invisibleButton))
{
var demo = prop.serializedObject.targetObject as Demo;
var index = GetIndex(prop);
if (index >= 0)
{
var chartIndex = GetIndex(element);
demo.chartModules[index].chartPrefabs.RemoveAt(chartIndex);
demo.InitChartList(demo.chartModules[index]);
}
}
drawRect.x = pos.x;
drawRect.width = pos.width;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
EditorGUI.indentLevel--;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
var height = 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
if (prop.isExpanded)
{
height += (prop.FindPropertyRelative("m_ChartPrefabs").arraySize + 1)
* (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
}
return height;
}
private int GetIndex(SerializedProperty prop)
{
int index = -1;
var sindex = prop.propertyPath.LastIndexOf('[');
var eindex = prop.propertyPath.LastIndexOf(']');
if (sindex >= 0 && eindex >= 0)
{
var str = prop.propertyPath.Substring(sindex + 1, eindex - sindex - 1);
int.TryParse(str, out index);
}
return index;
}
private static bool Swap<T>(List<T> list, int index1, int index2)
{
if (index1 < 0 || index1 >= list.Count) return false;
if (index2 < 0 || index2 >= list.Count) return false;
var temp = list[index1];
list[index1] = list[index2];
list[index2] = temp;
return true;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2fbbaed3e670f478c844c1bdfc73d433
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,70 +0,0 @@

using UnityEditor;
namespace XChartsDemo
{
/// <summary>
/// Editor class used to edit UI BaseChart.
/// </summary>
[CustomEditor(typeof(Demo), false)]
internal class DemoEditor : UnityEditor.Editor
{
protected Demo m_Target;
protected SerializedProperty m_Script;
protected SerializedProperty m_LeftWidth;
protected SerializedProperty m_LeftButtonHeight;
protected SerializedProperty m_ChartSpacing;
protected SerializedProperty m_ChartSizeRatio;
protected SerializedProperty m_ButtonNormalColor;
protected SerializedProperty m_ButtonSelectedColor;
protected SerializedProperty m_ButtonHighlightColor;
protected SerializedProperty m_ChartModule;
protected virtual void OnEnable()
{
m_Target = (Demo)target;
m_Script = serializedObject.FindProperty("m_Script");
m_LeftWidth = serializedObject.FindProperty("m_LeftWidth");
m_ChartSpacing = serializedObject.FindProperty("m_ChartSpacing");
m_ChartSizeRatio = serializedObject.FindProperty("m_ChartSizeRatio");
m_LeftButtonHeight = serializedObject.FindProperty("m_LeftButtonHeight");
m_ButtonNormalColor = serializedObject.FindProperty("m_ButtonNormalColor");
m_ButtonSelectedColor = serializedObject.FindProperty("m_ButtonSelectedColor");
m_ButtonHighlightColor = serializedObject.FindProperty("m_ButtonHighlightColor");
m_ChartModule = serializedObject.FindProperty("m_ChartModule");
}
public override void OnInspectorGUI()
{
if (m_Target == null && target == null)
{
base.OnInspectorGUI();
return;
}
serializedObject.Update();
EditorGUILayout.PropertyField(m_LeftWidth);
EditorGUILayout.PropertyField(m_LeftButtonHeight);
EditorGUILayout.PropertyField(m_ChartSpacing);
EditorGUILayout.PropertyField(m_ChartSizeRatio);
EditorGUILayout.PropertyField(m_ButtonNormalColor);
EditorGUILayout.PropertyField(m_ButtonSelectedColor);
EditorGUILayout.PropertyField(m_ButtonHighlightColor);
var size = m_ChartModule.arraySize;
size = EditorGUILayout.IntField("Chart Module Size", size);
if (size != m_ChartModule.arraySize)
{
while (size > m_ChartModule.arraySize) m_ChartModule.arraySize++;
while (size < m_ChartModule.arraySize) m_ChartModule.arraySize--;
}
for (int i = 0; i < size; i++)
{
EditorGUILayout.PropertyField(m_ChartModule.GetArrayElementAtIndex(i));
}
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 90c1787bea03849c8b6d19be625b7e17
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6ef196d200c01426e94b8d7976ca90f5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ecb59424fa99f494193ac717bbd85eaf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4d3c24827bcd046c1849eb987628e0ce
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ca14acb0a2be346c7bc142e8a8c8abbe
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d8efd2749bb8144ecbec478eb767c2c1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5ce429161e3844dd6b1d13f762e1b75a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7b09f646eee7a46a0baf95702ab1dd94
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ded8677cb2dd245d692edb28b31a9c3d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e852d17191a2a48c9a20337aefdcc91f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4c459acff730e4f158802d2e7fe9a073
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: bd78b68519967493a8377d290aee8a0a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d7e7b1e6bfec64a04b67099998e63380
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a81b0a69d1b5848ec89917294a54f49c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 52b67cd734f9f47409ae55929c7a3ac2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a9f1b7e6ea1bf4311a282f3781fbb29d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 666e7b5282740407d956c58ca1ddcfdb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,430 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1067674712461128}
m_IsPrefabParent: 1
--- !u!1 &1067674712461128
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224147804559871088}
- component: {fileID: 222072236248669632}
- component: {fileID: 114021868465902394}
m_Layer: 5
m_Name: "Line9_Data Transform Filter_\u6570\u636E\u8FC7\u6EE4"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114021868465902394
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1067674712461128}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b4f38bd00b4648c448cabfc167538f7c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_DebugMode: 0
m_EnableTextMeshPro: 0
m_ChartName:
m_Theme:
m_Theme: 0
m_ThemeName: Default
m_FontName: Arial
m_TMPFontName: LiberationSans SDF
m_FontInstacneId: 640
m_TMPFontInstanceId: 0
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_ContrastColor:
serializedVersion: 2
rgba: 4283256145
m_BackgroundColor:
serializedVersion: 2
rgba: 4294967295
m_ColorPalette:
- serializedVersion: 2
rgba: 4281415106
- serializedVersion: 2
rgba: 4283712815
- serializedVersion: 2
rgba: 4289241185
- serializedVersion: 2
rgba: 4284842708
- serializedVersion: 2
rgba: 4289644433
- serializedVersion: 2
rgba: 4286816116
- serializedVersion: 2
rgba: 4280452810
- serializedVersion: 2
rgba: 4288324285
- serializedVersion: 2
rgba: 4285821038
- serializedVersion: 2
rgba: 4285556052
- serializedVersion: 2
rgba: 4292070596
m_Common:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 20
m_Title:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 24
m_SubTitle:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 22
m_Legend:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 20
m_UnableColor: {r: 0.8, g: 0.8, b: 0.8, a: 1}
m_Axis:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 0.8
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 0
m_SplitLineColor:
serializedVersion: 2
rgba: 542200145
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4283256145
m_SplitAreaColors:
- serializedVersion: 2
rgba: 1308293882
- serializedVersion: 2
rgba: 1305004232
m_RadiusAxis:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 0.8
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 0
m_SplitLineColor:
serializedVersion: 2
rgba: 542200145
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4283256145
m_SplitAreaColors:
- serializedVersion: 2
rgba: 1308293882
- serializedVersion: 2
rgba: 1305004232
m_AngleAxis:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 0.8
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 0
m_SplitLineColor:
serializedVersion: 2
rgba: 542200145
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4283256145
m_SplitAreaColors:
- serializedVersion: 2
rgba: 1308293882
- serializedVersion: 2
rgba: 1305004232
m_Polar:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 0.8
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 0
m_SplitLineColor:
serializedVersion: 2
rgba: 542200145
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4283256145
m_SplitAreaColors:
- serializedVersion: 2
rgba: 1308293882
- serializedVersion: 2
rgba: 1305004232
m_Gauge:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 15
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 15
m_SplitLineColor:
serializedVersion: 2
rgba: 4294967295
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4294967295
m_SplitAreaColors:
- serializedVersion: 2
rgba: 1308293882
- serializedVersion: 2
rgba: 1305004232
m_BarBackgroundColor:
serializedVersion: 2
rgba: 4291348680
m_StageColor:
- m_Percent: 0.2
m_Color:
serializedVersion: 2
rgba: 4289644433
- m_Percent: 0.8
m_Color:
serializedVersion: 2
rgba: 4288579171
- m_Percent: 1
m_Color:
serializedVersion: 2
rgba: 4281415106
m_Radar:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.31764707, g: 0.3019608, b: 0.3019608, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_LineType: 0
m_LineWidth: 0.8
m_LineLength: 0
m_LineColor:
serializedVersion: 2
rgba: 4283256145
m_SplitLineType: 0
m_SplitLineWidth: 0.8
m_SplitLineLength: 0
m_SplitLineColor:
serializedVersion: 2
rgba: 542200145
m_TickWidth: 0.8
m_TickLength: 5
m_TickColor:
serializedVersion: 2
rgba: 4283256145
m_SplitAreaColors:
- serializedVersion: 2
rgba: 4294375158
- serializedVersion: 2
rgba: 4293388263
m_Tooltip:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 1, g: 1, b: 1, a: 1}
m_TextBackgroundColor: {r: 0.31764707, g: 0.31764707, b: 0.31764707, a: 0.78431374}
m_FontSize: 20
m_LineType: 0
m_LineWidth: 0.8
m_LineColor:
serializedVersion: 2
rgba: 1680419113
m_AreaColor:
serializedVersion: 2
rgba: 542200145
m_LabelTextColor:
serializedVersion: 2
rgba: 4294967295
m_LabelBackgroundColor:
serializedVersion: 2
rgba: 4280887593
m_DataZoom:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 20
m_BorderWidth: 0.5
m_DataLineWidth: 0.5
m_FillerColor:
serializedVersion: 2
rgba: 1858910119
m_BorderColor:
serializedVersion: 2
rgba: 4292730333
m_DataLineColor:
serializedVersion: 2
rgba: 4283712815
m_DataAreaColor:
serializedVersion: 2
rgba: 1431586095
m_BackgroundColor:
serializedVersion: 2
rgba: 0
m_VisualMap:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_TextColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_TextBackgroundColor: {r: 0, g: 0, b: 0, a: 0}
m_FontSize: 18
m_BorderWidth: 0
m_BorderColor:
serializedVersion: 2
rgba: 4291611852
m_BackgroundColor:
serializedVersion: 2
rgba: 0
m_TriangeLen: 20
m_Serie:
m_LineWidth: 1.8
m_LineSymbolSize: 4
m_LineSymbolSelectedSize: 8
m_ScatterSymbolSize: 20
m_ScatterSymbolSelectedSize: 30
m_PieTooltipExtraRadius: 8
m_PieSelectedOffset: 8
m_CandlestickColor:
serializedVersion: 2
rgba: 4281415106
m_CandlestickColor0:
serializedVersion: 2
rgba: 4283844145
m_CandlestickBorderWidth: 1
m_CandlestickBorderColor:
serializedVersion: 2
rgba: 4281415106
m_CandlestickBorderColor0:
serializedVersion: 2
rgba: 4283844145
m_Settings:
m_MaxPainter: 10
m_ReversePainter: 0
m_BasePainterMaterial: {fileID: 0}
m_SeriePainterMaterial: {fileID: 0}
m_TopPainterMaterial: {fileID: 0}
m_LineSmoothStyle: 3
m_LineSmoothness: 2
m_LineSegmentDistance: 3
m_CicleSmoothness: 2
m_LegendIconLineWidth: 2
m_LegendIconCornerRadius:
- 0.25
- 0.25
- 0.25
- 0.25
m_AngleAxes: []
m_Backgrounds: []
m_DataZooms: []
m_Grids: []
m_Legends: []
m_MarkLines: []
m_MarkAreas: []
m_Polars: []
m_Radars: []
m_RadiusAxes: []
m_Titles: []
m_Tooltips: []
m_Vessels: []
m_VisualMaps: []
m_XAxes: []
m_YAxes: []
m_SerieBars: []
m_SerieCandlesticks: []
m_SerieEffectScatters: []
m_SerieGauges: []
m_SerieHeatmaps: []
m_SerieLines: []
m_SerieLiquids: []
m_SeriePies: []
m_SerieRadars: []
m_SerieRings: []
m_SerieScatters: []
--- !u!222 &222072236248669632
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1067674712461128}
--- !u!224 &224147804559871088
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1067674712461128}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -974.7652}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -10.830725}
m_SizeDelta: {x: 1200, y: 800}
m_Pivot: {x: 0.5, y: 0.5}

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e381dd638b7e64867876847ee25f4603
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4ab3460720d0f47f4ab339cf8cba5a25
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,445 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1193884583766258}
m_IsPrefabParent: 1
--- !u!1 &1023889020065772
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224498995510391718}
m_Layer: 5
m_Name: desc
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1193884583766258
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224457778121662608}
- component: {fileID: 222539473495237668}
- component: {fileID: 114656818258355322}
m_Layer: 5
m_Name: Thumb
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1399349534157804
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224195826273946622}
- component: {fileID: 222447077409147954}
- component: {fileID: 114038891576819350}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1469835152884344
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224459326322377154}
- component: {fileID: 222315113265366012}
- component: {fileID: 114919977981523934}
m_Layer: 5
m_Name: chart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1876512226706300
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224825352985075562}
- component: {fileID: 222838392271989024}
- component: {fileID: 114936933209995772}
- component: {fileID: 114501721475720118}
m_Layer: 5
m_Name: btn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1956389367569800
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224960384289850946}
- component: {fileID: 222693556488268584}
- component: {fileID: 114577082724077218}
m_Layer: 5
m_Name: Text2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114038891576819350
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1399349534157804}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.13333334, g: 0.13333334, b: 0.13333334, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 24
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!114 &114501721475720118
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1876512226706300}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 0}
m_HighlightedColor: {r: 0.16078432, g: 0.5137255, b: 1, a: 0.32941177}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 114936933209995772}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114577082724077218
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1956389367569800}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.3602941, g: 0.3602941, b: 0.3602941, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!114 &114656818258355322
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1193884583766258}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114919977981523934
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1469835152884344}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114936933209995772
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1876512226706300}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &222315113265366012
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1469835152884344}
--- !u!222 &222447077409147954
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1399349534157804}
--- !u!222 &222539473495237668
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1193884583766258}
--- !u!222 &222693556488268584
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1956389367569800}
--- !u!222 &222838392271989024
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1876512226706300}
--- !u!224 &224195826273946622
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1399349534157804}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224498995510391718}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 6.4799995}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224457778121662608
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1193884583766258}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224459326322377154}
- {fileID: 224498995510391718}
- {fileID: 224825352985075562}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 283.5, y: 242.54}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224459326322377154
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1469835152884344}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.23, y: 0.23, z: 1}
m_Children: []
m_Father: {fileID: 224457778121662608}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -95.37}
m_SizeDelta: {x: 0, y: 197.4}
m_Pivot: {x: 0.5, y: 1}
--- !u!224 &224498995510391718
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1023889020065772}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224195826273946622}
- {fileID: 224960384289850946}
m_Father: {fileID: 224457778121662608}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 7.760002}
m_SizeDelta: {x: 0, y: 66.4}
m_Pivot: {x: 0.5, y: 0}
--- !u!224 &224825352985075562
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1876512226706300}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224457778121662608}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224960384289850946
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1956389367569800}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224498995510391718}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: -21.79}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0.5, y: 0.5}

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 63a05c4a877ba4d129b65ab08d796190
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7a51c10c0ca30408fba6f8e59145ce69
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,321 +0,0 @@

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts;
namespace XChartsDemo
{
[System.Serializable]
public class ChartModule
{
[SerializeField] private string m_Name = "Name";
[SerializeField] private string m_SubName = "SubName";
[SerializeField] private int m_Column = 3;
[SerializeField] private string m_Title = "Title";
[SerializeField] private bool m_Selected;
[SerializeField] private GameObject m_Panel;
[SerializeField] private List<GameObject> m_ChartPrefabs;
public int column { get { return m_Column; } set { m_Column = value; } }
public string name { get { return m_Name; } set { m_Name = value; } }
public string subName { get { return m_SubName; } set { m_SubName = value; } }
public string title { get { return m_Title; } set { m_Title = value; } }
public bool select { get { return m_Selected; } set { m_Selected = value; } }
public GameObject panel { get { return m_Panel; } set { m_Panel = value; } }
public Button button { get; set; }
public List<GameObject> chartPrefabs { get { return m_ChartPrefabs; } }
public int index { get; internal set; }
}
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Demo : MonoBehaviour
{
[SerializeField] private float m_LeftWidth = 150;
[SerializeField] private float m_LeftButtonHeight = 60;
//[SerializeField] private Vector2 m_ChartSpacing = new Vector2(5, 5);
//[SerializeField] private Vector2 m_ChartSizeRatio = new Vector2(5, 3);
[SerializeField] private Color m_ButtonNormalColor;
[SerializeField] private Color m_ButtonSelectedColor;
[SerializeField] private Color m_ButtonHighlightColor;
[SerializeField] public int lastSelectedModuleIndex = -1;
[SerializeField] private List<ChartModule> m_ChartModule = new List<ChartModule>();
private GameObject m_BtnClone;
private GameObject m_ThumbClone;
private ThemeType m_SelectedTheme;
private GameObject m_SelectedPanel;
private int m_LastSelectedModuleIndex;
private float m_LastCheckLeftWidth;
private Toggle m_DarkThemeToggle;
private Text m_Title;
private ScrollRect m_ScrollRect;
private Mask m_Mark;
private GameObject m_DetailRoot;
private GameObject m_DetailChartRoot;
public List<ChartModule> chartModules { get { return m_ChartModule; } }
void Awake()
{
m_SelectedTheme = ThemeType.Default;
m_ButtonNormalColor = ChartHelper.GetColor("#293C55FF");
m_ButtonSelectedColor = ChartHelper.GetColor("#e43c59ff");
m_ButtonHighlightColor = ChartHelper.GetColor("#0E151FFF");
Init();
}
void Init()
{
m_ScrollRect = transform.Find("chart_list").GetComponent<ScrollRect>();
m_Mark = transform.Find("chart_list/Viewport").GetComponent<Mask>();
m_Mark.enabled = true;
m_Title = transform.Find("chart_title/Text").GetComponent<Text>();
m_ThumbClone = transform.Find("clone_thumb").gameObject;
m_ThumbClone.SetActive(false);
m_DetailRoot = transform.Find("chart_detail").gameObject;
m_DetailChartRoot = transform.Find("chart_detail/chart").gameObject;
m_DetailRoot.SetActive(false);
InitThemeButton();
InitModuleButton();
InitChartList();
InitSize();
}
void InitSize()
{
UIUtil.SetRectTransformWidth(transform, m_LeftWidth, "chart_btn");
UIUtil.SetRectTransformLeft(transform, m_LeftWidth, "chart_list");
UIUtil.SetRectTransformLeft(transform, m_LeftWidth, "chart_title");
UIUtil.SetGridLayoutGroup(transform, new Vector2(m_LeftWidth, m_LeftButtonHeight), new Vector2(0, 2), "chart_btn");
foreach (var module in m_ChartModule)
{
SetChartRootInfo(module);
}
}
private void SetChartGridLayoutGroup(GridLayoutGroup grid, int column)
{
// if (grid == null) return;
// var screenWidth = Screen.width;
// var screenHeight = Screen.height;
// #if UNITY_EDITOR
// screenWidth = Camera.main.pixelWidth;
// #endif
// var chartWidth = (screenWidth - m_LeftWidth - m_ChartSpacing.x * (column + 1)) / column;
// var rect = grid.gameObject.GetComponent<RectTransform>();
// rect.anchorMin = new Vector2(0, 1);
// rect.anchorMax = new Vector2(1, 1);
// rect.pivot = new Vector2(0, 1);
// rect.anchoredPosition = Vector2.zero;
// rect.sizeDelta = new Vector2(0, rect.sizeDelta.y);
// grid.spacing = m_ChartSpacing;
// grid.cellSize = new Vector2(chartWidth, chartWidth * m_ChartSizeRatio.y / m_ChartSizeRatio.x);
}
private void SetChartRootInfo(ChartModule module)
{
m_SelectedPanel = module.panel;
if (m_SelectedPanel == null) return;
var grid = m_SelectedPanel.GetComponent<GridLayoutGroup>();
var hig = Mathf.CeilToInt(m_SelectedPanel.transform.childCount * 1f / module.column) * (grid.cellSize.y + grid.spacing.y);
SetChartGridLayoutGroup(grid, module.column);
UIUtil.SetRectTransformHeight(m_SelectedPanel.transform, hig);
}
void ResetParam()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.RemoveChartObject();
}
}
void Update()
{
#if UNITY_EDITOR
if (m_ChartModule.Count <= 0) return;
if (!Application.isPlaying) m_Mark.enabled = false;
if (m_LastCheckLeftWidth != m_LeftWidth)
{
m_LastCheckLeftWidth = m_LeftWidth;
InitSize();
}
#endif
}
public int GetSelectedModule()
{
for (int i = 0; i < m_ChartModule.Count; i++)
{
if (m_ChartModule[i].select) return i;
}
return -1;
}
public void InitModuleButton()
{
var btnPanel = transform.Find("chart_btn");
m_BtnClone = transform.Find("clone_btn").gameObject;
m_BtnClone.SetActive(false);
ChartHelper.DestroyAllChildren(btnPanel.transform);
for (int i = 0; i < m_ChartModule.Count; i++)
{
var module = m_ChartModule[i];
module.index = i;
var btnName = "btn_" + module.name;
GameObject btn;
if (btnPanel.Find(btnName))
{
btn = btnPanel.Find(btnName).gameObject;
btn.name = btnName;
ChartHelper.SetActive(btn, true);
}
else
{
btn = GameObject.Instantiate(m_BtnClone);
btn.SetActive(true);
btn.name = btnName;
btn.transform.SetParent(btnPanel);
btn.transform.localPosition = Vector3.zero;
}
btn.transform.localScale = Vector3.one;
module.button = btn.GetComponent<Button>();
module.button.transform.Find("Text").GetComponent<Text>().text = module.name.Replace("\\n", "\n");
module.button.transform.Find("SubText").GetComponent<Text>().text = module.subName.Replace("\\n", "\n");
ChartHelper.ClearEventListener(btn.gameObject);
ChartHelper.AddEventListener(btn.gameObject, EventTriggerType.PointerDown, (data) =>
{
ClickModule(module);
});
}
for (int i = 0; i < m_ChartModule.Count; i++)
{
var module = m_ChartModule[i];
module.index = i;
if (module.select)
{
ClickModule(module);
break;
}
}
}
public void InitChartList()
{
foreach (var module in m_ChartModule)
InitChartList(module);
}
public void InitChartList(ChartModule module)
{
ChartHelper.DestroyAllChildren(module.panel.transform);
for (int i = 0; i < module.chartPrefabs.Count; i++)
{
var obj = UIUtil.Instantiate(m_ThumbClone, module.panel.transform);
var chartParent = obj.transform.Find("chart");
var prefab = module.chartPrefabs[i];
if (prefab != null)
{
var names = prefab.name.Split('_');
var chart = UIUtil.Instantiate(prefab, chartParent.transform);
obj.name = prefab.name;
chart.name = prefab.name;
if (names.Length == 3)
{
UIUtil.SetText(obj, names[1], "desc/Text");
UIUtil.SetText(obj, names[2], "desc/Text2");
}
obj.transform.Find("btn").GetComponent<Button>().onClick.AddListener(delegate ()
{
m_SelectedPanel = m_DetailChartRoot;
ChartHelper.DestroyAllChildren(m_DetailChartRoot.transform);
UIUtil.Instantiate(prefab, m_DetailChartRoot.transform);
m_DetailRoot.SetActive(true);
module.panel.SetActive(false);
SelecteTheme(m_SelectedTheme);
});
}
}
}
void ClickModule(ChartModule selectedModule)
{
if (lastSelectedModuleIndex >= 0)
{
m_ChartModule[lastSelectedModuleIndex].select = false;
}
lastSelectedModuleIndex = selectedModule.index;
m_DetailRoot.SetActive(false);
foreach (var module in m_ChartModule)
{
if (module.index != lastSelectedModuleIndex)
{
var block = module.button.colors;
block.highlightedColor = m_ButtonHighlightColor;
#if UNITY_2019
block.selectedColor = m_ButtonNormalColor;
#endif
block.pressedColor = m_ButtonNormalColor;
block.normalColor = m_ButtonNormalColor;
module.button.colors = block;
if (module.panel != null)
module.panel.SetActive(false);
}
else
{
var block = module.button.colors;
block.highlightedColor = m_ButtonSelectedColor;
#if UNITY_2019
block.selectedColor = m_ButtonSelectedColor;
#endif
block.pressedColor = m_ButtonSelectedColor;
block.normalColor = m_ButtonSelectedColor;
module.button.colors = block;
if (module.panel != null)
module.panel.SetActive(true);
}
}
if (selectedModule.panel != null)
m_ScrollRect.content = selectedModule.panel.GetComponent<RectTransform>();
SetChartRootInfo(selectedModule);
m_Title.text = string.IsNullOrEmpty(selectedModule.title) ?
selectedModule.name : selectedModule.title;
SelecteTheme(m_SelectedTheme);
}
void InitThemeButton()
{
m_DarkThemeToggle = transform.Find("chart_theme/dark").GetComponent<Toggle>();
m_DarkThemeToggle.isOn = m_SelectedTheme == ThemeType.Dark;
m_DarkThemeToggle.onValueChanged.AddListener(delegate (bool flag)
{
m_SelectedTheme = flag ? ThemeType.Dark : ThemeType.Default;
SelecteTheme(m_SelectedTheme);
});
}
void SelecteTheme(ThemeType theme)
{
m_SelectedTheme = theme;
var charts = (m_SelectedPanel == null ? transform : m_SelectedPanel.transform).GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.UpdateTheme(theme);
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f81ca580204024b8db33b4646c549c4f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,179 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using XCharts;
namespace XChartsDemo
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
internal class Demo_Animation : MonoBehaviour
{
[SerializeField] private int m_FadeInDuration = 1000;
[SerializeField] private int m_FadeOutDuration = 1000;
[SerializeField] private int m_DataChangeDuration = 500;
void Awake()
{
InitCharts();
TryInitButton("buttons/btnFadeIn", AnimationFadeIn);
TryInitButton("buttons/btnFadeOut", AnimationFadeOut);
TryInitButton("buttons/btnDataAdd", AnimationDataAdd);
TryInitButton("buttons/btnDataChange", AnimationDataChange);
TryInitButton("buttons/btnPause", AnimationPause);
TryInitButton("buttons/btnResume", AnimationResume);
TryInitButton("buttons/btnReset", AnimationReset);
}
void InitCharts()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
foreach (var serie in chart.series)
{
serie.animation.fadeInDuration = m_FadeInDuration;
serie.animation.fadeOutDuration = m_FadeOutDuration;
serie.animation.dataChangeDuration = m_DataChangeDuration;
}
}
SetInputField("settings/fadeIn/InputField", m_FadeInDuration, OnFadeInDurationChanged);
SetInputField("settings/fadeOut/InputField", m_FadeOutDuration, OnFadeOutDurationChanged);
SetInputField("settings/dataChange/InputField", m_DataChangeDuration, OnDataChangeDurationChanged);
}
void SetInputField(string path, int value, UnityAction<string> act)
{
var input = transform.Find(path).gameObject.GetComponent<InputField>();
input.onEndEdit.AddListener(act);
input.text = value.ToString();
}
Button TryInitButton(string name, UnityAction act)
{
var trans = transform.Find(name);
if (trans)
{
var btn = trans.gameObject.GetComponent<Button>();
btn.onClick.AddListener(act);
return btn;
}
else
{
return null;
}
}
void AnimationFadeIn()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationFadeIn();
}
}
void AnimationFadeOut()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationFadeOut();
}
}
void AnimationDataAdd()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationFadeOut();
}
}
void AnimationDataChange()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
if (chart is RingChart)
{
var serieData = chart.GetSerie(0).GetSerieData(0);
chart.UpdateData(0, 0, 0, Random.Range(0, (float)serieData.GetData(1)));
}
else
{
var dataCount = chart.series[0].dataCount;
var index = UnityEngine.Random.Range(0, dataCount);
chart.UpdateData(0, index, UnityEngine.Random.Range(1, 100));
}
}
}
void AnimationPause()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationPause();
}
}
void AnimationResume()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationResume();
}
}
void AnimationReset()
{
var charts = transform.GetComponentsInChildren<BaseChart>();
foreach (var chart in charts)
{
chart.AnimationReset();
}
}
void OnFadeInDurationChanged(string content)
{
var charts = transform.GetComponentsInChildren<BaseChart>();
m_FadeInDuration = int.Parse(content);
foreach (var chart in charts)
{
foreach (var serie in chart.series)
{
serie.animation.fadeInDuration = m_FadeInDuration;
}
}
}
void OnFadeOutDurationChanged(string content)
{
var charts = transform.GetComponentsInChildren<BaseChart>();
m_FadeOutDuration = int.Parse(content);
foreach (var chart in charts)
{
foreach (var serie in chart.series)
{
serie.animation.fadeOutDuration = m_FadeOutDuration;
}
}
}
void OnDataChangeDurationChanged(string content)
{
var charts = transform.GetComponentsInChildren<BaseChart>();
m_DataChangeDuration = int.Parse(content);
foreach (var chart in charts)
{
foreach (var serie in chart.series)
{
serie.animation.dataChangeDuration = m_DataChangeDuration;
}
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 13a697cc1196d43fdb8f329026a721e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,50 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using XCharts;
using System;
using System.Collections.Generic;
namespace XChartsDemo
{
[DisallowMultipleComponent]
//[ExecuteInEditMode]
public class Demo_Line12 : MonoBehaviour
{
public int dataCount = 20000;
void Awake()
{
// var chart = GetComponent<BaseChart>();
// if (chart == null) return;
// chart.RemoveData();
// var serie = chart.AddSerie<Line>("Fake Data");
// serie.sampleDist = 2f;
// serie.symbol.show = false;
// serie.itemStyle.color = new Color32(255, 70, 131, 255);
// serie.areaStyle.show = true;
// serie.areaStyle.color = new Color32(255, 158, 68, 255);
// serie.areaStyle.toColor = new Color32(255, 70, 131, 255);
// var baseDate = new DateTime(1968, 9, 3);
// var data = new List<double>();
// data.Add(UnityEngine.Random.Range(0f, 1f) * 300);
// for (int i = 1; i < dataCount; i++)
// {
// baseDate = baseDate.AddHours(24);
// chart.AddXAxisData(baseDate.ToString("yyyy/MM/dd"));
// double value = (int)((UnityEngine.Random.Range(0f, 1f) - 0.5f) * 20 + data[i - 1]);
// data.Add(value);
// chart.AddData(0, value);
// }
// chart.RefreshChart();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ddee4a93f14444d39bd02d3809194de6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,125 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using XCharts;
namespace XChartsDemo
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
internal class Demo_Performance : MonoBehaviour
{
[SerializeField] private float fps = 0;
[SerializeField] private int m_MaxCacheDataNumber = 3000;
private const float INTERVAL = 0.2f;
private int frameCount = 0;
private float lastTime = 0f;
private int initCount = 0;
private System.DateTime timeNow;
private LineChart fpsChart;
private LineChart lineChart;
private BarChart barChart;
private Text fpsText;
void Awake()
{
fpsChart = transform.Find("fps/FpsChart").gameObject.GetComponent<LineChart>();
lineChart = transform.Find("charts/LineChart").gameObject.GetComponent<LineChart>();
barChart = transform.Find("charts/BarChart").gameObject.GetComponent<BarChart>();
fpsText = transform.Find("settings/txtFps").gameObject.GetComponent<Text>();
fpsChart.ClearData();
lineChart.ClearData();
barChart.ClearData();
InitCharts();
}
void Start()
{
lastTime = Time.realtimeSinceStartup;
}
void Update()
{
frameCount++;
if (initCount < m_MaxCacheDataNumber)
{
for (int i = 0; i < 10; i++)
{
initCount++;
if (initCount > m_MaxCacheDataNumber) break;
AddOneData();
}
}
if (Time.realtimeSinceStartup - lastTime >= INTERVAL)
{
fps = frameCount / (Time.realtimeSinceStartup - lastTime);
frameCount = 0;
lastTime = Time.realtimeSinceStartup;
fpsChart.AddData(0, fps);
fpsChart.AddXAxisData(Time.frameCount.ToString());
fpsText.text = string.Format("FPS:{0:f1}", fps);
if (initCount >= m_MaxCacheDataNumber)
{
AddOneData();
initCount++;
}
}
}
void AddOneData()
{
lineChart.GetChartComponent<Title>().text = initCount + "数据";
barChart.GetChartComponent<Title>().text = initCount + "数据";
timeNow = timeNow.AddSeconds(1);
string category = timeNow.ToString("hh:mm:ss");
float xvalue = Mathf.PI / 180 * initCount;
float yvalue = 15 + Mathf.Sin(xvalue) * 2;
lineChart.AddData(0, yvalue);
lineChart.AddXAxisData(category);
barChart.AddData(0, yvalue);
barChart.AddXAxisData(category);
}
void InitCharts()
{
fpsChart.SetMaxCache(1000);
lineChart.SetMaxCache(m_MaxCacheDataNumber);
barChart.SetMaxCache(m_MaxCacheDataNumber);
SetInputField("settings/fadeIn/InputField", m_MaxCacheDataNumber, OnFadeInDurationChanged);
}
void SetInputField(string path, int value, UnityAction<string> act)
{
var input = transform.Find(path).gameObject.GetComponent<InputField>();
input.onEndEdit.AddListener(act);
input.text = value.ToString();
}
Button TryInitButton(string name, UnityAction act)
{
var trans = transform.Find(name);
if (trans)
{
var btn = trans.gameObject.GetComponent<Button>();
btn.onClick.AddListener(act);
return btn;
}
else
{
return null;
}
}
void OnFadeInDurationChanged(string content)
{
m_MaxCacheDataNumber = int.Parse(content);
lineChart.SetMaxCache(m_MaxCacheDataNumber);
barChart.SetMaxCache(m_MaxCacheDataNumber);
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d9d68a9ea64234d42af215ee70dd20af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,91 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace XChartsDemo
{
internal static class UIUtil
{
public static GameObject Instantiate(GameObject clone, Transform parent)
{
var obj = GameObject.Instantiate(clone);
obj.layer = LayerMask.NameToLayer("UI");
obj.transform.SetParent(parent, true);
obj.transform.localScale = Vector3.one;
obj.transform.localPosition = Vector3.zero;
obj.SetActive(true);
return obj;
}
public static RectTransform GetRectTransform(Transform transform, string path)
{
if (!string.IsNullOrEmpty(path))
{
transform = transform.Find(path);
}
if (transform != null)
{
return transform.gameObject.GetComponent<RectTransform>();
}
return null;
}
public static void SetRectTransformWidth(Transform transform, float width, string path = null)
{
var rect = GetRectTransform(transform, path);
if (rect != null)
{
rect.sizeDelta = new Vector2(width, rect.sizeDelta.y);
}
}
public static void SetRectTransformHeight(Transform transform, float height, string path = null)
{
var rect = GetRectTransform(transform, path);
if (rect != null)
{
rect.sizeDelta = new Vector2(rect.sizeDelta.x, height);
}
}
public static void SetRectTransformLeft(Transform transform, float width, string path = null)
{
var rect = GetRectTransform(transform, path);
if (rect != null)
{
rect.anchoredPosition = new Vector2(width, rect.anchoredPosition.y);
}
}
public static void SetGridLayoutGroup(Transform transform, Vector2 cellSize, Vector2 spacing, string path = null)
{
if (!string.IsNullOrEmpty(path))
{
transform = transform.Find(path);
}
if (transform != null)
{
var com = transform.gameObject.GetComponent<GridLayoutGroup>();
if (com != null)
{
com.cellSize = cellSize;
com.spacing = spacing;
}
else
{
Debug.LogError("SetGridLayoutGroupSize ERROR:can't find GridLayoutGroup: " + (transform.name + "/" + path));
}
}
}
public static void SetText(GameObject parent, string text, string subPath = null)
{
if (!string.IsNullOrEmpty(subPath))
{
parent.transform.Find(subPath).GetComponent<Text>().text = text;
}
else
{
parent.GetComponent<Text>().text = text;
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0c48d683ad65245e7838578f46c55202
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,536 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641275, b: 0.5748172, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &69708543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 69708547}
- component: {fileID: 69708546}
- component: {fileID: 69708545}
- component: {fileID: 69708544}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &69708544
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 69708543}
m_Enabled: 1
--- !u!124 &69708545
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 69708543}
m_Enabled: 1
--- !u!20 &69708546
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 69708543}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &69708547
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 69708543}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &98970907
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 98970910}
- component: {fileID: 98970909}
- component: {fileID: 98970908}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &98970908
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 98970907}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &98970909
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 98970907}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &98970910
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 98970907}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1221971497
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1221971498}
- component: {fileID: 1221971500}
- component: {fileID: 1221971499}
m_Layer: 5
m_Name: ugl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1221971498
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221971497}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1981203670}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 500, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1221971499
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221971497}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e8a87ea5df031473da3eb5fb8f57e20a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
--- !u!222 &1221971500
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221971497}
m_CullTransparentMesh: 0
--- !u!1 &1849247238
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1849247240}
- component: {fileID: 1849247239}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1849247239
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1849247238}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.802082
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1849247240
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1849247238}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1981203666
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1981203670}
- component: {fileID: 1981203669}
- component: {fileID: 1981203668}
- component: {fileID: 1981203667}
m_Layer: 0
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1981203667
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981203666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1981203668
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981203666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &1981203669
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981203666}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 69708546}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1981203670
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981203666}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1221971498}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 7b8f38ab97f854badb87b43f638e5290
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: a8890fea0a5384d328f22e9738289cc9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5adbd6df9174d6943b7eb8d23651ffd1
timeCreated: 1553641950
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 97265b476acdc465999cb5dd2631950d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,16 +0,0 @@
# TODO
* ~~多条柱状图问题~~
* ~~堆叠问题~~
* ~~堆叠折线图动画问题~~
* ~~堆叠时sybol和area图层问题~~
* ~~饼图~~
* ~~水位图~~
* ~~自定义绘制~~
* ~~xy互换时area问题~~
* ~~坐标轴inverse的问题~~
* TextMeshPro
* DataZoom
* VisualMap
* MarkLine

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1014 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 KiB

View File

@@ -1,124 +0,0 @@
# Get start with XCharts in 5 minute
[Return homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
[XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
[XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)
## Installing XCharts
Install `XCharts` using one of the following methods:
If you just want to run demo and know what does `XCharts` look like, you can download the project in [Github](https://github.com/monitor1394/unity-ugui-XCharts),[master](https://github.com/monitor1394/unity-ugui-XCharts/archive/master.zip) is the latest unstable version, [release](https://github.com/monitor1394/unity-ugui-XCharts/releases) provide stable versions to download. Open with Unity if downloaded.
If you want to join `XCharts` to your project, you can download the unitypackage from [release](https://github.com/monitor1394/unity-ugui-XCharts/releases). XCharts include two unitypackage: `XCharts` and `XChartsDemo`. Import the `XCharts.unitypackage` to your project. `XChartsDemo.unitypackage` is the packge of Demo, you can import it as you see fit. Also, you can download the source code and copy to your project.
If your project use `Unity 2018.3` or above, your can import `XCharts` by `Package Manager`, which only contain `XCharts` core and do not include the `XChartsDemo`. The specific steps are as follows:
1. Open the `mamnifest.json` file in `Packages` directory, and add:
``` json
"com.monitor1394.xcharts": "https://github.com/monitor1394/unity-ugui-XCharts.git#2.0-upm",
```
2. Switch to `Unity`, It may take 3 to 5 minutes to download and compile, and once successful you can start using `XCharts`.
3. If you want to delete `XCharts`, undo step 1.
4. If you want to update `XCharts`, delete the contents about `com.monitor1394.xcharts` under `lock` of `manifest.json` file, it will be download and compile again.
5. You can check update in `Component -> XCharts -> Check For Update`.
## Add a simple LineChart
In `Hierarchy` attempt to right click or menu bar `GameObject` drop down: `XCharts-> LineChart`
![linechart](screenshot/op_addchart.png)
A simple line chart is done:
![linechart](screenshot/linechart.png)
You can adjust the parameters of each component in `Inspector` view, and `Game` view will fed back the effect of adjustment in real time. [XCharts Configuration](xcharts-configuration-EN.md) can see the detailed descriptions of each component parameters.
![inspcetor-desc](screenshot/inpsector-desc.png)
## How to adjust parameters quickly
* The first thing to understand is that `XCharts` is drived by configuration parameter. To get the desired effect, you only need to adjust the configuration parameters under the corresponding component. There is no need to change the nodes attempted by `Hierarchy`, because those nodes are generated internally by `XCharts` according to the configuration parameters. If you change it, it will be restored.
* Quickly locate the component that corresponds to the effect you want to change. This requires some understanding of the components. For example, we want the end of axis X to display arrows, step 1, axis X map to `XAxis0`. step 2, axis line map to `AxisLine`, and then see if `AxisLine` has any parameters to achieve this effect.
* `XCharts` provides a full range of parameter configurations from global `Theme`, series `Serie`, individual data items `SerieData`. Priority from large to small: `SerieData` -> `Serie` -> `Theme`. Take the color example of `ItemStyle`, which is preferred if `ItemStyle` of `SerieData` is configured with a color value. To determine if the Color value is configured is `Color. clear` (the Color RGBA is 0).
## Add LineChart with code
Add component `LineChart` to gameObject:
```C#
var chart = gameObject.GetComponent<LineChart>();
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
}
```
Set the title:
```C#
chart.GetChartComponent<Title>().show = true;
chart.GetChartComponent<Title>().text = "Line Simple";
```
Set the tooltip and legend:
```C#
chart.tooltip.show = true;
chart.legend.show = false;
```
Sets whether to use double axes and the type of axes:
```C#
xAxis.show = true;
chart.xAxes[1].show = false;
yAxis.show = true;
chart.yAxes[1].show = false;
xAxis.type = Axis.AxisType.Category;
yAxis.type = Axis.AxisType.Value;
```
Set the dividing line of coordinate axis:
```C#
xAxis.splitNumber = 10;
xAxis.boundaryGap = true;
```
Clear data, add 'Serie' of type 'Line' to receive the data:
```C#
chart.RemoveData();
chart.AddSerie(SerieType.Line);
```
Add 10 data:
```C#
for (int i = 0; i < 10; i++)
{
chart.AddXAxisData("x" + i);
chart.AddData(0, Random.Range(10, 20));
}
```
And then here is a simple line chart:
![linechart-simple](screenshot/linechart-simple.png)
If there are more than one series in a chart, the Axis data only needs to be added once, instead of repeating multiple loops. Remember: Axis needs to have the same number of data from Serie.
See the complete code in `Examples``Example13_LineSimple.cs`
You can also use the code to control more parameters. There are many more examples under `Examples`. All parameters in [XCharts Configuration](xcharts-configuration-EN.md) or `Inspector` can be controlled by code.
In addition, unless customized, it is recommended to call the interfaces in the [XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md), which do some internal correlation processing, such as refreshing the chart, etc. If you call the interface of an internal component, you'll need to handle other issues like refresh yourself.
[Return homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
[XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
[XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)

View File

@@ -1,177 +0,0 @@
# 教程5分钟上手XCharts
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[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)
[XCharts配置项手册](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts配置项手册.md)
## 获取和引入 XCharts
你可以通过以下几种方式获取 `XCharts`
如果你只是想运行 `Demo` 查看效果,可以在 [Github](https://github.com/monitor1394/unity-ugui-XCharts)上的 [Code](https://github.com/monitor1394/unity-ugui-XCharts)下载整个项目或去 [release](https://github.com/monitor1394/unity-ugui-XCharts/releases)下载稳定版本,将源码工程解压后用`unity`打开即可。如果访问Github不稳定的话可以从[国内镜像](https://gitee.com/monitor1394/unity-ugui-XCharts)下载。
如果你要将 `XCharts` 加入你的项目中,可以在[Github](https://github.com/monitor1394/unity-ugui-XCharts)上下载最新的 [release](https://github.com/monitor1394/unity-ugui-XCharts/releases)稳定版本,这里一般会包含`XCharts``XChartsDemo`两个`unitypackage`,将 `XCharts` 通过 `Unity` 导入到你的项目中,`XChartsDemo` 是示例`Demo`,可视情况导入。或下载 `Source Code` 解压后将内部的 `XCharts` 文件夹拷贝到你项目的 `Assets` 目录下。
如果你是`Unity 2018.3`及以上版本,可通过`Package Manager`来安装`XCharts`包,通过此方式导入的包只包含`XCharts`核心部分,不包含`XChartsDemo`示例`Demo`部分。具体操作步骤如下:
1. 打开`Packages`目录下的`manifest.json`文件,在`dependencies`下加入:
``` json
"com.monitor1394.xcharts": "https://github.com/monitor1394/unity-ugui-XCharts.git#2.0-upm",
```
2. 回到`Unity`可能会花3到5分钟进行下载和编译成功后就可以开始使用`XCharts`了。
3. 如果要删除`XCharts`删除掉1步骤所加的内容即可。
4. 如果要更新`XCharts`,删除`manifest.json`文件的`lock`下的`com.monitor1394.xcharts`相关内容即会重新下载编译。在 `Component -> XCharts -> Check For Update`可以检测是否有新版本可更新。
## 添加一个简单图表
在`Hierarchy`试图下右键或菜单栏`GameObject`下拉:`XCharts->LineChart`
![linechart](screenshot/op_addchart.png)
即可快速创建一个简单的折线图出来:
![linechart](screenshot/linechart.png)
在 `Inspector` 视图下可以调整各个组件的参数,`Game` 视图会实时反馈调整的效果。各个组件的详细参数说明可查阅[XCharts配置项手册](XCharts配置项手册.md)。
![inspcetor-desc](screenshot/inpsector-desc.png)
## 如何快速调整参数
* 首先要理解:`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`试图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的。你改了也会变还原。
* 快速定位你想要改的效果对应的组件。这就需要对组件有一定的了解。比如我们想要让X轴的轴线末端显示箭头第一步X轴定位到`XAxis0`,第二步轴线定位到`AxisLine`,然后我们再去看`AxisLine`有没有这样的参数可以实现这个效果。
* `XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色例,如果`SerieData`的`ItemStyle`配置有颜色值,则优先用这个颜色值。判断是否配置有颜色值就是`Color.clear`颜色的RGBA都是0
* `Serie`的`Data`点`More`按钮后可以单独设置数据项的更多设置,如柱形图的每个柱条单独设置颜色等。
![op_datamore](screenshot/op_datamore.png)
## 用代码添加折线图
给`gameObject`挂上`LineChart`脚本,需要调用`SetSize()`接口设置图表尺寸,或者直接操作`chart.rectTransfrom`
```C#
var chart = gameObject.GetComponent<LineChart>();
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
chart.SetSize(580, 300);//代码动态添加图表需要设置尺寸或直接操作chart.rectTransform
}
```
设置标题:
```C#
chart.GetChartComponent<Title>().show = true;
chart.GetChartComponent<Title>().text = "Line Simple";
```
设置提示框和图例是否显示:
```C#
chart.tooltip.show = true;
chart.legend.show = false;
```
设置是否使用双坐标轴和坐标轴类型:
```C#
xAxis.show = true;
chart.xAxes[1].show = false;
yAxis.show = true;
chart.yAxes[1].show = false;
xAxis.type = Axis.AxisType.Category;
yAxis.type = Axis.AxisType.Value;
```
设置坐标轴分割线:
```C#
xAxis.splitNumber = 10;
xAxis.boundaryGap = true;
```
清空数据,添加`Line`类型的`Serie`用于接收数据:
```C#
chart.RemoveData();
chart.AddSerie(SerieType.Line);
```
添加10个数据
```C#
for (int i = 0; i < 10; i++)
{
chart.AddXAxisData("x" + i);
chart.AddData(0, Random.Range(10, 20));
}
```
这样一个简单的折线图就出来了:
![linechart-simple](screenshot/linechart-simple.png)
如果一个Chart里面有多个系列时则Axis的data只需要加一次不要多个循环加重复了。记住Axis的数据个数要和Serie的数据个数一致。
完整代码请查阅`Examples``Example13_LineSimple.cs`
你还可以用代码控制更多的参数,`Examples`下还有更多的其他例子,凡是`Inspector`上看到的可配置的参数,都可以通过代码来设置。[XCharts配置项手册](XCharts配置项手册.md)里面的所有参数都是可以通过代码控制的。
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XChartsAPI.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
## 使用TextMeshPro
XCharts支持TextMeshPro但默认是不开启的需要自己手动切换。可通过一下两种方式开启和关闭
![textmeshpro1](screenshot/op_textmeshpro.png)
![textmeshpro2](screenshot/op_textmeshpro2.png)
开启后需要设置好TextMeshPro要用的全局字体也可以在主题Theme里单独设置
![textmeshpro-font](screenshot/op_textmeshpro3.png)
建议在项目初就规划好是否使用TextMeshPro在有很多图表的情况下再切换可能导致某些图表无法正常初始化这时可能需要每个图表单独的使用`Remove All Chart Object`来清理让图表重新初始化。
## 用代码改图表参数
`Inspector`上看到的所有参数都可以用代码来修改关键是要定位好你要改的参数是在组件上、还是serie上、还是在具体的数据项上改。
1. 改组件上的参数:
```C#
chart.GetChartComponent<Title>().text = "LineChart - 折线图";
chart.GetChartComponent<Title>().subText = "普通折线图";
chart.yAxis0.minMaxType = Axis.AxisMinMaxType.Custom;
chart.yAxis0.min = 0;
chart.yAxis0.max = 100;
```
2. 改Serie的参数
```C#
var serie = chart.AddSerie(SerieType.Gauge, "速度");
serie.min = 0;
serie.max = 220;
serie.startAngle = -125;
serie.endAngle = 125;
serie.center[0] = 0.5f;
serie.center[1] = 0.5f;
serie.radius[0] = 80;
serie.splitNumber = 5;
serie.animation.dataChangeEnable = true;
serie.roundCap = true;
```
3. 改数据项上的参数:
```C#
var serieData = chart.AddData(0, Random.Range(10, 20));
serieData.enableItemStyle = true;
serieData.itemStyle.color = Color.blue;
}
```
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[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)
[XCharts配置项手册](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts配置项手册.md)

Some files were not shown because too many files have changed in this diff Show More