mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 16:00:24 +00:00
完善Pie饼图的交互动画效果
This commit is contained in:
@@ -10,20 +10,24 @@ namespace XCharts.Runtime
|
||||
[System.Serializable]
|
||||
public class MLValue : ChildComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// the type of value.
|
||||
/// |数值类型。
|
||||
/// </summary>
|
||||
public enum Type
|
||||
{
|
||||
/// <summary>
|
||||
/// Percent form.
|
||||
/// Percent value form.
|
||||
/// |百分比形式。
|
||||
/// </summary>
|
||||
Percent,
|
||||
/// <summary>
|
||||
/// Absolute form.
|
||||
/// Absolute value form.
|
||||
/// |绝对值形式。
|
||||
/// </summary>
|
||||
Absolute,
|
||||
/// <summary>
|
||||
/// Extra form.
|
||||
/// Extra value form.
|
||||
/// |额外形式。
|
||||
/// </summary>
|
||||
Extra
|
||||
@@ -34,18 +38,24 @@ namespace XCharts.Runtime
|
||||
public Type type { get { return m_Type; } set { m_Type = value; } }
|
||||
public float value { get { return m_Value; } set { m_Value = value; } }
|
||||
|
||||
public MLValue(Type type, float value)
|
||||
{
|
||||
m_Type = type;
|
||||
m_Value = value;
|
||||
}
|
||||
|
||||
public MLValue(float value)
|
||||
{
|
||||
m_Type = Type.Percent;
|
||||
m_Value = value;
|
||||
}
|
||||
|
||||
public MLValue(Type type, float value)
|
||||
{
|
||||
m_Type = type;
|
||||
m_Value = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the value by type.
|
||||
/// |根据类型获取值。
|
||||
/// </summary>
|
||||
/// <param name="total">默认值</param>
|
||||
/// <returns></returns>
|
||||
public float GetValue(float total)
|
||||
{
|
||||
switch (m_Type)
|
||||
|
||||
Reference in New Issue
Block a user