完善Pie饼图的交互动画效果

This commit is contained in:
monitor1394
2023-07-27 07:17:37 +08:00
parent 758d578ad2
commit 0c09d40654
7 changed files with 37 additions and 24 deletions

View File

@@ -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)