整理组件结构

This commit is contained in:
monitor1394
2019-10-14 18:13:08 +08:00
parent 63ad7fc620
commit e753089787
34 changed files with 111 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ namespace XCharts
/// 直角坐标系的坐标轴组件。
/// </summary>
[System.Serializable]
public class Axis : JsonDataSupport, IEquatable<Axis>
public class Axis : MainComponent, IEquatable<Axis>
{
/// <summary>
/// the type of axis.

View File

@@ -10,7 +10,7 @@ namespace XCharts
/// <para>DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。</para>
/// </summary>
[System.Serializable]
public class DataZoom
public class DataZoom : MainComponent
{
/// <summary>
/// Generally dataZoom component zoom or roam coordinate system through data filtering

View File

@@ -15,7 +15,7 @@ namespace XCharts
/// </para>
/// </summary>
[Serializable]
public class Grid : IEquatable<Grid>
public class Grid : MainComponent, IEquatable<Grid>
{
[SerializeField] private bool m_Show = true;
[SerializeField] private float m_Left;

View File

@@ -11,7 +11,7 @@ namespace XCharts
/// 图例组件展现了不同系列的标记,颜色和名字。可以通过点击图例控制哪些系列不显示。
/// </summary>
[System.Serializable]
public class Legend : JsonDataSupport, IPropertyChanged, IEquatable<Legend>
public class Legend : MainComponent, IPropertyChanged, IEquatable<Legend>
{
/// <summary>
/// Selected mode of legend, which controls whether series can be toggled displaying by clicking legends.

View File

@@ -7,7 +7,7 @@ namespace XCharts
/// 饼图的全局设置。
/// </summary>
[System.Serializable]
public class Pie
public class Pie : MainComponent
{
[SerializeField] private float m_TooltipExtraRadius;
[SerializeField] private float m_SelectedOffset;

View File

@@ -11,7 +11,7 @@ namespace XCharts
/// 雷达图坐标系组件,只适用于雷达图。
/// </summary>
[System.Serializable]
public class Radar : JsonDataSupport, IEquatable<Radar>
public class Radar : MainComponent, IEquatable<Radar>
{
/// <summary>
/// Radar render type, in which 'Polygon' and 'Circle' are supported.
@@ -168,7 +168,7 @@ namespace XCharts
/// 雷达图的所有数据坐标点列表。
/// </summary>
/// <returns></returns>
public Dictionary<int,List<Vector3>> dataPosList = new Dictionary<int,List<Vector3>>();
public Dictionary<int, List<Vector3>> dataPosList = new Dictionary<int, List<Vector3>>();
public static Radar defaultRadar
{

View File

@@ -150,7 +150,7 @@ namespace XCharts
/// 系列。每个系列通过 type 决定自己的图表类型。
/// </summary>
[System.Serializable]
public class Serie : JsonDataSupport
public class Serie : MainComponent
{
[SerializeField] [DefaultValue("true")] private bool m_Show = true;
[SerializeField] private SerieType m_Type;

View File

@@ -9,7 +9,7 @@ namespace XCharts
/// 系列列表。每个系列通过 type 决定自己的图表类型。
/// </summary>
[System.Serializable]
public class Series : JsonDataSupport
public class Series : MainComponent
{
[SerializeField] protected List<Serie> m_Series;

View File

@@ -8,7 +8,7 @@ namespace XCharts
/// 全局参数设置组件。一般情况下可使用默认值,当有需要时可进行调整。
/// </summary>
[Serializable]
public class Settings
public class Settings : MainComponent
{
[SerializeField] [Range(1, 10)] protected float m_LineSmoothStyle = 3f;
[SerializeField] [Range(1f, 20)] protected float m_LineSmoothness = 2f;

View File

@@ -29,7 +29,7 @@ namespace XCharts
/// Theme.
/// 主题相关配置。
/// </summary>
public class ThemeInfo : IEquatable<ThemeInfo>
public class ThemeInfo : MainComponent, IEquatable<ThemeInfo>
{
[SerializeField] private Theme m_Theme = Theme.Default;
[SerializeField] private Font m_Font;

View File

@@ -8,7 +8,7 @@ namespace XCharts
/// 标题组件,包含主标题和副标题。
/// </summary>
[Serializable]
public class Title : IPropertyChanged, IEquatable<Title>
public class Title : MainComponent, IPropertyChanged, IEquatable<Title>
{
[SerializeField] private bool m_Show = true;
[SerializeField] private string m_Text;

View File

@@ -10,7 +10,7 @@ namespace XCharts
/// 提示框组件
/// </summary>
[System.Serializable]
public class Tooltip
public class Tooltip : MainComponent
{
/// <summary>
/// Indicator type.
@@ -157,8 +157,8 @@ namespace XCharts
var tooltip = new Tooltip
{
m_Show = true,
xValues = new float[2]{-1,-1},
yValues = new float[2]{-1,-1},
xValues = new float[2] { -1, -1 },
yValues = new float[2] { -1, -1 },
dataIndex = new List<int>() { -1, -1 },
lastDataIndex = new List<int>() { -1, -1 }
};

View File

@@ -10,7 +10,7 @@ namespace XCharts
/// 视觉映射组件。用于进行『视觉编码』,也就是将数据映射到视觉元素(视觉通道)。
/// </summary>
[System.Serializable]
public class VisualMap
public class VisualMap : MainComponent
{
/// <summary>
/// 类型。分为连续型和分段型。