2019-10-18 06:48:24 +08:00
|
|
|
|
using System;
|
2019-07-21 22:58:51 +08:00
|
|
|
|
using System.Collections.Generic;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
|
namespace XCharts.Runtime
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether to show as Nightingale chart, which distinguishs data through radius.
|
|
|
|
|
|
/// 是否展示成南丁格尔图,通过半径区分数据大小。
|
|
|
|
|
|
/// </summary>
|
2019-07-28 00:44:53 +08:00
|
|
|
|
public enum RoseType
|
2019-07-20 12:18:07 +08:00
|
|
|
|
{
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// Don't show as Nightingale chart.
|
|
|
|
|
|
/// |不展示成南丁格尔玫瑰图。
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// </summary>
|
2019-07-20 12:18:07 +08:00
|
|
|
|
None,
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Use central angle to show the percentage of data, radius to show data size.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |扇区圆心角展现数据的百分比,半径展现数据的大小。
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// </summary>
|
2019-07-28 00:44:53 +08:00
|
|
|
|
Radius,
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// All the sectors will share the same central angle, the data size is shown only through radiuses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |所有扇区圆心角相同,仅通过半径展现数据大小。
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// </summary>
|
2019-07-28 00:44:53 +08:00
|
|
|
|
Area
|
2019-07-14 14:34:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the type of line chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |折线图样式类型
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum LineType
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the normal line chart,
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// |普通折线图。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Normal,
|
|
|
|
|
|
/// <summary>
|
2019-10-01 09:36:24 +08:00
|
|
|
|
/// the smooth line chart,
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// |平滑曲线。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Smooth,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// step line.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |阶梯线图:当前点。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
StepStart,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// step line.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |阶梯线图:当前点和下一个点的中间。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
StepMiddle,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// step line.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |阶梯线图:下一个拐点。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
2021-12-08 08:31:32 +08:00
|
|
|
|
StepEnd
|
2019-08-15 21:44:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the type of bar. |柱状图类型。
|
|
|
|
|
|
/// </summary>
|
2019-10-18 06:48:24 +08:00
|
|
|
|
public enum BarType
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// normal bar.
|
|
|
|
|
|
/// |普通柱形图。
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Normal,
|
|
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// zebra bar.
|
|
|
|
|
|
/// |斑马柱形图。
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// </summary>
|
2019-10-18 07:41:23 +08:00
|
|
|
|
Zebra,
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// capsule bar.
|
|
|
|
|
|
/// |胶囊柱形图。
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Capsule
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-20 08:31:22 +08:00
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// the type of radar. |雷达图类型。
|
2020-03-20 08:31:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum RadarType
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// multiple radar.
|
|
|
|
|
|
/// |多圈雷达图。此时可一个雷达里绘制多个圈,一个serieData就可组成一个圈(多维数据)。
|
2020-03-20 08:31:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Multiple,
|
|
|
|
|
|
/// <summary>
|
2022-06-01 07:59:00 +08:00
|
|
|
|
/// single radar.
|
|
|
|
|
|
/// |单圈雷达图。此时一个雷达只能绘制一个圈,多个serieData组成一个圈,数据取自`data[1]`。
|
2020-03-20 08:31:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Single
|
|
|
|
|
|
}
|
2021-05-16 23:38:06 +08:00
|
|
|
|
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 采样类型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum SampleType
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Take a peak. When the average value of the filter point is greater than or equal to 'sampleAverage',
|
|
|
|
|
|
/// take the maximum value; If you do it the other way around, you get the minimum.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |取峰值。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Peak,
|
|
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Take the average of the filter points.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |取过滤点的平均值。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Average,
|
|
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Take the maximum value of the filter point.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |取过滤点的最大值。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Max,
|
|
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Take the minimum value of the filter point.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |取过滤点的最小值。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Min,
|
|
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Take the sum of the filter points.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |取过滤点的和。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Sum
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-29 22:07:09 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据排序方式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum SerieDataSortType
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按 data 的顺序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
None,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 升序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Ascending,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 降序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Descending,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 对齐方式
|
|
|
|
|
|
/// </summary>
|
2021-06-12 19:46:57 +08:00
|
|
|
|
public enum Align
|
2021-05-29 22:07:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
Center,
|
|
|
|
|
|
Left,
|
|
|
|
|
|
Right
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-25 07:46:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Serie state. Supports normal, emphasis, blur, and select states.
|
|
|
|
|
|
/// |Serie状态。支持正常、高亮、淡出、选中四种状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum SerieState
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Normal state.
|
|
|
|
|
|
/// |正常状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Normal,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Emphasis state.
|
|
|
|
|
|
/// |高亮状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Emphasis,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Blur state.
|
|
|
|
|
|
/// |淡出状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Blur,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Select state.
|
|
|
|
|
|
/// |选中状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Select,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Auto state.
|
|
|
|
|
|
/// |自动保持和父节点一致。一般用在SerieData。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Auto
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-28 07:21:46 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The policy to take color from theme.
|
|
|
|
|
|
/// |从主题中取色策略。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum SerieColorBy
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Select state.
|
|
|
|
|
|
/// |默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略,Pie默认是Data策略
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Default,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// assigns the colors in the palette by serie, so that all data in the same series are in the same color;.
|
|
|
|
|
|
/// |按照系列分配调色盘中的颜色,同一系列中的所有数据都是用相同的颜色。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Serie,
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// assigns colors in the palette according to data items, with each data item using a different color..
|
|
|
|
|
|
/// |按照数据项分配调色盘中的颜色,每个数据项都使用不同的颜色。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Data
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2021-12-09 07:12:15 +08:00
|
|
|
|
/// 系列。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2019-05-11 04:33:54 +08:00
|
|
|
|
[System.Serializable]
|
2021-12-28 08:18:24 +08:00
|
|
|
|
public partial class Serie : BaseSerie, IComparable
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[SerializeField] private int m_Index;
|
2020-02-13 09:23:30 +08:00
|
|
|
|
[SerializeField] private bool m_Show = true;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[SerializeField] private string m_CoordSystem = "GridCoord";
|
|
|
|
|
|
[SerializeField] private string m_SerieType = "";
|
|
|
|
|
|
[SerializeField] private string m_SerieName;
|
2022-07-25 07:46:03 +08:00
|
|
|
|
[SerializeField][Since("v3.2.0")] private SerieState m_State = SerieState.Normal;
|
2022-07-28 07:21:46 +08:00
|
|
|
|
[SerializeField][Since("v3.2.0")] private SerieColorBy m_ColorBy = SerieColorBy.Default;
|
2022-10-29 18:25:20 +08:00
|
|
|
|
[SerializeField][Since("v3.4.0")] private Color32 m_MarkColor;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
[SerializeField] private string m_Stack;
|
2021-01-11 08:54:28 +08:00
|
|
|
|
[SerializeField] private int m_XAxisIndex = 0;
|
|
|
|
|
|
[SerializeField] private int m_YAxisIndex = 0;
|
2019-08-04 15:24:31 +08:00
|
|
|
|
[SerializeField] private int m_RadarIndex = 0;
|
2020-07-06 08:41:28 +08:00
|
|
|
|
[SerializeField] private int m_VesselIndex = 0;
|
2021-01-11 08:54:28 +08:00
|
|
|
|
[SerializeField] private int m_PolarIndex = 0;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[SerializeField] private int m_SingleAxisIndex = 0;
|
|
|
|
|
|
[SerializeField] private int m_ParallelIndex = 0;
|
2019-09-29 07:37:53 +08:00
|
|
|
|
[SerializeField] protected int m_MinShow;
|
|
|
|
|
|
[SerializeField] protected int m_MaxShow;
|
|
|
|
|
|
[SerializeField] protected int m_MaxCache;
|
2019-10-18 06:48:24 +08:00
|
|
|
|
|
2019-09-29 08:43:49 +08:00
|
|
|
|
[SerializeField] private float m_SampleDist = 0;
|
2019-09-30 12:43:26 +08:00
|
|
|
|
[SerializeField] private SampleType m_SampleType = SampleType.Average;
|
|
|
|
|
|
[SerializeField] private float m_SampleAverage = 0;
|
|
|
|
|
|
|
2019-10-18 06:48:24 +08:00
|
|
|
|
[SerializeField] private LineType m_LineType = LineType.Normal;
|
2022-10-12 08:35:23 +08:00
|
|
|
|
[SerializeField][Since("v3.4.0")] private bool m_SmoothLimit = true;
|
2019-10-18 06:48:24 +08:00
|
|
|
|
[SerializeField] private BarType m_BarType = BarType.Normal;
|
|
|
|
|
|
[SerializeField] private bool m_BarPercentStack = false;
|
2022-05-22 22:17:38 +08:00
|
|
|
|
[SerializeField] private float m_BarWidth = 0;
|
2022-11-30 09:39:41 +08:00
|
|
|
|
[SerializeField][Since("v3.5.0")] private float m_BarMaxWidth = 0;
|
2022-05-22 22:17:38 +08:00
|
|
|
|
[SerializeField] private float m_BarGap = 0.1f;
|
2019-10-18 07:41:23 +08:00
|
|
|
|
[SerializeField] private float m_BarZebraWidth = 4f;
|
|
|
|
|
|
[SerializeField] private float m_BarZebraGap = 2f;
|
|
|
|
|
|
|
2019-11-30 21:24:04 +08:00
|
|
|
|
[SerializeField] private float m_Min;
|
|
|
|
|
|
[SerializeField] private float m_Max;
|
2021-05-29 22:07:09 +08:00
|
|
|
|
[SerializeField] private float m_MinSize = 0f;
|
|
|
|
|
|
[SerializeField] private float m_MaxSize = 1f;
|
2019-11-30 21:24:04 +08:00
|
|
|
|
[SerializeField] private float m_StartAngle;
|
|
|
|
|
|
[SerializeField] private float m_EndAngle;
|
2021-03-06 08:25:43 +08:00
|
|
|
|
[SerializeField] private float m_MinAngle;
|
2020-03-08 10:47:48 +08:00
|
|
|
|
[SerializeField] private bool m_Clockwise = true;
|
2020-03-06 07:09:15 +08:00
|
|
|
|
[SerializeField] private bool m_RoundCap;
|
2019-11-30 21:24:04 +08:00
|
|
|
|
[SerializeField] private int m_SplitNumber;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
[SerializeField] private bool m_ClickOffset = true;
|
|
|
|
|
|
[SerializeField] private RoseType m_RoseType = RoseType.None;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
[SerializeField] private float m_Gap;
|
2022-01-22 22:58:55 +08:00
|
|
|
|
[SerializeField] private float[] m_Center = new float[2] { 0.5f, 0.48f };
|
2022-05-22 22:17:38 +08:00
|
|
|
|
[SerializeField] private float[] m_Radius = new float[2] { 0, 0.28f };
|
2021-12-28 08:18:24 +08:00
|
|
|
|
|
2022-07-03 21:09:49 +08:00
|
|
|
|
[SerializeField][Range(2, 10)] private int m_ShowDataDimension;
|
2019-07-21 22:58:51 +08:00
|
|
|
|
[SerializeField] private bool m_ShowDataName;
|
2020-04-19 10:03:45 +08:00
|
|
|
|
[SerializeField] private bool m_Clip = false;
|
2020-03-10 12:35:19 +08:00
|
|
|
|
[SerializeField] private bool m_Ignore = false;
|
2021-07-08 07:19:31 +08:00
|
|
|
|
[SerializeField] private double m_IgnoreValue = 0;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[SerializeField] private bool m_IgnoreLineBreak = false;
|
2020-04-19 11:08:48 +08:00
|
|
|
|
[SerializeField] private bool m_ShowAsPositiveNumber = false;
|
2020-05-13 09:54:40 +08:00
|
|
|
|
[SerializeField] private bool m_Large = true;
|
|
|
|
|
|
[SerializeField] private int m_LargeThreshold = 200;
|
2020-06-16 09:33:34 +08:00
|
|
|
|
[SerializeField] private bool m_AvoidLabelOverlap = false;
|
2020-03-20 08:31:22 +08:00
|
|
|
|
[SerializeField] private RadarType m_RadarType = RadarType.Multiple;
|
2022-01-13 21:45:59 +08:00
|
|
|
|
[SerializeField] private bool m_PlaceHolder = false;
|
2021-05-29 22:07:09 +08:00
|
|
|
|
|
|
|
|
|
|
[SerializeField] private SerieDataSortType m_DataSortType = SerieDataSortType.Descending;
|
|
|
|
|
|
[SerializeField] private Orient m_Orient = Orient.Vertical;
|
2021-06-12 19:46:57 +08:00
|
|
|
|
[SerializeField] private Align m_Align = Align.Center;
|
2021-04-22 18:55:56 +08:00
|
|
|
|
[SerializeField] private float m_Left;
|
|
|
|
|
|
[SerializeField] private float m_Right;
|
|
|
|
|
|
[SerializeField] private float m_Top;
|
|
|
|
|
|
[SerializeField] private float m_Bottom;
|
2021-05-21 07:24:02 +08:00
|
|
|
|
[SerializeField] private bool m_InsertDataToHead;
|
2021-12-28 08:18:24 +08:00
|
|
|
|
|
|
|
|
|
|
[SerializeField] private LineStyle m_LineStyle = new LineStyle();
|
2022-05-04 08:45:19 +08:00
|
|
|
|
[SerializeField] private SerieSymbol m_Symbol = new SerieSymbol();
|
2021-12-28 08:18:24 +08:00
|
|
|
|
[SerializeField] private AnimationStyle m_Animation = new AnimationStyle();
|
|
|
|
|
|
[SerializeField] private ItemStyle m_ItemStyle = new ItemStyle();
|
2019-07-21 22:58:51 +08:00
|
|
|
|
[SerializeField] private List<SerieData> m_Data = new List<SerieData>();
|
2019-05-11 04:33:54 +08:00
|
|
|
|
|
2021-03-02 09:16:53 +08:00
|
|
|
|
[NonSerialized] internal int m_FilterStart;
|
|
|
|
|
|
[NonSerialized] internal int m_FilterEnd;
|
2021-07-08 07:19:31 +08:00
|
|
|
|
[NonSerialized] internal double m_FilterStartValue;
|
|
|
|
|
|
[NonSerialized] internal double m_FilterEndValue;
|
2021-03-02 09:16:53 +08:00
|
|
|
|
[NonSerialized] internal int m_FilterMinShow;
|
|
|
|
|
|
[NonSerialized] internal bool m_NeedUpdateFilterData;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
[NonSerialized] public List<SerieData> m_FilterData = new List<SerieData>();
|
2020-03-05 20:25:19 +08:00
|
|
|
|
[NonSerialized] private bool m_NameDirty;
|
2019-08-07 07:59:00 +08:00
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The index of serie.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列索引。
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int index { get { return m_Index; } internal set { m_Index = value; } }
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether to show serie in chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列是否显示在图表上。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool show
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Show; }
|
2021-11-23 13:20:07 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Show, value)) { SetVerticesDirty(); SetSerieNameDirty(); } }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the chart coord system of serie.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |使用的坐标系。
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string coordSystem
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_CoordSystem; }
|
|
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_CoordSystem, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// the type of serie.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列类型。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public string serieType
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
get { return m_SerieType; }
|
|
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_SerieType, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Series name used for displaying in tooltip and filtering with legend.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列名称,用于 tooltip 的显示,legend 的图例筛选。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public string serieName
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
get { return m_SerieName; }
|
|
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_SerieName, value)) { SetVerticesDirty(); SetSerieNameDirty(); } }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2020-07-25 14:09:57 +08:00
|
|
|
|
/// Legend name. When the serie name is not empty, the legend name is the series name; Otherwise, it is index.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |图例名称。当系列名称不为空时,图例名称即为系列名称;反之则为索引index。
|
2019-10-03 09:42:03 +08:00
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public string legendName { get { return string.IsNullOrEmpty(serieName) ? ChartCached.IntToStr(index) : serieName; } }
|
2019-10-03 09:42:03 +08:00
|
|
|
|
/// <summary>
|
2022-07-25 07:46:03 +08:00
|
|
|
|
/// The default state of a serie.
|
|
|
|
|
|
/// |系列的默认状态。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public SerieState state
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_State; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_State, value)) { SetAllDirty(); } }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2022-07-28 07:21:46 +08:00
|
|
|
|
/// The policy to take color from theme.
|
|
|
|
|
|
/// |从主题中取色的策略。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public SerieColorBy colorBy
|
|
|
|
|
|
{
|
|
|
|
|
|
//get { return m_ColorBy; }
|
|
|
|
|
|
get { return m_ColorBy == SerieColorBy.Default?defaultColorBy : m_ColorBy; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_ColorBy, value)) { SetAllDirty(); } }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2022-10-29 18:25:20 +08:00
|
|
|
|
/// Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
|
|
|
|
|
/// |Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Color32 markColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MarkColor; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MarkColor, value)) { SetAllDirty(); } }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public string stack
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Stack; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_Stack, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2021-01-11 08:54:28 +08:00
|
|
|
|
/// the index of XAxis.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |使用X轴的index。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2021-01-11 08:54:28 +08:00
|
|
|
|
public int xAxisIndex
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
2021-01-11 08:54:28 +08:00
|
|
|
|
get { return m_XAxisIndex; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_XAxisIndex, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the index of YAxis.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |使用Y轴的index。
|
2021-01-11 08:54:28 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int yAxisIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_YAxisIndex; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_YAxisIndex, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2019-08-04 15:24:31 +08:00
|
|
|
|
/// Index of radar component that radar chart uses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |雷达图所使用的 radar 组件的 index。
|
2019-08-04 15:24:31 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public int radarIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_RadarIndex; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_RadarIndex, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-04 15:24:31 +08:00
|
|
|
|
/// <summary>
|
2020-07-06 08:41:28 +08:00
|
|
|
|
/// Index of vesel component that liquid chart uses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |水位图所使用的 vessel 组件的 index。
|
2020-07-06 08:41:28 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int vesselIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_VesselIndex; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_VesselIndex, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Index of polar component that serie uses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |所使用的 polar 组件的 index。
|
2021-01-11 08:54:28 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int polarIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_PolarIndex; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_PolarIndex, value)) SetVerticesDirty(); }
|
2020-07-06 08:41:28 +08:00
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// <summary>s
|
|
|
|
|
|
/// Index of single axis component that serie uses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |所使用的 singleAxis 组件的 index。
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int singleAxisIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SingleAxisIndex; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SingleAxisIndex, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>s
|
|
|
|
|
|
/// Index of parallel coord component that serie uses.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |所使用的 parallel coord 组件的 index。
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int parallelIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_ParallelIndex; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_ParallelIndex, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
2020-07-06 08:41:28 +08:00
|
|
|
|
/// <summary>
|
2019-09-29 07:37:53 +08:00
|
|
|
|
/// The min number of data to show in chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列所显示数据的最小索引
|
2019-09-29 07:37:53 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int minShow
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MinShow; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MinShow, value < 0 ? 0 : value)) { SetVerticesDirty(); } }
|
2019-09-29 07:37:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The max number of data to show in chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列所显示数据的最大索引
|
2019-09-29 07:37:53 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int maxShow
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MaxShow; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MaxShow, value < 0 ? 0 : value)) { SetVerticesDirty(); } }
|
2019-09-29 07:37:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The max number of serie data cache.
|
2022-06-15 07:36:05 +08:00
|
|
|
|
/// The first data will be remove when the size of serie data is larger then maxCache.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |系列中可缓存的最大数据量。默认为0没有限制,大于0时超过指定值会移除旧数据再插入新数据。
|
2019-09-29 07:37:53 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int maxCache
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MaxCache; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MaxCache, value < 0 ? 0 : value)) { SetVerticesDirty(); } }
|
2019-09-29 07:37:53 +08:00
|
|
|
|
}
|
2021-12-28 08:18:24 +08:00
|
|
|
|
|
2019-08-04 15:24:31 +08:00
|
|
|
|
/// <summary>
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// the symbol of serie data item.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |标记的图形。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2022-05-04 08:45:19 +08:00
|
|
|
|
public SerieSymbol symbol
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
get { return m_Symbol; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_Symbol, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// The type of line chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |折线图样式类型。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public LineType lineType
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_LineType; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_LineType, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
2022-10-10 07:07:57 +08:00
|
|
|
|
/// Whether to restrict the curve. When true, the curve between two continuous data of the same value
|
|
|
|
|
|
/// is restricted to not exceed the data point, and is flat to the data point.
|
|
|
|
|
|
/// |是否限制曲线。当为true时,两个连续相同数值的数据间的曲线会限制为不超出数据点,和数据点是平直的。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool smoothLimit
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SmoothLimit; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SmoothLimit, value)) { SetVerticesDirty(); } }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-09-29 06:58:26 +08:00
|
|
|
|
/// the min pixel dist of sample.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |采样的最小像素距离,默认为0时不采样。当两个数据点间的水平距离小于改值时,开启采样,保证两点间的水平距离不小于改值。
|
2019-09-29 06:58:26 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float sampleDist
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SampleDist; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SampleDist, value < 0 ? 0 : value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-09-29 06:58:26 +08:00
|
|
|
|
/// <summary>
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// the type of sample.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |采样类型。当sampleDist大于0时有效。
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public SampleType sampleType
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SampleType; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SampleType, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设定的采样平均值。当sampleType 为 Peak 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为0时会实时计算所有数据的平均值。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float sampleAverage
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SampleAverage; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SampleAverage, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-09-30 12:43:26 +08:00
|
|
|
|
/// <summary>
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// The style of line.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |线条样式。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public LineStyle lineStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_LineStyle; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_LineStyle, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// 柱形图类型。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public BarType barType
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarType; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarType, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// <summary>
|
2019-10-18 07:41:23 +08:00
|
|
|
|
/// 柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool barPercentStack
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarPercentStack; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarPercentStack, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-10-18 06:48:24 +08:00
|
|
|
|
/// <summary>
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// The width of the bar. Adaptive when default 0.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float barWidth
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarWidth; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarWidth, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
2022-11-30 09:39:41 +08:00
|
|
|
|
/// The max width of the bar. Adaptive when default 0.
|
|
|
|
|
|
/// |柱条的最大宽度,默认为0为不限制最大宽度。支持设置成相对于类目宽度的百分比。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float barMaxWidth
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarMaxWidth; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarMaxWidth, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// The gap between bars between different series, is a percent value like '0.3f' , which means 30% of the bar width, can be set as a fixed value.
|
2022-06-15 07:36:05 +08:00
|
|
|
|
/// Set barGap as '-1' can overlap bars that belong to different series, which is useful when making a series of bar be background.
|
|
|
|
|
|
/// In a single coodinate system, this attribute is shared by multiple 'bar' series.
|
|
|
|
|
|
/// This attribute should be set on the last 'bar' series in the coodinate system,
|
|
|
|
|
|
/// then it will be adopted by all 'bar' series in the coordinate system.
|
|
|
|
|
|
/// |不同系列的柱间距离。为百分比(如 '0.3f',表示柱子宽度的 30%)
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// 如果想要两个系列的柱子重叠,可以设置 barGap 为 '-1f'。这在用柱子做背景的时候有用。
|
|
|
|
|
|
/// 在同一坐标系上,此属性会被多个 'bar' 系列共享。此属性应设置于此坐标系中最后一个 'bar' 系列上才会生效,并且是对此坐标系中所有 'bar' 系列生效。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float barGap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarGap; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarGap, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
2019-10-18 07:41:23 +08:00
|
|
|
|
/// 斑马线的粗细。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float barZebraWidth
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarZebraWidth; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarZebraWidth, value < 0 ? 0 : value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-10-18 07:41:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 斑马线的间距。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float barZebraGap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_BarZebraGap; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_BarZebraGap, value < 0 ? 0 : value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-10-18 07:41:23 +08:00
|
|
|
|
|
2019-08-15 21:44:30 +08:00
|
|
|
|
/// <summary>
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// Whether offset when mouse click pie chart item.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |鼠标点击时是否开启偏移,一般用在PieChart图表中。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool pieClickOffset
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_ClickOffset; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_ClickOffset, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether to show as Nightingale chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |是否展示成南丁格尔图,通过半径区分数据大小。
|
2019-07-29 08:01:39 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public RoseType pieRoseType
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_RoseType; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_RoseType, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2022-03-04 22:17:32 +08:00
|
|
|
|
/// gap of item.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |间距。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2021-04-22 18:55:56 +08:00
|
|
|
|
public float gap
|
|
|
|
|
|
{
|
2022-03-04 22:17:32 +08:00
|
|
|
|
get { return m_Gap; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Gap, value)) SetVerticesDirty(); }
|
2021-04-22 18:55:56 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// the center of chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |中心点。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float[] center
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Center; }
|
|
|
|
|
|
set { if (value != null && value.Length == 2) { m_Center = value; SetVerticesDirty(); } }
|
|
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the radius of chart.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |半径。radius[0]表示内径,radius[1]表示外径。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float[] radius
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Radius; }
|
|
|
|
|
|
set { if (value != null && value.Length == 2) { m_Radius = value; SetVerticesDirty(); } }
|
|
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2021-05-29 22:07:09 +08:00
|
|
|
|
/// 最小值。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float min
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Min; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Min, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2021-05-29 22:07:09 +08:00
|
|
|
|
/// 最大值。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float max
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Max; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Max, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2021-05-29 22:07:09 +08:00
|
|
|
|
/// 数据最小值 min 映射的宽度。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float minSize
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MinSize; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MinSize, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据最大值 max 映射的宽度。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float maxSize
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MaxSize; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MaxSize, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// 起始角度。和时钟一样,12点钟位置是0度,顺时针到360度。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float startAngle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_StartAngle; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_StartAngle, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 结束角度。和时钟一样,12点钟位置是0度,顺时针到360度。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float endAngle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_EndAngle; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_EndAngle, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2021-03-06 08:25:43 +08:00
|
|
|
|
/// The minimum angle of sector(0-360). It prevents some sector from being too small when value is small.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |最小的扇区角度(0-360)。用于防止某个值过小导致扇区太小影响交互。
|
2021-03-06 08:25:43 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float minAngle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_MinAngle; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_MinAngle, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// 是否顺时针。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool clockwise
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Clockwise; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Clockwise, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
/// 刻度分割段数。最大可设置36。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public int splitNumber
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_SplitNumber; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_SplitNumber, value > 36 ? 36 : value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2020-03-06 07:09:15 +08:00
|
|
|
|
/// 是否开启圆弧效果。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-06 07:09:15 +08:00
|
|
|
|
public bool roundCap
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
2020-03-06 07:09:15 +08:00
|
|
|
|
get { return m_RoundCap; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_RoundCap, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2020-03-10 12:35:19 +08:00
|
|
|
|
/// 是否开启忽略数据。当为 true 时,数据值为 ignoreValue 时不进行绘制。
|
2020-03-10 09:12:47 +08:00
|
|
|
|
/// </summary>
|
2020-03-10 12:35:19 +08:00
|
|
|
|
public bool ignore
|
2020-03-10 09:12:47 +08:00
|
|
|
|
{
|
2020-03-10 12:35:19 +08:00
|
|
|
|
get { return m_Ignore; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Ignore, value)) SetVerticesDirty(); }
|
2020-03-10 09:12:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2020-03-10 12:35:19 +08:00
|
|
|
|
/// 忽略数据的默认值。当ignore为true才有效。
|
2020-03-10 09:12:47 +08:00
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double ignoreValue
|
2020-03-10 09:12:47 +08:00
|
|
|
|
{
|
2020-03-10 12:35:19 +08:00
|
|
|
|
get { return m_IgnoreValue; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_IgnoreValue, value)) SetVerticesDirty(); }
|
2020-03-10 09:12:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// 忽略数据时折线是断开还是连接。默认false为连接。
|
2020-03-20 08:31:22 +08:00
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// <value></value>
|
|
|
|
|
|
public bool ignoreLineBreak
|
2020-03-20 08:31:22 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
get { return m_IgnoreLineBreak; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_IgnoreLineBreak, value)) SetVerticesDirty(); }
|
2020-03-20 08:31:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// 雷达图类型。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public RadarType radarType
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
get { return m_RadarType; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_RadarType, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
|
/// <summary>
|
2019-09-19 19:26:05 +08:00
|
|
|
|
/// The start animation.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |起始动画。
|
2019-09-19 19:26:05 +08:00
|
|
|
|
/// </summary>
|
2021-12-11 18:26:28 +08:00
|
|
|
|
public AnimationStyle animation
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
get { return m_Animation; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_Animation, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2019-10-14 07:45:56 +08:00
|
|
|
|
/// The style of data item.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |图形样式。
|
2019-10-14 07:45:56 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public ItemStyle itemStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_ItemStyle; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_ItemStyle, value, true)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-10-14 07:45:56 +08:00
|
|
|
|
/// <summary>
|
2019-12-04 09:44:59 +08:00
|
|
|
|
/// 数据项里的数据维数。
|
|
|
|
|
|
/// </summary>
|
2022-07-03 21:09:49 +08:00
|
|
|
|
public int showDataDimension { get { return m_ShowDataDimension; } set { m_ShowDataDimension = Mathf.Clamp(2, 10, value); } }
|
2019-09-19 19:26:05 +08:00
|
|
|
|
/// <summary>
|
2020-02-26 22:52:57 +08:00
|
|
|
|
/// 在Editor的inpsector上是否显示name参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool showDataName { get { return m_ShowDataName; } set { m_ShowDataName = value; } }
|
|
|
|
|
|
/// <summary>
|
2020-02-10 18:30:05 +08:00
|
|
|
|
/// If clip the overflow on the coordinate system.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |是否裁剪超出坐标系部分的图形。
|
2020-02-10 18:30:05 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool clip
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Clip; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Clip, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2020-02-10 18:30:05 +08:00
|
|
|
|
/// <summary>
|
2020-04-19 11:08:48 +08:00
|
|
|
|
/// Show negative number as positive number.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |将负数数值显示为正数。一般和`AxisLabel`的`showAsPositiveNumber`配合使用。仅在折线图和柱状图中有效。
|
2020-04-19 11:08:48 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool showAsPositiveNumber
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_ShowAsPositiveNumber; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_ShowAsPositiveNumber, value)) SetComponentDirty(); }
|
2020-04-19 11:08:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2020-05-13 09:54:40 +08:00
|
|
|
|
/// 是否开启大数据量优化,在数据图形特别多而出现卡顿时候可以开启。
|
|
|
|
|
|
/// 开启后配合 largeThreshold 在数据量大于指定阈值的时候对绘制进行优化。
|
|
|
|
|
|
/// 缺点:优化后不能自定义设置单个数据项的样式,不能显示Label。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool large
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Large; }
|
2022-03-04 22:17:32 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Large, value)) SetAllDirty(); }
|
2020-05-13 09:54:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2020-05-13 22:37:36 +08:00
|
|
|
|
/// 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
|
2020-05-13 09:54:40 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int largeThreshold
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_LargeThreshold; }
|
2022-03-04 22:17:32 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_LargeThreshold, value)) SetAllDirty(); }
|
2020-05-13 09:54:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2020-06-16 09:33:34 +08:00
|
|
|
|
/// 在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool avoidLabelOverlap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_AvoidLabelOverlap; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_AvoidLabelOverlap, value)) SetVerticesDirty(); }
|
2020-06-16 09:33:34 +08:00
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
|
|
2020-07-06 08:41:28 +08:00
|
|
|
|
/// <summary>
|
2021-04-22 18:55:56 +08:00
|
|
|
|
/// Distance between component and the left side of the container.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |组件离容器左侧的距离。
|
2021-04-22 18:55:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float left
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Left; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Left, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Distance between component and the right side of the container.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |组件离容器右侧的距离。
|
2021-04-22 18:55:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float right
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Right; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Right, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Distance between component and the top side of the container.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |组件离容器上侧的距离。
|
2021-04-22 18:55:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float top
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Top; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Top, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Distance between component and the bottom side of the container.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |组件离容器下侧的距离。
|
2021-04-22 18:55:56 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float bottom
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Bottom; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Bottom, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2021-05-21 07:24:02 +08:00
|
|
|
|
/// Whether to add new data at the head or at the end of the list.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |添加新数据时是在列表的头部还是尾部加入。
|
2021-05-21 07:24:02 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool insertDataToHead
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_InsertDataToHead; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_InsertDataToHead, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2021-05-29 22:07:09 +08:00
|
|
|
|
/// 组件的数据排序。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public SerieDataSortType dataSortType
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_DataSortType; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_DataSortType, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 组件的朝向。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Orient orient
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Orient; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Orient, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 组件水平方向对齐方式。
|
|
|
|
|
|
/// </summary>
|
2021-06-12 19:46:57 +08:00
|
|
|
|
public Align align
|
2021-05-29 22:07:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
get { return m_Align; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Align, value)) SetVerticesDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2022-01-13 21:45:59 +08:00
|
|
|
|
/// 占位模式。占位模式时,数据有效但不参与渲染和显示。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool placeHolder
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_PlaceHolder; }
|
|
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_PlaceHolder, value)) SetAllDirty(); }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// 系列中的数据内容数组。SerieData可以设置1到n维数据。
|
|
|
|
|
|
/// </summary>
|
2019-07-29 00:25:10 +08:00
|
|
|
|
public List<SerieData> data { get { return m_Data; } }
|
2022-07-28 07:21:46 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 取色策略是否为按数据项分配。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool colorByData { get { return colorBy == SerieColorBy.Data; } }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public override bool vertsDirty
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_VertsDirty ||
|
|
|
|
|
|
symbol.vertsDirty ||
|
|
|
|
|
|
lineStyle.vertsDirty ||
|
|
|
|
|
|
itemStyle.vertsDirty ||
|
2022-07-25 07:46:03 +08:00
|
|
|
|
IsVertsDirty(lineArrow) ||
|
|
|
|
|
|
IsVertsDirty(areaStyle) ||
|
|
|
|
|
|
IsVertsDirty(label) ||
|
|
|
|
|
|
IsVertsDirty(labelLine) ||
|
|
|
|
|
|
IsVertsDirty(titleStyle) ||
|
|
|
|
|
|
IsVertsDirty(emphasisStyle) ||
|
|
|
|
|
|
IsVertsDirty(blurStyle) ||
|
|
|
|
|
|
IsVertsDirty(selectStyle) ||
|
2022-04-27 08:26:05 +08:00
|
|
|
|
AnySerieDataVerticesDirty();
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-03-08 10:47:48 +08:00
|
|
|
|
|
2022-02-19 17:35:22 +08:00
|
|
|
|
public override bool componentDirty
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2022-05-22 22:17:38 +08:00
|
|
|
|
return m_ComponentDirty ||
|
|
|
|
|
|
symbol.componentDirty ||
|
2022-07-25 07:46:03 +08:00
|
|
|
|
IsComponentDirty(titleStyle) ||
|
|
|
|
|
|
IsComponentDirty(label) ||
|
|
|
|
|
|
IsComponentDirty(labelLine) ||
|
|
|
|
|
|
IsComponentDirty(emphasisStyle) ||
|
|
|
|
|
|
IsComponentDirty(blurStyle) ||
|
|
|
|
|
|
IsComponentDirty(selectStyle);
|
2022-02-19 17:35:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-05-16 23:38:06 +08:00
|
|
|
|
public override void ClearVerticesDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
base.ClearVerticesDirty();
|
2022-07-11 07:04:34 +08:00
|
|
|
|
if (!IsPerformanceMode())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
serieData.ClearVerticesDirty();
|
|
|
|
|
|
}
|
2020-03-05 20:25:19 +08:00
|
|
|
|
symbol.ClearVerticesDirty();
|
|
|
|
|
|
lineStyle.ClearVerticesDirty();
|
|
|
|
|
|
itemStyle.ClearVerticesDirty();
|
2022-07-25 07:46:03 +08:00
|
|
|
|
ClearVerticesDirty(areaStyle);
|
|
|
|
|
|
ClearVerticesDirty(label);
|
|
|
|
|
|
ClearVerticesDirty(emphasisStyle);
|
|
|
|
|
|
ClearVerticesDirty(blurStyle);
|
|
|
|
|
|
ClearVerticesDirty(selectStyle);
|
|
|
|
|
|
ClearVerticesDirty(lineArrow);
|
|
|
|
|
|
ClearVerticesDirty(titleStyle);
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-16 23:38:06 +08:00
|
|
|
|
public override void ClearComponentDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
base.ClearComponentDirty();
|
2022-07-11 07:04:34 +08:00
|
|
|
|
if (!IsPerformanceMode())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
serieData.ClearComponentDirty();
|
|
|
|
|
|
}
|
2020-03-05 20:25:19 +08:00
|
|
|
|
symbol.ClearComponentDirty();
|
|
|
|
|
|
lineStyle.ClearComponentDirty();
|
|
|
|
|
|
itemStyle.ClearComponentDirty();
|
2022-07-25 07:46:03 +08:00
|
|
|
|
ClearComponentDirty(areaStyle);
|
|
|
|
|
|
ClearComponentDirty(label);
|
|
|
|
|
|
ClearComponentDirty(emphasisStyle);
|
|
|
|
|
|
ClearComponentDirty(blurStyle);
|
|
|
|
|
|
ClearComponentDirty(selectStyle);
|
|
|
|
|
|
ClearComponentDirty(lineArrow);
|
|
|
|
|
|
ClearComponentDirty(titleStyle);
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2021-12-31 13:00:17 +08:00
|
|
|
|
|
|
|
|
|
|
public override void SetAllDirty()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.SetAllDirty();
|
|
|
|
|
|
labelDirty = true;
|
|
|
|
|
|
titleDirty = true;
|
|
|
|
|
|
}
|
2022-04-27 08:26:05 +08:00
|
|
|
|
|
|
|
|
|
|
private bool AnySerieDataVerticesDirty()
|
|
|
|
|
|
{
|
2022-07-11 07:04:34 +08:00
|
|
|
|
if (IsPerformanceMode())
|
|
|
|
|
|
return false;
|
2022-04-27 08:26:05 +08:00
|
|
|
|
if (this is ISimplifiedSerie)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
if (serieData.vertsDirty) return true;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool AnySerieDataComponentDirty()
|
|
|
|
|
|
{
|
2022-07-11 07:04:34 +08:00
|
|
|
|
if (IsPerformanceMode())
|
|
|
|
|
|
return false;
|
2022-04-27 08:26:05 +08:00
|
|
|
|
if (this is ISimplifiedSerie)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
if (serieData.componentDirty) return true;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2019-07-28 00:44:53 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether the serie is highlighted.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |该系列是否高亮,一般由图例悬停触发。
|
2019-07-28 00:44:53 +08:00
|
|
|
|
/// </summary>
|
2021-12-11 18:26:28 +08:00
|
|
|
|
public bool highlight { get; internal set; }
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// the count of data list.
|
2022-03-24 08:37:06 +08:00
|
|
|
|
/// |数据项个数。
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// </summary>
|
2019-07-28 00:44:53 +08:00
|
|
|
|
public int dataCount { get { return m_Data.Count; } }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public bool nameDirty { get { return m_NameDirty; } }
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public bool labelDirty { get; set; }
|
|
|
|
|
|
public bool titleDirty { get; set; }
|
2022-03-04 22:17:32 +08:00
|
|
|
|
public bool dataDirty { get; set; }
|
2019-05-11 04:33:54 +08:00
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
private void SetSerieNameDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
m_NameDirty = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public void ClearSerieNameDirty()
|
2020-03-05 20:25:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
m_NameDirty = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void ClearDirty()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.ClearDirty();
|
|
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度Y对应数据中最大值。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double yMax
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
var max = double.MinValue;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
foreach (var sdata in data)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2021-07-29 08:27:23 +08:00
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[1]) && sdata.data[1] > max)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
max = sdata.data[1];
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return max;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度X对应数据中的最大值。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double xMax
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
var max = double.MinValue;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
foreach (var sdata in data)
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
2021-07-29 08:27:23 +08:00
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[0]) && sdata.data[0] > max)
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
max = sdata.data[0];
|
2019-07-14 14:34:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return max;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度Y对应数据的最小值。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double yMin
|
2019-05-13 09:48:47 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
var min = double.MaxValue;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
foreach (var sdata in data)
|
2019-05-13 09:48:47 +08:00
|
|
|
|
{
|
2021-07-29 08:27:23 +08:00
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[1]) && sdata.data[1] < min)
|
2019-05-13 09:48:47 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
min = sdata.data[1];
|
2019-05-13 09:48:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return min;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度X对应数据的最小值。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double xMin
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
var min = double.MaxValue;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
foreach (var sdata in data)
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
2021-07-29 08:27:23 +08:00
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[0]) && sdata.data[0] < min)
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
min = sdata.data[0];
|
2019-07-14 14:34:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return min;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度Y数据的总和。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double yTotal
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
double total = 0;
|
2022-03-18 08:23:17 +08:00
|
|
|
|
if (IsPerformanceMode())
|
2019-07-14 14:34:18 +08:00
|
|
|
|
{
|
2022-03-18 08:23:17 +08:00
|
|
|
|
foreach (var sdata in data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
|
|
|
|
|
total += sdata.data[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var duration = animation.GetUpdateAnimationDuration();
|
2022-10-12 08:35:23 +08:00
|
|
|
|
var unscaledTime = animation.unscaledTime;
|
2022-03-18 08:23:17 +08:00
|
|
|
|
foreach (var sdata in data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
2022-10-12 08:35:23 +08:00
|
|
|
|
total += sdata.GetCurrData(1, duration, unscaledTime);
|
2022-03-18 08:23:17 +08:00
|
|
|
|
}
|
2019-07-14 14:34:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
return total;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 维度X数据的总和。
|
|
|
|
|
|
/// </summary>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double xTotal
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
double total = 0;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
foreach (var sdata in data)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2021-07-29 08:27:23 +08:00
|
|
|
|
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
2019-07-28 00:44:53 +08:00
|
|
|
|
total += sdata.data[0];
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
return total;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-04-27 08:26:05 +08:00
|
|
|
|
public void ResetInteract()
|
|
|
|
|
|
{
|
2022-05-22 22:17:38 +08:00
|
|
|
|
interact.Reset();
|
2022-04-27 08:26:05 +08:00
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
serieData.interact.Reset();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
2022-08-08 07:43:19 +08:00
|
|
|
|
/// 重置数据项索引。避免部分数据项的索引异常。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool ResetDataIndex()
|
|
|
|
|
|
{
|
|
|
|
|
|
var flag = false;
|
|
|
|
|
|
for (int i = 0; i < m_Data.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_Data[i].index != i)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_Data[i].index = i;
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return flag;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// 清空所有数据
|
|
|
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public override void ClearData()
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
|
while (m_Data.Count > 0)
|
2020-05-09 09:42:41 +08:00
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
|
RemoveData(0);
|
2020-05-09 09:42:41 +08:00
|
|
|
|
}
|
2019-07-21 22:58:51 +08:00
|
|
|
|
m_Data.Clear();
|
2021-08-16 14:47:02 +08:00
|
|
|
|
m_NeedUpdateFilterData = true;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
dataDirty = true;
|
2020-03-05 20:25:19 +08:00
|
|
|
|
SetVerticesDirty();
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移除指定索引的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
2019-05-11 04:33:54 +08:00
|
|
|
|
public void RemoveData(int index)
|
|
|
|
|
|
{
|
2020-03-05 20:25:19 +08:00
|
|
|
|
if (index >= 0 && index < m_Data.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(m_Data[index].name))
|
|
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
SetSerieNameDirty();
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
SetVerticesDirty();
|
2020-05-13 09:54:40 +08:00
|
|
|
|
var serieData = m_Data[index];
|
|
|
|
|
|
SerieDataPool.Release(serieData);
|
|
|
|
|
|
if (serieData.labelObject != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
SerieLabelPool.Release(serieData.labelObject.gameObject);
|
|
|
|
|
|
}
|
2020-03-05 20:25:19 +08:00
|
|
|
|
m_Data.RemoveAt(index);
|
2021-08-16 14:47:02 +08:00
|
|
|
|
m_NeedUpdateFilterData = true;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
labelDirty = true;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
dataDirty = true;
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加一个数据到维度Y(此时维度X对应的数据是索引)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
|
/// <param name="dataName"></param>
|
2022-03-04 22:17:32 +08:00
|
|
|
|
/// <param name="dataId">the unique id of data</param>
|
|
|
|
|
|
public SerieData AddYData(double value, string dataName = null, string dataId = null)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
|
CheckMaxCache();
|
2019-09-16 18:17:49 +08:00
|
|
|
|
int xValue = m_Data.Count;
|
2020-05-09 09:42:41 +08:00
|
|
|
|
var serieData = SerieDataPool.Get();
|
|
|
|
|
|
serieData.data.Add(xValue);
|
|
|
|
|
|
serieData.data.Add(value);
|
|
|
|
|
|
serieData.name = dataName;
|
2019-10-16 19:05:24 +08:00
|
|
|
|
serieData.index = xValue;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = dataId;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
AddSerieData(serieData);
|
2022-07-03 21:09:49 +08:00
|
|
|
|
m_ShowDataDimension = 2;
|
2020-03-05 20:25:19 +08:00
|
|
|
|
SetVerticesDirty();
|
2020-03-08 10:47:48 +08:00
|
|
|
|
CheckDataName(dataName);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
labelDirty = true;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
dataDirty = true;
|
2020-03-08 10:47:48 +08:00
|
|
|
|
return serieData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public void AddSerieData(SerieData serieData)
|
2021-05-21 07:24:02 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
if (m_InsertDataToHead)
|
|
|
|
|
|
m_Data.Insert(0, serieData);
|
|
|
|
|
|
else
|
|
|
|
|
|
m_Data.Add(serieData);
|
2022-03-04 22:17:32 +08:00
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
dataDirty = true;
|
2021-08-16 14:47:02 +08:00
|
|
|
|
m_NeedUpdateFilterData = true;
|
2021-05-21 07:24:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-08 10:47:48 +08:00
|
|
|
|
private void CheckDataName(string dataName)
|
|
|
|
|
|
{
|
2020-03-05 20:25:19 +08:00
|
|
|
|
if (string.IsNullOrEmpty(dataName))
|
2021-11-23 13:20:07 +08:00
|
|
|
|
SetSerieNameDirty();
|
2020-03-08 10:47:48 +08:00
|
|
|
|
else
|
|
|
|
|
|
m_ShowDataName = true;
|
2019-07-15 00:24:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加(x,y)数据到维度X和维度Y
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="xValue"></param>
|
|
|
|
|
|
/// <param name="yValue"></param>
|
|
|
|
|
|
/// <param name="dataName"></param>
|
2022-03-04 22:17:32 +08:00
|
|
|
|
/// <param name="dataId">the unique id of data</param>
|
|
|
|
|
|
public SerieData AddXYData(double xValue, double yValue, string dataName = null, string dataId = null)
|
2019-07-15 00:24:04 +08:00
|
|
|
|
{
|
2020-05-09 09:42:41 +08:00
|
|
|
|
CheckMaxCache();
|
|
|
|
|
|
var serieData = SerieDataPool.Get();
|
2021-03-25 12:55:52 +08:00
|
|
|
|
serieData.data.Clear();
|
2020-05-09 09:42:41 +08:00
|
|
|
|
serieData.data.Add(xValue);
|
|
|
|
|
|
serieData.data.Add(yValue);
|
|
|
|
|
|
serieData.name = dataName;
|
2019-10-16 19:05:24 +08:00
|
|
|
|
serieData.index = m_Data.Count;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = dataId;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
AddSerieData(serieData);
|
2019-12-03 07:49:37 +08:00
|
|
|
|
m_ShowDataDimension = 2;
|
2020-03-05 20:25:19 +08:00
|
|
|
|
SetVerticesDirty();
|
2020-03-08 10:47:48 +08:00
|
|
|
|
CheckDataName(dataName);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
labelDirty = true;
|
2019-10-16 06:34:26 +08:00
|
|
|
|
return serieData;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
2019-08-04 15:24:31 +08:00
|
|
|
|
|
2021-03-25 12:55:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加 (open, close, lowest, heighest) 数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="open"></param>
|
|
|
|
|
|
/// <param name="close"></param>
|
|
|
|
|
|
/// <param name="lowest"></param>
|
|
|
|
|
|
/// <param name="heighest"></param>
|
|
|
|
|
|
/// <param name="dataName"></param>
|
2022-03-04 22:17:32 +08:00
|
|
|
|
/// <param name="dataId">the unique id of data</param>
|
2021-03-25 12:55:52 +08:00
|
|
|
|
/// <returns></returns>
|
2022-08-26 23:17:54 +08:00
|
|
|
|
public SerieData AddData(double indexOrTimestamp, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)
|
2021-03-10 13:03:36 +08:00
|
|
|
|
{
|
|
|
|
|
|
CheckMaxCache();
|
|
|
|
|
|
var serieData = SerieDataPool.Get();
|
2021-03-25 12:55:52 +08:00
|
|
|
|
serieData.data.Clear();
|
2022-08-26 23:17:54 +08:00
|
|
|
|
serieData.data.Add(indexOrTimestamp);
|
2021-03-10 13:03:36 +08:00
|
|
|
|
serieData.data.Add(open);
|
|
|
|
|
|
serieData.data.Add(close);
|
|
|
|
|
|
serieData.data.Add(lowest);
|
|
|
|
|
|
serieData.data.Add(heighest);
|
|
|
|
|
|
serieData.name = dataName;
|
|
|
|
|
|
serieData.index = m_Data.Count;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = dataId;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
AddSerieData(serieData);
|
2022-08-26 23:17:54 +08:00
|
|
|
|
m_ShowDataDimension = 5;
|
2021-03-10 13:03:36 +08:00
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
CheckDataName(dataName);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
labelDirty = true;
|
2021-03-10 13:03:36 +08:00
|
|
|
|
return serieData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将一组数据添加到系列中。
|
|
|
|
|
|
/// 如果数据只有一个,默认添加到维度Y中。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="valueList"></param>
|
|
|
|
|
|
/// <param name="dataName"></param>
|
2022-03-04 22:17:32 +08:00
|
|
|
|
/// <param name="dataId">the unique id of data</param>
|
|
|
|
|
|
public SerieData AddData(List<double> valueList, string dataName = null, string dataId = null)
|
2019-07-25 09:42:00 +08:00
|
|
|
|
{
|
2019-10-16 06:34:26 +08:00
|
|
|
|
if (valueList == null || valueList.Count == 0) return null;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
if (valueList.Count == 1)
|
2022-03-04 22:17:32 +08:00
|
|
|
|
return AddYData(valueList[0], dataName, dataId);
|
2019-07-25 09:42:00 +08:00
|
|
|
|
else if (valueList.Count == 2)
|
2022-03-04 22:17:32 +08:00
|
|
|
|
return AddXYData(valueList[0], valueList[1], dataName, dataId);
|
2019-07-25 09:42:00 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2020-05-09 09:42:41 +08:00
|
|
|
|
CheckMaxCache();
|
2019-12-03 07:49:37 +08:00
|
|
|
|
m_ShowDataDimension = valueList.Count;
|
2020-05-09 09:42:41 +08:00
|
|
|
|
var serieData = SerieDataPool.Get();
|
2019-07-25 09:42:00 +08:00
|
|
|
|
serieData.name = dataName;
|
2019-10-16 19:05:24 +08:00
|
|
|
|
serieData.index = m_Data.Count;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = dataId;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
for (int i = 0; i < valueList.Count; i++)
|
|
|
|
|
|
{
|
2019-08-04 15:24:31 +08:00
|
|
|
|
serieData.data.Add(valueList[i]);
|
2019-07-25 09:42:00 +08:00
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
|
AddSerieData(serieData);
|
2020-03-05 20:25:19 +08:00
|
|
|
|
SetVerticesDirty();
|
2020-03-08 10:47:48 +08:00
|
|
|
|
CheckDataName(dataName);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
labelDirty = true;
|
2019-10-16 06:34:26 +08:00
|
|
|
|
return serieData;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-30 20:56:05 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加任意维数据到系列中。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="values">任意维数据</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public SerieData AddData(params double[] values)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (values == null || values.Length == 0) return null;
|
|
|
|
|
|
string dataName = null;
|
|
|
|
|
|
string dataId = null;
|
|
|
|
|
|
if (values.Length == 1)
|
|
|
|
|
|
return AddYData(values[0], dataName, dataId);
|
|
|
|
|
|
else if (values.Length == 2)
|
|
|
|
|
|
return AddXYData(values[0], values[1], dataName, dataId);
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
CheckMaxCache();
|
|
|
|
|
|
m_ShowDataDimension = values.Length;
|
|
|
|
|
|
var serieData = SerieDataPool.Get();
|
|
|
|
|
|
serieData.name = dataName;
|
|
|
|
|
|
serieData.index = m_Data.Count;
|
|
|
|
|
|
serieData.id = dataId;
|
|
|
|
|
|
for (int i = 0; i < values.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
serieData.data.Add(values[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
AddSerieData(serieData);
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
CheckDataName(dataName);
|
|
|
|
|
|
labelDirty = true;
|
|
|
|
|
|
return serieData;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-04 22:17:32 +08:00
|
|
|
|
public SerieData AddChildData(SerieData parent, double value, string name, string id)
|
2021-11-23 13:20:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
var serieData = new SerieData();
|
|
|
|
|
|
serieData.name = name;
|
|
|
|
|
|
serieData.index = m_Data.Count;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = id;
|
|
|
|
|
|
serieData.data = new List<double>() { m_Data.Count, value };
|
|
|
|
|
|
AddChildData(parent, serieData);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
return serieData;
|
|
|
|
|
|
}
|
2022-03-04 22:17:32 +08:00
|
|
|
|
|
|
|
|
|
|
public SerieData AddChildData(SerieData parent, List<double> value, string name, string id)
|
2021-11-23 13:20:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
var serieData = new SerieData();
|
|
|
|
|
|
serieData.name = name;
|
|
|
|
|
|
serieData.index = m_Data.Count;
|
2022-03-04 22:17:32 +08:00
|
|
|
|
serieData.id = id;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
serieData.data = new List<double>(value);
|
2022-03-04 22:17:32 +08:00
|
|
|
|
AddChildData(parent, serieData);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
return serieData;
|
|
|
|
|
|
}
|
2021-03-10 13:03:36 +08:00
|
|
|
|
|
2022-03-04 22:17:32 +08:00
|
|
|
|
public void AddChildData(SerieData parent, SerieData serieData)
|
|
|
|
|
|
{
|
|
|
|
|
|
serieData.parentId = parent.id;
|
|
|
|
|
|
serieData.context.parent = parent;
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_Data.Contains(serieData))
|
|
|
|
|
|
AddSerieData(serieData);
|
|
|
|
|
|
|
|
|
|
|
|
if (!parent.context.children.Contains(serieData))
|
|
|
|
|
|
{
|
|
|
|
|
|
parent.context.children.Add(serieData);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-09 09:42:41 +08:00
|
|
|
|
private void CheckMaxCache()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_MaxCache <= 0) return;
|
2021-06-18 06:48:11 +08:00
|
|
|
|
while (m_Data.Count >= m_MaxCache)
|
2020-05-09 09:42:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
m_NeedUpdateFilterData = true;
|
2021-05-21 07:24:02 +08:00
|
|
|
|
if (m_InsertDataToHead) RemoveData(m_Data.Count - 1);
|
|
|
|
|
|
else RemoveData(0);
|
2020-05-09 09:42:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-02 12:37:14 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得指定index指定维数的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="dimension"></param>
|
|
|
|
|
|
/// <param name="dataZoom"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double GetData(int index, int dimension, DataZoom dataZoom = null)
|
2020-06-02 12:37:14 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (index < 0 || dimension < 0) return 0;
|
|
|
|
|
|
var serieData = GetSerieData(index, dataZoom);
|
|
|
|
|
|
if (serieData != null && dimension < serieData.data.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
var value = serieData.GetData(dimension);
|
|
|
|
|
|
if (showAsPositiveNumber)
|
2021-07-08 07:19:31 +08:00
|
|
|
|
value = Math.Abs(value);
|
2020-06-02 12:37:14 +08:00
|
|
|
|
return value;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得维度Y索引对应的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="dataZoom"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double GetYData(int index, DataZoom dataZoom = null)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2019-07-25 09:42:00 +08:00
|
|
|
|
if (index < 0) return 0;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
var serieData = GetDataList(dataZoom);
|
|
|
|
|
|
if (index < serieData.Count)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2020-04-23 13:07:49 +08:00
|
|
|
|
var value = serieData[index].data[1];
|
|
|
|
|
|
if (showAsPositiveNumber)
|
2021-07-08 07:19:31 +08:00
|
|
|
|
value = Math.Abs(value);
|
2020-04-23 13:07:49 +08:00
|
|
|
|
return value;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
2019-07-28 00:44:53 +08:00
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public double GetYCurrData(int index, DataZoom dataZoom = null)
|
2019-11-30 21:24:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (index < 0) return 0;
|
|
|
|
|
|
var serieData = GetDataList(dataZoom);
|
|
|
|
|
|
if (index < serieData.Count)
|
|
|
|
|
|
{
|
2022-10-12 08:35:23 +08:00
|
|
|
|
var value = serieData[index].GetCurrData(1, animation.GetUpdateAnimationDuration(), animation.unscaledTime);
|
2020-04-23 13:07:49 +08:00
|
|
|
|
if (showAsPositiveNumber)
|
2021-07-08 07:19:31 +08:00
|
|
|
|
value = Math.Abs(value);
|
2020-04-23 13:07:49 +08:00
|
|
|
|
return value;
|
2019-11-30 21:24:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得维度Y索引对应的数据和数据名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index">索引</param>
|
|
|
|
|
|
/// <param name="yData">对应的数据值</param>
|
|
|
|
|
|
/// <param name="dataName">对应的数据名</param>
|
|
|
|
|
|
/// <param name="dataZoom">区域缩放</param>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public void GetYData(int index, out double yData, out string dataName, DataZoom dataZoom = null)
|
2019-07-28 00:44:53 +08:00
|
|
|
|
{
|
|
|
|
|
|
yData = 0;
|
|
|
|
|
|
dataName = null;
|
|
|
|
|
|
if (index < 0) return;
|
|
|
|
|
|
var serieData = GetDataList(dataZoom);
|
|
|
|
|
|
if (index < serieData.Count)
|
2019-07-25 09:42:00 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
yData = serieData[index].data[1];
|
2020-04-23 13:07:49 +08:00
|
|
|
|
if (showAsPositiveNumber)
|
2021-07-08 07:19:31 +08:00
|
|
|
|
yData = Math.Abs(yData);
|
2019-07-28 00:44:53 +08:00
|
|
|
|
dataName = serieData[index].name;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
}
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得指定索引的数据项
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="dataZoom"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2019-07-24 23:38:23 +08:00
|
|
|
|
public SerieData GetSerieData(int index, DataZoom dataZoom = null)
|
|
|
|
|
|
{
|
2019-07-22 19:02:28 +08:00
|
|
|
|
var data = GetDataList(dataZoom);
|
|
|
|
|
|
if (index >= 0 && index <= data.Count - 1)
|
|
|
|
|
|
return data[index];
|
2021-11-23 13:20:07 +08:00
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-04 22:17:32 +08:00
|
|
|
|
public SerieData GetSerieData(string id, DataZoom dataZoom = null)
|
2021-11-23 13:20:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
var data = GetDataList(dataZoom);
|
|
|
|
|
|
foreach (var serieData in data)
|
|
|
|
|
|
{
|
2022-03-04 22:17:32 +08:00
|
|
|
|
var target = GetSerieData(serieData, id);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
if (target != null) return target;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-04 22:17:32 +08:00
|
|
|
|
public SerieData GetSerieData(SerieData parent, string id)
|
2021-11-23 13:20:07 +08:00
|
|
|
|
{
|
2022-03-04 22:17:32 +08:00
|
|
|
|
if (id.Equals(parent.id)) return parent;
|
|
|
|
|
|
foreach (var child in parent.context.children)
|
2021-11-23 13:20:07 +08:00
|
|
|
|
{
|
2022-03-04 22:17:32 +08:00
|
|
|
|
var data = GetSerieData(child, id);
|
2021-11-23 13:20:07 +08:00
|
|
|
|
if (data != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return data;
|
|
|
|
|
|
}
|
2019-07-22 19:02:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得指定索引的维度X和维度Y的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="dataZoom"></param>
|
|
|
|
|
|
/// <param name="xValue"></param>
|
|
|
|
|
|
/// <param name="yVlaue"></param>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public void GetXYData(int index, DataZoom dataZoom, out double xValue, out double yVlaue)
|
2019-07-15 00:24:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
xValue = 0;
|
|
|
|
|
|
yVlaue = 0;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
if (index < 0) return;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
var showData = GetDataList(dataZoom);
|
|
|
|
|
|
if (index < showData.Count)
|
2019-07-25 09:42:00 +08:00
|
|
|
|
{
|
2019-07-28 00:44:53 +08:00
|
|
|
|
var serieData = showData[index];
|
|
|
|
|
|
xValue = serieData.data[0];
|
|
|
|
|
|
yVlaue = serieData.data[1];
|
2020-04-19 11:08:48 +08:00
|
|
|
|
if (showAsPositiveNumber)
|
|
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
xValue = Math.Abs(xValue);
|
|
|
|
|
|
yVlaue = Math.Abs(yVlaue);
|
2020-04-19 11:08:48 +08:00
|
|
|
|
}
|
2019-07-25 09:42:00 +08:00
|
|
|
|
}
|
2019-07-15 00:24:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-05-01 10:54:14 +08:00
|
|
|
|
public virtual double GetDataTotal(int dimension, SerieData serieData = null)
|
2020-06-07 07:16:24 +08:00
|
|
|
|
{
|
2022-01-22 22:58:55 +08:00
|
|
|
|
if (m_Max > 0) return m_Max;
|
|
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
double total = 0;
|
2020-06-07 07:16:24 +08:00
|
|
|
|
foreach (var sdata in data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sdata.show)
|
|
|
|
|
|
total += sdata.GetData(dimension);
|
|
|
|
|
|
}
|
|
|
|
|
|
return total;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得系列的数据列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="dataZoom"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2019-10-14 07:45:56 +08:00
|
|
|
|
public List<SerieData> GetDataList(DataZoom dataZoom = null)
|
2019-07-21 22:58:51 +08:00
|
|
|
|
{
|
2022-05-22 22:17:38 +08:00
|
|
|
|
if (dataZoom != null && dataZoom.enable &&
|
|
|
|
|
|
(dataZoom.IsContainsXAxis(xAxisIndex) || dataZoom.IsContainsYAxis(yAxisIndex)))
|
2019-07-21 22:58:51 +08:00
|
|
|
|
{
|
2021-03-02 09:16:53 +08:00
|
|
|
|
SerieHelper.UpdateFilterData(this, dataZoom);
|
2019-08-07 07:59:00 +08:00
|
|
|
|
return m_FilterData;
|
2019-07-21 22:58:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2022-04-09 11:03:41 +08:00
|
|
|
|
return useSortData && context.sortedData.Count > 0 ? context.sortedData : m_Data;
|
2019-07-21 22:58:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新指定索引的维度Y数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="value"></param>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public bool UpdateYData(int index, double value)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2019-08-13 10:20:15 +08:00
|
|
|
|
UpdateData(index, 1, value);
|
2019-12-04 09:44:59 +08:00
|
|
|
|
return true;
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新指定索引的维度X和维度Y的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="xValue"></param>
|
|
|
|
|
|
/// <param name="yValue"></param>
|
2019-12-04 09:44:59 +08:00
|
|
|
|
public bool UpdateXYData(int index, float xValue, float yValue)
|
2019-07-15 00:24:04 +08:00
|
|
|
|
{
|
2019-12-04 09:44:59 +08:00
|
|
|
|
var flag1 = UpdateData(index, 0, xValue);
|
|
|
|
|
|
var flag2 = UpdateData(index, 1, yValue);
|
|
|
|
|
|
return flag1 || flag2;
|
2019-07-25 09:42:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新指定索引指定维数的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index">要更新数据的索引</param>
|
|
|
|
|
|
/// <param name="dimension">要更新数据的维数</param>
|
|
|
|
|
|
/// <param name="value">新的数据值</param>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public bool UpdateData(int index, int dimension, double value)
|
2019-07-25 09:42:00 +08:00
|
|
|
|
{
|
2019-12-04 09:44:59 +08:00
|
|
|
|
if (index >= 0 && index < m_Data.Count)
|
|
|
|
|
|
{
|
2020-12-18 19:06:34 +08:00
|
|
|
|
var animationOpen = animation.enable;
|
|
|
|
|
|
var animationDuration = animation.GetUpdateAnimationDuration();
|
2022-10-12 08:35:23 +08:00
|
|
|
|
var unscaledTime = animation.unscaledTime;
|
|
|
|
|
|
var flag = m_Data[index].UpdateData(dimension, value, animationOpen, unscaledTime, animationDuration);
|
2022-03-04 22:17:32 +08:00
|
|
|
|
if (flag)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
dataDirty = true;
|
|
|
|
|
|
}
|
2020-03-05 20:25:19 +08:00
|
|
|
|
return flag;
|
2019-12-04 09:44:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新指定索引的数据项数据列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="index"></param>
|
|
|
|
|
|
/// <param name="values"></param>
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public bool UpdateData(int index, List<double> values)
|
2019-12-04 09:44:59 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (index >= 0 && index < m_Data.Count && values != null)
|
2019-07-15 00:24:04 +08:00
|
|
|
|
{
|
2019-12-20 09:17:15 +08:00
|
|
|
|
var serieData = m_Data[index];
|
2020-12-18 19:06:34 +08:00
|
|
|
|
var animationOpen = animation.enable;
|
|
|
|
|
|
var animationDuration = animation.GetUpdateAnimationDuration();
|
2022-10-12 08:35:23 +08:00
|
|
|
|
var unscaledTime = animation.unscaledTime;
|
2019-12-20 09:17:15 +08:00
|
|
|
|
for (int i = 0; i < values.Count; i++)
|
2022-10-12 08:35:23 +08:00
|
|
|
|
serieData.UpdateData(i, values[i], animationOpen, unscaledTime, animationDuration);
|
2020-03-05 20:25:19 +08:00
|
|
|
|
SetVerticesDirty();
|
2022-03-04 22:17:32 +08:00
|
|
|
|
dataDirty = true;
|
2019-12-04 09:44:59 +08:00
|
|
|
|
return true;
|
2019-07-15 00:24:04 +08:00
|
|
|
|
}
|
2019-12-04 09:44:59 +08:00
|
|
|
|
return false;
|
2019-07-15 00:24:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-12-04 09:44:59 +08:00
|
|
|
|
public bool UpdateDataName(int index, string name)
|
2019-08-14 08:52:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (index >= 0 && index < m_Data.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
var serieData = m_Data[index];
|
|
|
|
|
|
serieData.name = name;
|
2021-11-23 13:20:07 +08:00
|
|
|
|
SetSerieNameDirty();
|
2020-05-13 09:54:40 +08:00
|
|
|
|
if (serieData.labelObject != null)
|
2019-08-14 08:52:28 +08:00
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
|
serieData.labelObject.SetText(name == null ? "" : name);
|
2019-08-14 08:52:28 +08:00
|
|
|
|
}
|
2019-12-04 09:44:59 +08:00
|
|
|
|
return true;
|
2019-08-14 08:52:28 +08:00
|
|
|
|
}
|
2019-12-04 09:44:59 +08:00
|
|
|
|
return false;
|
2019-08-14 08:52:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清除所有数据的高亮标志
|
|
|
|
|
|
/// </summary>
|
2019-07-28 00:44:53 +08:00
|
|
|
|
public void ClearHighlight()
|
|
|
|
|
|
{
|
2021-12-11 18:26:28 +08:00
|
|
|
|
highlight = false;
|
2020-07-07 06:53:02 +08:00
|
|
|
|
foreach (var serieData in m_Data)
|
2021-12-11 18:26:28 +08:00
|
|
|
|
serieData.context.highlight = false;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-01 23:49:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置指定索引的数据为高亮状态
|
|
|
|
|
|
/// </summary>
|
2020-07-07 06:53:02 +08:00
|
|
|
|
public void SetHighlight(int index, bool flag)
|
2019-07-28 00:44:53 +08:00
|
|
|
|
{
|
2020-07-07 06:53:02 +08:00
|
|
|
|
var serieData = GetSerieData(index);
|
|
|
|
|
|
if (serieData != null)
|
2021-12-11 18:26:28 +08:00
|
|
|
|
serieData.context.highlight = flag;
|
2019-07-28 00:44:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-05-22 22:17:38 +08:00
|
|
|
|
public float GetBarWidth(float categoryWidth, int barCount = 0)
|
2019-08-15 21:44:30 +08:00
|
|
|
|
{
|
2022-11-30 09:39:41 +08:00
|
|
|
|
var realWidth = 0f;
|
|
|
|
|
|
if (categoryWidth < 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
realWidth = categoryWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (m_BarWidth == 0)
|
2022-05-22 22:17:38 +08:00
|
|
|
|
{
|
|
|
|
|
|
var width = ChartHelper.GetActualValue(0.6f, categoryWidth);
|
|
|
|
|
|
if (barCount == 0)
|
2022-11-30 09:39:41 +08:00
|
|
|
|
realWidth = width < 1 ? categoryWidth : width;
|
2022-05-22 22:17:38 +08:00
|
|
|
|
else
|
2022-11-30 09:39:41 +08:00
|
|
|
|
realWidth = width / barCount;
|
2022-05-22 22:17:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
2022-11-30 09:39:41 +08:00
|
|
|
|
{
|
|
|
|
|
|
realWidth = ChartHelper.GetActualValue(m_BarWidth, categoryWidth);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m_BarMaxWidth == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return realWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var maxWidth = ChartHelper.GetActualValue(m_BarMaxWidth, categoryWidth);
|
|
|
|
|
|
return realWidth > maxWidth ? maxWidth : realWidth;
|
|
|
|
|
|
}
|
2019-08-15 21:44:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-28 19:28:05 +08:00
|
|
|
|
public bool IsIgnoreIndex(int index, int dimension = 1)
|
2020-03-21 22:01:47 +08:00
|
|
|
|
{
|
2021-04-28 19:28:05 +08:00
|
|
|
|
var serieData = GetSerieData(index);
|
|
|
|
|
|
if (serieData != null)
|
|
|
|
|
|
return IsIgnoreValue(serieData, dimension);
|
2020-03-21 22:01:47 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-28 19:28:05 +08:00
|
|
|
|
public bool IsIgnoreValue(SerieData serieData, int dimension = 1)
|
|
|
|
|
|
{
|
2022-05-22 22:17:38 +08:00
|
|
|
|
return serieData.ignore || IsIgnoreValue(serieData.GetData(dimension));
|
2021-04-28 19:28:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-08 07:19:31 +08:00
|
|
|
|
public bool IsIgnoreValue(double value)
|
2020-03-10 09:12:47 +08:00
|
|
|
|
{
|
2021-07-08 07:19:31 +08:00
|
|
|
|
return m_Ignore && MathUtil.Approximately(value, m_IgnoreValue);
|
2020-03-10 09:12:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-21 22:01:47 +08:00
|
|
|
|
public bool IsIgnorePoint(int index)
|
2020-03-11 08:41:42 +08:00
|
|
|
|
{
|
2021-12-08 13:36:02 +08:00
|
|
|
|
if (index >= 0 && index < dataCount)
|
2020-03-11 08:41:42 +08:00
|
|
|
|
{
|
2021-12-09 07:12:15 +08:00
|
|
|
|
return ChartHelper.IsIngore(data[index].context.position);
|
2020-03-11 08:41:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public bool IsSerie<T>() where T : Serie
|
|
|
|
|
|
{
|
|
|
|
|
|
return this is T;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsUseCoord<T>() where T : CoordSystem
|
|
|
|
|
|
{
|
|
|
|
|
|
return ChartCached.GetTypeName<T>().Equals(m_CoordSystem);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetCoord<T>() where T : CoordSystem
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GetType().IsDefined(typeof(CoordOptionsAttribute), false))
|
|
|
|
|
|
{
|
|
|
|
|
|
var attribute = GetType().GetAttribute<CoordOptionsAttribute>();
|
|
|
|
|
|
if (attribute.Contains<T>())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_CoordSystem = typeof(T).Name;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Debug.LogError("not support coord system:" + typeof(T));
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-13 09:54:40 +08:00
|
|
|
|
/// <summary>
|
2022-03-18 08:23:17 +08:00
|
|
|
|
/// 是否为性能模式。性能模式下不绘制Symbol,不刷新Label,不单独设置数据项配置。
|
2020-05-13 09:54:40 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsPerformanceMode()
|
|
|
|
|
|
{
|
2022-07-11 07:04:34 +08:00
|
|
|
|
return m_Large && m_Data.Count >= m_LargeThreshold;
|
2020-05-13 09:54:40 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
|
2021-12-24 07:38:10 +08:00
|
|
|
|
public bool IsLegendName(string legendName)
|
|
|
|
|
|
{
|
2022-07-28 07:21:46 +08:00
|
|
|
|
if (colorBy == SerieColorBy.Data)
|
2021-12-24 07:38:10 +08:00
|
|
|
|
{
|
2022-01-22 21:08:26 +08:00
|
|
|
|
return IsSerieDataLegendName(legendName) || IsSerieLegendName(legendName);
|
2021-12-24 07:38:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return IsSerieLegendName(legendName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsSerieLegendName(string legendName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return legendName.Equals(this.legendName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsSerieDataLegendName(string legendName)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var serieData in m_Data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (legendName.Equals(serieData.legendName))
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-09-24 18:47:43 +08:00
|
|
|
|
/// <summary>
|
2021-07-15 21:18:23 +08:00
|
|
|
|
/// 启用或取消初始动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationEnable(bool flag)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.enable = flag;
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 渐入动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationFadeIn()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.FadeIn();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 渐出动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationFadeOut()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.FadeOut();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 暂停动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationPause()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.Pause();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 继续动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationResume()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.Resume();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重置动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationReset()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.Reset();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
|
|
2021-07-15 21:18:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重置动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void AnimationRestart()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (animation.enable) animation.Restart();
|
|
|
|
|
|
SetVerticesDirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-23 13:20:07 +08:00
|
|
|
|
public int CompareTo(object obj)
|
2019-05-11 04:33:54 +08:00
|
|
|
|
{
|
2021-11-23 13:20:07 +08:00
|
|
|
|
return index.CompareTo((obj as Serie).index);
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
2021-12-09 21:35:23 +08:00
|
|
|
|
|
|
|
|
|
|
public T Clone<T>() where T : Serie
|
|
|
|
|
|
{
|
|
|
|
|
|
var newSerie = Activator.CreateInstance<T>();
|
|
|
|
|
|
SerieHelper.CopySerie(this, newSerie);
|
|
|
|
|
|
return newSerie;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Serie Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
var newSerie = Activator.CreateInstance(GetType()) as Serie;
|
|
|
|
|
|
SerieHelper.CopySerie(this, newSerie);
|
|
|
|
|
|
return newSerie;
|
|
|
|
|
|
}
|
2019-05-11 04:33:54 +08:00
|
|
|
|
}
|
2022-05-22 22:17:38 +08:00
|
|
|
|
}
|