mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 01:10:08 +00:00
增加运行时和非运行时参数变更自动刷新图表
This commit is contained in:
@@ -52,41 +52,73 @@ namespace XCharts
|
||||
/// Set this to false to prevent the areafrom showing.
|
||||
/// 是否显示区域填充。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the origin of area.
|
||||
/// 区域填充的起始位置。
|
||||
/// </summary>
|
||||
public AreaOrigin origin { get { return m_Origin; } set { m_Origin = value; } }
|
||||
public AreaOrigin origin
|
||||
{
|
||||
get { return m_Origin; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Origin, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of area,default use serie color.
|
||||
/// 区域填充的颜色,如果toColor不是默认值,则表示渐变色的起点颜色。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gradient color, start color to toColor.
|
||||
/// 渐变色的终点颜色。
|
||||
/// </summary>
|
||||
public Color toColor { get { return m_ToColor; } set { m_ToColor = value; } }
|
||||
public Color toColor
|
||||
{
|
||||
get { return m_ToColor; }
|
||||
set { if (PropertyUtility.SetColor(ref m_ToColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0.
|
||||
/// 图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
||||
/// </summary>
|
||||
public float opacity { get { return m_Opacity; } set { m_Opacity = value; } }
|
||||
public float opacity
|
||||
{
|
||||
get { return m_Opacity; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 鼠标悬浮时是否高亮之前的区域
|
||||
/// </summary>
|
||||
public bool tooltipHighlight { get { return m_TooltipHighlight; } set { m_TooltipHighlight = value; } }
|
||||
public bool tooltipHighlight
|
||||
{
|
||||
get { return m_TooltipHighlight; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_TooltipHighlight, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of area,default use serie color.
|
||||
/// 高亮时区域填充的颜色,如果highlightToColor不是默认值,则表示渐变色的起点颜色。
|
||||
/// </summary>
|
||||
public Color highlightColor { get { return m_HighlightColor; } set { m_HighlightColor = value; } }
|
||||
public Color highlightColor
|
||||
{
|
||||
get { return m_HighlightColor; }
|
||||
set { if (PropertyUtility.SetColor(ref m_HighlightColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gradient color, start highlightColor to highlightToColor.
|
||||
/// 高亮时渐变色的终点颜色。
|
||||
/// </summary>
|
||||
public Color highlightToColor { get { return m_HighlightToColor; } set { m_HighlightToColor = value; } }
|
||||
public Color highlightToColor
|
||||
{
|
||||
get { return m_HighlightToColor; }
|
||||
set { if (PropertyUtility.SetColor(ref m_HighlightToColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public static AreaStyle defaultAreaStyle
|
||||
{
|
||||
|
||||
@@ -34,55 +34,106 @@ namespace XCharts
|
||||
/// Set this to false to prevent the axis label from appearing.
|
||||
/// 是否显示刻度标签。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The display interval of the axis label.
|
||||
/// 坐标轴刻度标签的显示间隔,在类目轴中有效。0表示显示所有标签,1表示隔一个隔显示一个标签,以此类推。
|
||||
/// </summary>
|
||||
public int interval { get { return m_Interval; } set { m_Interval = value; } }
|
||||
public int interval
|
||||
{
|
||||
get { return m_Interval; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Interval, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Set this to true so the axis labels face the inside direction.
|
||||
/// 刻度标签是否朝内,默认朝外。
|
||||
/// </summary>
|
||||
public bool inside { get { return m_Inside; } set { m_Inside = value; } }
|
||||
public bool inside
|
||||
{
|
||||
get { return m_Inside; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Inside, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Rotation degree of axis label, which is especially useful when there is no enough space for category axis.
|
||||
/// 刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。
|
||||
/// </summary>
|
||||
public float rotate { get { return m_Rotate; } set { m_Rotate = value; } }
|
||||
public float rotate
|
||||
{
|
||||
get { return m_Rotate; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The margin between the axis label and the axis line.
|
||||
/// 刻度标签与轴线之间的距离。
|
||||
/// </summary>
|
||||
public float margin { get { return m_Margin; } set { m_Margin = value; } }
|
||||
public float margin
|
||||
{
|
||||
get { return m_Margin; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Margin, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of axis label text.
|
||||
/// 刻度标签文字的颜色,默认取Theme的axisTextColor。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font size.
|
||||
/// 文字的字体大小。
|
||||
/// </summary>
|
||||
public int fontSize { get { return m_FontSize; } set { m_FontSize = value; } }
|
||||
public int fontSize
|
||||
{
|
||||
get { return m_FontSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontSize, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font style.
|
||||
/// 文字字体的风格。
|
||||
/// </summary>
|
||||
public FontStyle fontStyle { get { return m_FontStyle; } set { m_FontStyle = value; } }
|
||||
public FontStyle fontStyle
|
||||
{
|
||||
get { return m_FontStyle; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontStyle, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 图例内容字符串模版格式器。支持用 \n 换行。
|
||||
/// 模板变量为图例名称 {value},支持{value:f0},{value:f1},{value:f2}
|
||||
/// </summary>
|
||||
public string formatter { get { return m_Formatter; } set { m_Formatter = value; } }
|
||||
public string formatter
|
||||
{
|
||||
get { return m_Formatter; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Formatter, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否强制使用科学计数法格式化显示数值。默认为false,当小数精度大于3时才采用科学计数法。
|
||||
/// </summary>
|
||||
public bool forceENotation { get { return m_ForceENotation; } set { m_ForceENotation = value; } }
|
||||
public bool forceENotation
|
||||
{
|
||||
get { return m_ForceENotation; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_ForceENotation, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 文本限制。
|
||||
/// </summary>
|
||||
public TextLimit textLimit { get { return m_TextLimit; } }
|
||||
public TextLimit textLimit
|
||||
{
|
||||
get { return m_TextLimit; }
|
||||
set { if (value != null) { m_TextLimit = value; SetComponentDirty(); } }
|
||||
}
|
||||
|
||||
public override bool componentDirty { get { return m_ComponentDirty || m_TextLimit.componentDirty; } }
|
||||
internal override void ClearComponentDirty()
|
||||
{
|
||||
base.ClearComponentDirty();
|
||||
textLimit.ClearComponentDirty();
|
||||
}
|
||||
|
||||
public static AxisLabel defaultAxisLabel
|
||||
{
|
||||
@@ -101,44 +152,6 @@ namespace XCharts
|
||||
};
|
||||
}
|
||||
}
|
||||
public void Copy(AxisLabel other)
|
||||
{
|
||||
m_Show = other.show;
|
||||
m_Interval = other.interval;
|
||||
m_Inside = other.inside;
|
||||
m_Rotate = other.rotate;
|
||||
m_Margin = other.margin;
|
||||
m_Color = other.color;
|
||||
m_FontSize = other.fontSize;
|
||||
m_FontStyle = other.fontStyle;
|
||||
m_Formatter = other.formatter;
|
||||
m_TextLimit.Copy(other.textLimit);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var other = (AxisLabel)obj;
|
||||
return m_Show == other.show &&
|
||||
m_Interval.Equals(other.interval) &&
|
||||
m_Inside == other.inside &&
|
||||
m_Rotate == other.rotate &&
|
||||
m_Margin == other.margin &&
|
||||
m_Color == other.color &&
|
||||
m_FontSize == other.fontSize &&
|
||||
m_FontStyle == other.fontStyle &&
|
||||
m_ForceENotation == other.forceENotation &&
|
||||
ChartHelper.IsValueEqualsString(m_Formatter, other.formatter) &&
|
||||
m_TextLimit.Equals(other.textLimit);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
public void SetRelatedText(Text txt, float labelWidth)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace XCharts
|
||||
/// Settings related to axis line.
|
||||
/// 坐标轴的分隔线。
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
[System.Serializable]
|
||||
public class AxisLine : SubComponent
|
||||
{
|
||||
[SerializeField] private bool m_Show;
|
||||
@@ -29,42 +29,74 @@ namespace XCharts
|
||||
/// Set this to false to prevent the axis line from showing.
|
||||
/// 是否显示坐标轴轴线。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// When mutiple axes exists, this option can be used to specify which axis can be "onZero" to.
|
||||
/// X 轴或者 Y 轴的轴线是否在另一个轴的 0 刻度上,只有在另一个轴为数值轴且包含 0 刻度时有效。
|
||||
/// </summary>
|
||||
public bool onZero { get { return m_OnZero; } set { m_OnZero = value; } }
|
||||
public bool onZero
|
||||
{
|
||||
get { return m_OnZero; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// line style line width.
|
||||
/// 坐标轴线线宽。
|
||||
/// </summary>
|
||||
public float width { get { return m_Width; } set { m_Width = value; } }
|
||||
public float width
|
||||
{
|
||||
get { return m_Width; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Whether to show the arrow symbol of axis.
|
||||
/// 是否显示箭头。
|
||||
/// </summary>
|
||||
public bool symbol { get { return m_Symbol; } set { m_Symbol = value; } }
|
||||
public bool symbol
|
||||
{
|
||||
get { return m_Symbol; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Symbol, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the width of arrow symbol.
|
||||
/// 箭头宽。
|
||||
/// </summary>
|
||||
public float symbolWidth { get { return m_SymbolWidth; } set { m_SymbolWidth = value; } }
|
||||
public float symbolWidth
|
||||
{
|
||||
get { return m_SymbolWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SymbolWidth, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the height of arrow symbol.
|
||||
/// 箭头高。
|
||||
/// </summary>
|
||||
public float symbolHeight { get { return m_SymbolHeight; } set { m_SymbolHeight = value; } }
|
||||
public float symbolHeight
|
||||
{
|
||||
get { return m_SymbolHeight; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SymbolHeight, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the offset of arrow symbol.
|
||||
/// 箭头偏移。
|
||||
/// </summary>
|
||||
public float symbolOffset { get { return m_SymbolOffset; } set { m_SymbolOffset = value; } }
|
||||
public float symbolOffset
|
||||
{
|
||||
get { return m_SymbolOffset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SymbolOffset, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the dent of arrow symbol.
|
||||
/// 箭头的凹陷程度。
|
||||
/// </summary>
|
||||
public float symbolDent { get { return m_SymbolDent; } set { m_SymbolDent = value; } }
|
||||
public float symbolDent
|
||||
{
|
||||
get { return m_SymbolDent; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SymbolDent, value)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public static AxisLine defaultAxisLine
|
||||
{
|
||||
|
||||
@@ -40,42 +40,74 @@ namespace XCharts
|
||||
/// Whether to show axis name.
|
||||
/// 是否显示坐标名称。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the name of axis.
|
||||
/// 坐标轴名称。
|
||||
/// </summary>
|
||||
public string name { get { return m_Name; } set { m_Name = value; } }
|
||||
public string name
|
||||
{
|
||||
get { return m_Name; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Name, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Location of axis name.
|
||||
/// 坐标轴名称显示位置。
|
||||
/// </summary>
|
||||
public Location location { get { return m_Location; } set { m_Location = value; } }
|
||||
public Location location
|
||||
{
|
||||
get { return m_Location; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Location, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the offset of axis name and axis line.
|
||||
/// 坐标轴名称与轴线之间的偏移。
|
||||
/// </summary>
|
||||
public Vector2 offset { get { return m_Offset; } set { m_Offset = value; } }
|
||||
public Vector2 offset
|
||||
{
|
||||
get { return m_Offset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Offset, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Rotation of axis name.
|
||||
/// 坐标轴名字旋转,角度值。
|
||||
/// </summary>
|
||||
public float rotate { get { return m_Rotate; } set { m_Rotate = value; } }
|
||||
public float rotate
|
||||
{
|
||||
get { return m_Rotate; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Color of axis name.
|
||||
/// 坐标轴名称的文字颜色。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// axis name font size.
|
||||
/// 坐标轴名称的文字大小。
|
||||
/// </summary>
|
||||
public int fontSize { get { return m_FontSize; } set { m_FontSize = value; } }
|
||||
public int fontSize
|
||||
{
|
||||
get { return m_FontSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontSize, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// axis name font style.
|
||||
/// 坐标轴名称的文字风格。
|
||||
/// </summary>
|
||||
public FontStyle fontStyle { get { return m_FontStyle; } set { m_FontStyle = value; } }
|
||||
public FontStyle fontStyle
|
||||
{
|
||||
get { return m_FontStyle; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontStyle, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
public static AxisName defaultAxisName
|
||||
{
|
||||
@@ -93,39 +125,5 @@ namespace XCharts
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void Copy(AxisName other)
|
||||
{
|
||||
m_Show = other.show;
|
||||
m_Name = other.name;
|
||||
m_Location = other.location;
|
||||
m_Offset = other.offset;
|
||||
m_Rotate = other.rotate;
|
||||
m_Color = other.color;
|
||||
m_FontSize = other.fontSize;
|
||||
m_FontStyle = other.fontStyle;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var other = (AxisName)obj;
|
||||
return m_Show == other.show &&
|
||||
m_Name.Equals(other.name) &&
|
||||
m_Location == other.location &&
|
||||
m_Rotate == other.rotate &&
|
||||
m_Color == other.color &&
|
||||
m_Offset == other.offset &&
|
||||
m_FontSize == other.fontSize &&
|
||||
m_FontStyle == other.fontStyle;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,14 +25,22 @@ namespace XCharts
|
||||
/// Set this to true to show the splitArea.
|
||||
/// 是否显示分隔区域。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Color of split area. SplitArea color could also be set in color array,
|
||||
/// which the split lines would take as their colors in turns.
|
||||
/// Dark and light colors in turns are used by default.
|
||||
/// 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
|
||||
/// </summary>
|
||||
public List<Color> color { get { return m_Color; } set { m_Color = value; } }
|
||||
public List<Color> color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (value != null) { m_Color = value; SetVerticesDirty(); } }
|
||||
}
|
||||
|
||||
public static AxisSplitArea defaultSplitArea
|
||||
{
|
||||
|
||||
@@ -25,13 +25,31 @@ namespace XCharts
|
||||
/// Set this to true to show the split line.
|
||||
/// 是否显示分隔线。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public int interval { get { return m_Interval; } set { m_Interval = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
public int interval
|
||||
{
|
||||
get { return m_Interval; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Interval, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 线条样式
|
||||
/// </summary>
|
||||
public LineStyle lineStyle { get { return m_LineStyle; } set { if (value != null) m_LineStyle = value; } }
|
||||
public LineStyle lineStyle
|
||||
{
|
||||
get { return m_LineStyle; }
|
||||
set { if (value != null) { m_LineStyle = value; SetVerticesDirty(); } }
|
||||
}
|
||||
|
||||
public override bool vertsDirty { get { return m_VertsDirty || m_LineStyle.anyDirty; } }
|
||||
internal override void ClearVerticesDirty()
|
||||
{
|
||||
base.ClearVerticesDirty();
|
||||
m_LineStyle.ClearVerticesDirty();
|
||||
}
|
||||
public static AxisSplitLine defaultSplitLine
|
||||
{
|
||||
get
|
||||
@@ -43,30 +61,6 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public void Copy(AxisSplitLine other)
|
||||
{
|
||||
m_Show = other.show;
|
||||
m_Interval = other.interval;
|
||||
m_LineStyle.Copy(other.m_LineStyle);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var other = (AxisSplitLine)obj;
|
||||
return m_Show == other.show &&
|
||||
m_Interval == other.interval &&
|
||||
m_LineStyle.Equals(other.lineStyle);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
internal Color GetColor(ThemeInfo theme)
|
||||
{
|
||||
if (lineStyle.color != Color.clear)
|
||||
|
||||
@@ -26,22 +26,38 @@ namespace XCharts
|
||||
/// Set this to false to prevent the axis tick from showing.
|
||||
/// 是否显示坐标轴刻度。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Align axis tick with label, which is available only when boundaryGap is set to be true in category axis.
|
||||
/// 类目轴中在 boundaryGap 为 true 的时候有效,可以保证刻度线和标签对齐。
|
||||
/// </summary>
|
||||
public bool alignWithLabel { get { return m_AlignWithLabel; } set { m_AlignWithLabel = value; } }
|
||||
public bool alignWithLabel
|
||||
{
|
||||
get { return m_AlignWithLabel; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_AlignWithLabel, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Set this to true so the axis labels face the inside direction.
|
||||
/// 坐标轴刻度是否朝内,默认朝外。
|
||||
/// </summary>
|
||||
public bool inside { get { return m_Inside; } set { m_Inside = value; } }
|
||||
public bool inside
|
||||
{
|
||||
get { return m_Inside; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Inside, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The length of the axis tick.
|
||||
/// 坐标轴刻度的长度。
|
||||
/// </summary>
|
||||
public float length { get { return m_Length; } set { m_Length = value; } }
|
||||
public float length
|
||||
{
|
||||
get { return m_Length; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Length, value)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public static AxisTick defaultTick
|
||||
{
|
||||
|
||||
@@ -22,14 +22,43 @@ namespace XCharts
|
||||
/// <summary>
|
||||
/// 是否启用高亮样式。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { m_Show = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 图形文本标签。
|
||||
/// </summary>
|
||||
public SerieLabel label { get { return m_Label; } }
|
||||
public SerieLabel label
|
||||
{
|
||||
get { return m_Label; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Label, value, true)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 图形样式。
|
||||
/// </summary>
|
||||
public ItemStyle itemStyle { get { return m_ItemStyle; } }
|
||||
public ItemStyle itemStyle
|
||||
{
|
||||
get { return m_ItemStyle; }
|
||||
set { if (PropertyUtility.SetClass(ref m_ItemStyle, value, true)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public override bool vertsDirty { get { return m_VertsDirty || label.vertsDirty || itemStyle.vertsDirty; } }
|
||||
|
||||
public override bool componentDirty { get { return m_ComponentDirty || label.componentDirty; } }
|
||||
|
||||
internal override void ClearVerticesDirty()
|
||||
{
|
||||
base.ClearVerticesDirty();
|
||||
label.ClearVerticesDirty();
|
||||
itemStyle.ClearVerticesDirty();
|
||||
}
|
||||
|
||||
internal override void ClearComponentDirty()
|
||||
{
|
||||
base.ClearComponentDirty();
|
||||
label.ClearComponentDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Settings related to gauge axis line.
|
||||
/// 仪表盘轴线相关设置。
|
||||
|
||||
@@ -25,16 +25,28 @@ namespace XCharts
|
||||
/// <summary>
|
||||
/// 是否显示指针。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 指针长度。可以是绝对值,也可以是相对于半径的百分比(0-1的浮点数)
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public float length { get { return m_Length; } set { m_Length = value; } }
|
||||
public float length
|
||||
{
|
||||
get { return m_Length; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Length, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 指针宽度。
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public float width { get { return m_Width; } set { m_Width = value; } }
|
||||
public float width
|
||||
{
|
||||
get { return m_Width; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,26 +44,50 @@ namespace XCharts
|
||||
/// <summary>
|
||||
/// 是否启用。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据项颜色。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 边框的类型。
|
||||
/// </summary>
|
||||
public Type borderType { get { return m_BorderType; } set { m_BorderType = value; } }
|
||||
public Type borderType
|
||||
{
|
||||
get { return m_BorderType; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BorderType, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 边框的颜色。
|
||||
/// </summary>
|
||||
public Color borderColor { get { return m_BorderColor; } set { m_BorderColor = value; } }
|
||||
public Color borderColor
|
||||
{
|
||||
get { return m_BorderColor; }
|
||||
set { if (PropertyUtility.SetColor(ref m_BorderColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 边框宽。
|
||||
/// </summary>
|
||||
public float borderWidth { get { return m_BorderWidth; } set { m_BorderWidth = value; } }
|
||||
public float borderWidth
|
||||
{
|
||||
get { return m_BorderWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BorderWidth, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
||||
/// </summary>
|
||||
public float opacity { get { return m_Opacity; } set { m_Opacity = value; } }
|
||||
public float opacity
|
||||
{
|
||||
get { return m_Opacity; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,31 +37,55 @@ namespace XCharts
|
||||
/// Whether to show the arrow.
|
||||
/// 是否显示箭头。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The position of arrow.
|
||||
/// 箭头位置。
|
||||
/// </summary>
|
||||
public Position position { get { return m_Position; } set { m_Position = value; } }
|
||||
public Position position
|
||||
{
|
||||
get { return m_Position; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Position, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The widht of arrow.
|
||||
/// 箭头宽。
|
||||
/// </summary>
|
||||
public float width { get { return m_Width; } set { m_Width = value; } }
|
||||
public float width
|
||||
{
|
||||
get { return m_Width; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The height of arrow.
|
||||
/// 箭头高。
|
||||
/// </summary>
|
||||
public float height { get { return m_Height; } set { m_Height = value; } }
|
||||
public float height
|
||||
{
|
||||
get { return m_Height; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Height, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The offset of arrow.
|
||||
/// 箭头偏移。
|
||||
/// </summary>
|
||||
public float offset { get { return m_Offset; } set { m_Offset = value; } }
|
||||
public float offset
|
||||
{
|
||||
get { return m_Offset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Offset, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The dent of arrow.
|
||||
/// 箭头的凹度。
|
||||
/// </summary>
|
||||
public float dent { get { return m_Dent; } set { m_Dent = value; } }
|
||||
public float dent
|
||||
{
|
||||
get { return m_Dent; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Dent, value)) SetVerticesDirty(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,27 +54,47 @@ namespace XCharts
|
||||
/// Whether show line.
|
||||
/// 是否显示线条。当作为子组件,它的父组件有参数控制是否显示时,改参数无效。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the type of line.
|
||||
/// 线的类型。
|
||||
/// </summary>
|
||||
public Type type { get { return m_Type; } set { m_Type = value; } }
|
||||
public Type type
|
||||
{
|
||||
get { return m_Type; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Type, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of line, default use serie color.
|
||||
/// 线的颜色。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the width of line.
|
||||
/// 线宽。
|
||||
/// </summary>
|
||||
public float width { get { return m_Width; } set { m_Width = value; } }
|
||||
/// /// </summary>
|
||||
public float width
|
||||
{
|
||||
get { return m_Width; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Opacity of the line. Supports value from 0 to 1, and the line will not be drawn when set to 0.
|
||||
/// 线的透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
||||
/// </summary>
|
||||
public float opacity { get { return m_Opacity; } set { m_Opacity = value; } }
|
||||
public float opacity
|
||||
{
|
||||
get { return m_Opacity; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public LineStyle()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace XCharts
|
||||
/// 位置类型。通过Align快速设置大体位置,再通过left,right,top,bottom微调具体位置。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Location : SubComponent, IPropertyChanged, IEquatable<Location>
|
||||
public class Location : SubComponent, IPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// 对齐方式
|
||||
@@ -47,27 +47,47 @@ namespace XCharts
|
||||
/// <summary>
|
||||
/// 对齐方式。
|
||||
/// </summary>
|
||||
public Align align { get { return m_Align; } set { m_Align = value; UpdateAlign(); } }
|
||||
public Align align
|
||||
{
|
||||
get { return m_Align; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Align, value)) { SetComponentDirty(); UpdateAlign(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Distance between component and the left side of the container.
|
||||
/// 离容器左侧的距离。
|
||||
/// </summary>
|
||||
public float left { get { return m_Left; } set { m_Left = value; UpdateAlign(); } }
|
||||
public float left
|
||||
{
|
||||
get { return m_Left; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Left, value)) { SetComponentDirty(); UpdateAlign(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Distance between component and the left side of the container.
|
||||
/// 离容器右侧的距离。
|
||||
/// </summary>
|
||||
public float right { get { return m_Right; } set { m_Right = value; UpdateAlign(); } }
|
||||
public float right
|
||||
{
|
||||
get { return m_Right; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Right, value)) { SetComponentDirty(); UpdateAlign(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Distance between component and the left side of the container.
|
||||
/// 离容器上侧的距离。
|
||||
/// </summary>
|
||||
public float top { get { return m_Top; } set { m_Top = value; UpdateAlign(); } }
|
||||
public float top
|
||||
{
|
||||
get { return m_Top; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Top, value)) { SetComponentDirty(); UpdateAlign(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Distance between component and the left side of the container.
|
||||
/// 离容器下侧的距离。
|
||||
/// </summary>
|
||||
public float bottom { get { return m_Bottom; } set { m_Bottom = value; UpdateAlign(); } }
|
||||
public float bottom
|
||||
{
|
||||
get { return m_Bottom; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Bottom, value)) { SetComponentDirty(); UpdateAlign(); } }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the anchor of text.
|
||||
@@ -250,67 +270,6 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public void Copy(Location location)
|
||||
{
|
||||
m_Align = location.align;
|
||||
m_Left = location.left;
|
||||
m_Right = location.right;
|
||||
m_Top = location.top;
|
||||
m_Bottom = location.bottom;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (obj is Location)
|
||||
{
|
||||
return Equals((Location)obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Equals(Location other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return align == other.align &&
|
||||
left == other.left &&
|
||||
right == other.right &&
|
||||
top == other.top &&
|
||||
bottom == other.bottom;
|
||||
}
|
||||
|
||||
public static bool operator ==(Location left, Location right)
|
||||
{
|
||||
if (ReferenceEquals(left, null) && ReferenceEquals(right, null))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (ReferenceEquals(left, null) || ReferenceEquals(right, null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(Location left, Location right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 属性变更时更新textAnchor,minAnchor,maxAnchor,pivot
|
||||
/// </summary>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/* */
|
||||
/******************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
@@ -101,16 +102,26 @@ namespace XCharts
|
||||
[SerializeField] private float m_BorderWidth = 0.5f;
|
||||
[SerializeField] private Color m_BorderColor = Color.grey;
|
||||
[SerializeField] private bool m_ForceENotation = false;
|
||||
[NonSerialized] private bool m_LabelDirty = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the label is showed.
|
||||
/// 是否显示文本标签。
|
||||
/// </summary>
|
||||
public bool show { get { return m_Show; } set { m_Show = value; } }
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The position of label.
|
||||
/// 标签的位置。
|
||||
/// </summary>
|
||||
public Position position { get { return m_Position; } set { m_Position = value; } }
|
||||
public Position position
|
||||
{
|
||||
get { return m_Position; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Position, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 标签内容字符串模版格式器。支持用 \n 换行。
|
||||
/// 模板变量有:
|
||||
@@ -124,112 +135,200 @@ namespace XCharts
|
||||
/// <example>
|
||||
/// 示例:“{b}:{c}”
|
||||
/// </example>
|
||||
public string formatter { get { return m_Formatter; } set { m_Formatter = value; } }
|
||||
public string formatter
|
||||
{
|
||||
get { return m_Formatter; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Formatter, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// offset to the host graphic element.
|
||||
/// 距离图形元素的偏移
|
||||
/// </summary>
|
||||
public Vector3 offset { get { return m_Offset; } set { m_Offset = value; } }
|
||||
public Vector3 offset
|
||||
{
|
||||
get { return m_Offset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Offset, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 距离轴线的距离。
|
||||
/// </summary>
|
||||
public float margin { get { return m_Margin; } set { m_Margin = value; } }
|
||||
public float margin
|
||||
{
|
||||
get { return m_Margin; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Margin, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Text color,If set as default ,the color will assigned as series color.
|
||||
/// 自定义文字颜色,默认和系列的颜色一致。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Color, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the background color. If set as default, it means than don't show background.
|
||||
/// 标签的背景色,默认无颜色。
|
||||
/// </summary>
|
||||
public Color backgroundColor { get { return m_BackgroundColor; } set { m_BackgroundColor = value; } }
|
||||
public Color backgroundColor
|
||||
{
|
||||
get { return m_BackgroundColor; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the width of background. If set as default value 0, it means than the background width auto set as the text width.
|
||||
/// 标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public float backgroundWidth { get { return m_BackgroundWidth; } set { m_BackgroundWidth = value; } }
|
||||
public float backgroundWidth
|
||||
{
|
||||
get { return m_BackgroundWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the height of background. If set as default value 0, it means than the background height auto set as the text height.
|
||||
/// 标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public float backgroundHeight { get { return m_BackgroundHeight; } set { m_BackgroundHeight = value; } }
|
||||
public float backgroundHeight
|
||||
{
|
||||
get { return m_BackgroundHeight; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Rotate label.
|
||||
/// 标签旋转。
|
||||
/// </summary>
|
||||
public float rotate { get { return m_Rotate; } set { m_Rotate = value; } }
|
||||
public float rotate
|
||||
{
|
||||
get { return m_Rotate; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the text padding of left and right. defaut:2.
|
||||
/// 左右边距。
|
||||
/// </summary>
|
||||
public float paddingLeftRight { get { return m_PaddingLeftRight; } set { m_PaddingLeftRight = value; } }
|
||||
public float paddingLeftRight
|
||||
{
|
||||
get { return m_PaddingLeftRight; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the text padding of top and bottom. defaut:2.
|
||||
/// 上下边距。
|
||||
/// </summary>
|
||||
public float paddingTopBottom { get { return m_PaddingTopBottom; } set { m_PaddingTopBottom = value; } }
|
||||
public float paddingTopBottom
|
||||
{
|
||||
get { return m_PaddingTopBottom; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font size.
|
||||
/// 文字的字体大小。
|
||||
/// </summary>
|
||||
public int fontSize { get { return m_FontSize; } set { m_FontSize = value; } }
|
||||
public int fontSize
|
||||
{
|
||||
get { return m_FontSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BackgroundWidth, value)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font style.
|
||||
/// 文字的字体风格。
|
||||
/// </summary>
|
||||
public FontStyle fontStyle { get { return m_FontStyle; } set { m_FontStyle = value; } }
|
||||
public FontStyle fontStyle
|
||||
{
|
||||
get { return m_FontStyle; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontStyle, value)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Whether to show visual guide line.Will show when label position is set as 'outside'.
|
||||
/// 是否显示视觉引导线。在 label 位置 设置为'outside'的时候会显示视觉引导线。
|
||||
/// </summary>
|
||||
public bool line { get { return m_Line; } set { m_Line = value; } }
|
||||
public bool line
|
||||
{
|
||||
get { return m_Line; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Line, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the type of visual guide line.
|
||||
/// 视觉引导线类型。
|
||||
/// </summary>
|
||||
public LineType lineType { get { return m_LineType; } set { m_LineType = value; } }
|
||||
public LineType lineType
|
||||
{
|
||||
get { return m_LineType; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineType, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of visual guild line.
|
||||
/// 视觉引导线颜色。默认和serie一致取自调色板。
|
||||
/// </summary>
|
||||
public Color lineColor { get { return m_LineColor; } set { m_LineColor = value; } }
|
||||
public Color lineColor
|
||||
{
|
||||
get { return m_LineColor; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the width of visual guild line.
|
||||
/// 视觉引导线的宽度。
|
||||
/// </summary>
|
||||
public float lineWidth { get { return m_LineWidth; } set { m_LineWidth = value; } }
|
||||
public float lineWidth
|
||||
{
|
||||
get { return m_LineWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineWidth, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The length of the first segment of visual guide line.
|
||||
/// 视觉引导线第一段的长度。
|
||||
/// </summary>
|
||||
public float lineLength1 { get { return m_LineLength1; } set { m_LineLength1 = value; } }
|
||||
public float lineLength1
|
||||
{
|
||||
get { return m_LineLength1; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineLength1, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The length of the second segment of visual guide line.
|
||||
/// 视觉引导线第二段的长度。
|
||||
/// </summary>
|
||||
public float lineLength2 { get { return m_LineLength2; } set { m_LineLength2 = value; } }
|
||||
public float lineLength2
|
||||
{
|
||||
get { return m_LineLength2; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineLength2, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Whether to show border.
|
||||
/// 是否显示边框。
|
||||
/// </summary>
|
||||
public bool border { get { return m_Border; } set { m_Border = value; } }
|
||||
public bool border
|
||||
{
|
||||
get { return m_Border; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Border, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the width of border.
|
||||
/// 边框宽度。
|
||||
/// </summary>
|
||||
public float borderWidth { get { return m_BorderWidth; } set { m_BorderWidth = value; } }
|
||||
public float borderWidth
|
||||
{
|
||||
get { return m_BorderWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BorderWidth, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of border.
|
||||
/// 边框颜色。
|
||||
/// </summary>
|
||||
public Color borderColor { get { return m_BorderColor; } set { m_BorderColor = value; } }
|
||||
public Color borderColor
|
||||
{
|
||||
get { return m_BorderColor; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_BorderColor, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否强制使用科学计数法格式化显示数值。默认为false,当小数精度大于3时才采用科学计数法。
|
||||
/// </summary>
|
||||
public bool forceENotation { get { return m_ForceENotation; } set { m_ForceENotation = value; } }
|
||||
public bool forceENotation
|
||||
{
|
||||
get { return m_ForceENotation; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_ForceENotation, value)) SetVerticesDirty(); }
|
||||
}
|
||||
|
||||
public string GetFormatterContent(string serieName, string dataName, float dataValue, float dataTotal = 0)
|
||||
{
|
||||
|
||||
@@ -98,77 +98,137 @@ namespace XCharts
|
||||
/// the type of symbol.
|
||||
/// 标记类型。
|
||||
/// </summary>
|
||||
public SerieSymbolType type { get { return m_Type; } set { m_Type = value; } }
|
||||
public SerieSymbolType type
|
||||
{
|
||||
get { return m_Type; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Type, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the type of symbol size.
|
||||
/// 标记图形的大小获取方式。
|
||||
/// </summary>
|
||||
public SerieSymbolSizeType sizeType { get { return m_SizeType; } set { m_SizeType = value; } }
|
||||
public SerieSymbolSizeType sizeType
|
||||
{
|
||||
get { return m_SizeType; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SizeType, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the size of symbol.
|
||||
/// 标记的大小。
|
||||
/// </summary>
|
||||
public float size { get { return m_Size; } set { m_Size = value; } }
|
||||
public float size
|
||||
{
|
||||
get { return m_Size; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Size, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the size of selected symbol.
|
||||
/// 被选中的标记的大小。
|
||||
/// </summary>
|
||||
public float selectedSize { get { return m_SelectedSize; } set { m_SelectedSize = value; } }
|
||||
public float selectedSize
|
||||
{
|
||||
get { return m_SelectedSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SelectedSize, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// whitch data index is when the sizeType assined as FromData.
|
||||
/// 当sizeType指定为FromData时,指定的数据源索引。
|
||||
/// </summary>
|
||||
public int dataIndex { get { return m_DataIndex; } set { m_DataIndex = value; } }
|
||||
public int dataIndex
|
||||
{
|
||||
get { return m_DataIndex; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_DataIndex, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the scale of data when sizeType assined as FromData.
|
||||
/// 当sizeType指定为FromData时,指定的倍数系数。
|
||||
/// </summary>
|
||||
public float dataScale { get { return m_DataScale; } set { m_DataScale = value; } }
|
||||
public float dataScale
|
||||
{
|
||||
get { return m_DataScale; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_DataScale, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the scale of selected data when sizeType assined as FromData.
|
||||
/// 当sizeType指定为FromData时,指定的高亮倍数系数。
|
||||
/// </summary>
|
||||
public float selectedDataScale { get { return m_SelectedDataScale; } set { m_SelectedDataScale = value; } }
|
||||
public float selectedDataScale
|
||||
{
|
||||
get { return m_SelectedDataScale; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_SelectedDataScale, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the callback of size when sizeType assined as Callback.
|
||||
/// 当sizeType指定为Callback时,指定的回调函数。
|
||||
/// </summary>
|
||||
public SymbolSizeCallback sizeCallback { get { return m_SizeCallback; } set { m_SizeCallback = value; } }
|
||||
public SymbolSizeCallback sizeCallback
|
||||
{
|
||||
get { return m_SizeCallback; }
|
||||
set { if (PropertyUtility.SetClass(ref m_SizeCallback, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the callback of size when sizeType assined as Callback.
|
||||
/// 当sizeType指定为Callback时,指定的高亮回调函数。
|
||||
/// </summary>
|
||||
public SymbolSizeCallback selectedSizeCallback { get { return m_SelectedSizeCallback; } set { m_SelectedSizeCallback = value; } }
|
||||
public SymbolSizeCallback selectedSizeCallback
|
||||
{
|
||||
get { return m_SelectedSizeCallback; }
|
||||
set { if (PropertyUtility.SetClass(ref m_SelectedSizeCallback, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of symbol,default from serie.
|
||||
/// 标记图形的颜色,默认和系列一致。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the opacity of color.
|
||||
/// 图形标记的透明度。
|
||||
/// </summary>
|
||||
public float opacity { get { return m_Opacity; } set { m_Opacity = value; } }
|
||||
public float opacity
|
||||
{
|
||||
get { return m_Opacity; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Opacity, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the index start to show symbol.
|
||||
/// 开始显示图形标记的索引。
|
||||
/// </summary>
|
||||
public int startIndex { get { return m_StartIndex; } set { m_StartIndex = value; } }
|
||||
public int startIndex
|
||||
{
|
||||
get { return m_StartIndex; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_StartIndex, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the interval of show symbol.
|
||||
/// 显示图形标记的间隔。0表示显示所有标签,1表示隔一个隔显示一个标签,以此类推。
|
||||
/// </summary>
|
||||
public int interval { get { return m_Interval; } set { m_Interval = value; } }
|
||||
public int interval
|
||||
{
|
||||
get { return m_Interval; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Interval, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// whether to show the last symbol.
|
||||
/// 是否强制显示最后一个图形标记。
|
||||
/// </summary>
|
||||
public bool forceShowLast { get { return m_ForceShowLast; } set { m_ForceShowLast = value; } }
|
||||
public bool forceShowLast
|
||||
{
|
||||
get { return m_ForceShowLast; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_ForceShowLast, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the gap of symbol and line segment.
|
||||
/// 图形标记和线条的间隙距离。
|
||||
/// </summary>
|
||||
public float gap { get { return m_Gap; } set { m_Gap = value; } }
|
||||
public float gap
|
||||
{
|
||||
get { return m_Gap; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Gap, value)) SetVerticesDirty(); }
|
||||
}
|
||||
private List<float> m_AnimationSize = new List<float>() { 0, 5, 10 };
|
||||
/// <summary>
|
||||
/// the setting for effect scatter.
|
||||
|
||||
@@ -26,50 +26,40 @@ namespace XCharts
|
||||
/// <summary>
|
||||
/// 是否启用文本自适应。默认为true。
|
||||
/// </summary>
|
||||
public bool enable { get { return m_Enable; } set { m_Enable = value; } }
|
||||
public bool enable
|
||||
{
|
||||
get { return m_Enable; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Enable, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 设定最大宽度。默认为0表示自动获取,否则表示自定义。当文本的宽度大于该值进行裁剪。
|
||||
/// </summary>
|
||||
public float maxWidth { get { return m_MaxWidth; } set { m_MaxWidth = value; } }
|
||||
public float maxWidth
|
||||
{
|
||||
get { return m_MaxWidth; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_MaxWidth, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 两边留白像素距离。默认为10
|
||||
/// </summary>
|
||||
public float gap { get { return m_Gap; } set { m_Gap = value; } }
|
||||
public float gap
|
||||
{
|
||||
get { return m_Gap; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Gap, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 长度超出时的后缀。
|
||||
/// </summary>
|
||||
public string suffix { get { return m_Suffix; } set { m_Suffix = value; } }
|
||||
public string suffix
|
||||
{
|
||||
get { return m_Suffix; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Suffix, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
private Text m_RelatedText;
|
||||
private TextGenerationSettings m_RelatedTextSettings;
|
||||
private float m_RelatedTextWidth = 0;
|
||||
|
||||
public void Copy(TextLimit other)
|
||||
{
|
||||
m_Enable = other.enable;
|
||||
m_Gap = other.gap;
|
||||
m_Suffix = other.suffix;
|
||||
m_MaxWidth = other.maxWidth;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var other = (TextLimit)obj;
|
||||
return m_Enable == other.enable &&
|
||||
m_MaxWidth == other.maxWidth &&
|
||||
m_Gap == other.gap &&
|
||||
m_Suffix.Equals(other.suffix);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
public void SetRelatedText(Text txt, float labelWidth)
|
||||
{
|
||||
m_RelatedText = txt;
|
||||
|
||||
@@ -34,12 +34,20 @@ namespace XCharts
|
||||
/// Rotation of text.
|
||||
/// 文本的旋转。
|
||||
/// </summary>
|
||||
public float rotate { get { return m_Rotate; } set { m_Rotate = value; } }
|
||||
public float rotate
|
||||
{
|
||||
get { return m_Rotate; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the offset of position.
|
||||
/// 坐标偏移。
|
||||
/// </summary>
|
||||
public Vector2 offset { get { return m_Offset; } set { m_Offset = value; } }
|
||||
public Vector2 offset
|
||||
{
|
||||
get { return m_Offset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Offset, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
public Vector3 offsetv3 { get { return new Vector3(m_Offset.x, m_Offset.y, 0); } }
|
||||
|
||||
@@ -47,32 +55,56 @@ namespace XCharts
|
||||
/// the color of text.
|
||||
/// 文本的颜色。
|
||||
/// </summary>
|
||||
public Color color { get { return m_Color; } set { m_Color = value; } }
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the color of text.
|
||||
/// 文本的背景颜色。
|
||||
/// </summary>
|
||||
public Color backgroundColor { get { return m_BackgroundColor; } set { m_BackgroundColor = value; } }
|
||||
public Color backgroundColor
|
||||
{
|
||||
get { return m_BackgroundColor; }
|
||||
set { if (PropertyUtility.SetColor(ref m_BackgroundColor, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the font of text.
|
||||
/// 文本字体
|
||||
/// </summary>
|
||||
public Font font { get { return m_Font; } set { m_Font = value; } }
|
||||
public Font font
|
||||
{
|
||||
get { return m_Font; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Font, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font size.
|
||||
/// 文本字体大小。
|
||||
/// </summary>
|
||||
public int fontSize { get { return m_FontSize; } set { m_FontSize = value; } }
|
||||
public int fontSize
|
||||
{
|
||||
get { return m_FontSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontSize, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// font style.
|
||||
/// 文本字体的风格。
|
||||
/// </summary>
|
||||
public FontStyle fontStyle { get { return m_FontStyle; } set { m_FontStyle = value; } }
|
||||
public FontStyle fontStyle
|
||||
{
|
||||
get { return m_FontStyle; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontStyle, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// text line spacing.
|
||||
/// 行间距。
|
||||
/// </summary>
|
||||
public float lineSpacing { get { return m_LineSpacing; } set { m_LineSpacing = value; } }
|
||||
public float lineSpacing
|
||||
{
|
||||
get { return m_LineSpacing; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_LineSpacing, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
public TextStyle()
|
||||
{
|
||||
|
||||
@@ -33,9 +33,6 @@ namespace XCharts
|
||||
/// 文本的颜色。
|
||||
/// </summary>
|
||||
public TextStyle textStyle { get { return m_textStyle; } set { m_textStyle = value; } }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Text runtimeText { get; set; }
|
||||
|
||||
public TitleStyle Clone()
|
||||
|
||||
Reference in New Issue
Block a user