mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 05:08:48 +00:00
修复Animation的type代码动态修改无效的问题
This commit is contained in:
@@ -70,6 +70,7 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2024.01.18) 修复`Animation`的`type`代码动态修改无效的问题
|
||||||
* (2024.01.13) 增加`Chart`的更多快捷创建图表菜单
|
* (2024.01.13) 增加`Chart`的更多快捷创建图表菜单
|
||||||
* (2024.01.12) 屏蔽`Chart`的`Init()`接口,动态创建图表不再需要调用
|
* (2024.01.12) 屏蔽`Chart`的`Init()`接口,动态创建图表不再需要调用
|
||||||
* (2024.01.09) 增加`Background`的`borderStyle`,给图表默认设置圆角
|
* (2024.01.09) 增加`Background`的`borderStyle`,给图表默认设置圆角
|
||||||
|
|||||||
@@ -86,7 +86,18 @@ namespace XCharts.Runtime
|
|||||||
/// The type of animation.
|
/// The type of animation.
|
||||||
/// ||动画类型。
|
/// ||动画类型。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AnimationType type { get { return m_Type; } set { m_Type = value; } }
|
public AnimationType type
|
||||||
|
{
|
||||||
|
get { return m_Type; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_Type = value;
|
||||||
|
if (m_Type != AnimationType.Default)
|
||||||
|
{
|
||||||
|
context.type = m_Type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to set graphic number threshold to animation. Animation will be disabled when graphic number is larger than threshold.
|
/// Whether to set graphic number threshold to animation. Animation will be disabled when graphic number is larger than threshold.
|
||||||
/// ||是否开启动画的阈值,当单个系列显示的图形数量大于这个阈值时会关闭动画。
|
/// ||是否开启动画的阈值,当单个系列显示的图形数量大于这个阈值时会关闭动画。
|
||||||
|
|||||||
@@ -1862,7 +1862,7 @@ namespace XCharts.Runtime
|
|||||||
serieData.context.highlight = flag;
|
serieData.context.highlight = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetBarWidth(float categoryWidth, int barCount = 0)
|
public float GetBarWidth(float categoryWidth, int barCount = 0, float defaultRate = 0.6f)
|
||||||
{
|
{
|
||||||
var realWidth = 0f;
|
var realWidth = 0f;
|
||||||
if (categoryWidth < 2)
|
if (categoryWidth < 2)
|
||||||
@@ -1871,7 +1871,7 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
else if (m_BarWidth == 0)
|
else if (m_BarWidth == 0)
|
||||||
{
|
{
|
||||||
var width = ChartHelper.GetActualValue(0.6f, categoryWidth);
|
var width = ChartHelper.GetActualValue(defaultRate, categoryWidth);
|
||||||
if (barCount == 0)
|
if (barCount == 0)
|
||||||
realWidth = width < 1 ? categoryWidth : width;
|
realWidth = width < 1 ? categoryWidth : width;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user