mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
3.0
This commit is contained in:
@@ -14,20 +14,19 @@ namespace XCharts.Runtime
|
||||
{
|
||||
List<List<SerieData>> m_StackSerieData = new List<List<SerieData>>();
|
||||
private GridCoord m_SerieGrid;
|
||||
private float m_LastLineWidth = 0f;
|
||||
|
||||
private void UpdateSerieGridContext()
|
||||
{
|
||||
if (m_SerieGrid == null)
|
||||
return;
|
||||
|
||||
var needCheck = (chart.isPointerInChart && m_SerieGrid.IsPointerEnter()) || m_LegendEnter;
|
||||
var lineWidth = 0f;
|
||||
var lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
|
||||
var needCheck = (chart.isPointerInChart && m_SerieGrid.IsPointerEnter()) || m_LegendEnter || m_LastLineWidth != lineWidth;
|
||||
if (!needCheck)
|
||||
{
|
||||
if (m_LastCheckContextFlag != needCheck)
|
||||
{
|
||||
var needAnimation1 = false;
|
||||
lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
|
||||
m_LastCheckContextFlag = needCheck;
|
||||
serie.context.pointerItemDataIndex = -1;
|
||||
serie.context.pointerEnter = false;
|
||||
@@ -49,11 +48,10 @@ namespace XCharts.Runtime
|
||||
}
|
||||
return;
|
||||
}
|
||||
m_LastLineWidth = lineWidth;
|
||||
m_LastCheckContextFlag = needCheck;
|
||||
var themeSymbolSize = chart.theme.serie.lineSymbolSize;
|
||||
var themeSymbolSelectedSize = chart.theme.serie.lineSymbolSelectedSize;
|
||||
lineWidth = serie.lineStyle.GetWidth(chart.theme.serie.lineWidth);
|
||||
|
||||
var needInteract = false;
|
||||
if (m_LegendEnter)
|
||||
{
|
||||
|
||||
@@ -998,11 +998,22 @@ namespace XCharts.Runtime
|
||||
get
|
||||
{
|
||||
double total = 0;
|
||||
var duration = animation.GetUpdateAnimationDuration();
|
||||
foreach (var sdata in data)
|
||||
if (IsPerformanceMode())
|
||||
{
|
||||
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
||||
total += sdata.GetCurrData(1, duration);
|
||||
foreach (var sdata in data)
|
||||
{
|
||||
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
||||
total += sdata.data[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var duration = animation.GetUpdateAnimationDuration();
|
||||
foreach (var sdata in data)
|
||||
{
|
||||
if (sdata.show && !IsIgnoreValue(sdata.data[1]))
|
||||
total += sdata.GetCurrData(1, duration);
|
||||
}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
@@ -1590,14 +1601,11 @@ namespace XCharts.Runtime
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为性能模式。只有折线图和柱状图才有性能模式。性能模式下不绘制Symbol,不刷新Label,不单独设置数据项配置。
|
||||
/// 是否为性能模式。性能模式下不绘制Symbol,不刷新Label,不单独设置数据项配置。
|
||||
/// </summary>
|
||||
public bool IsPerformanceMode()
|
||||
{
|
||||
if (IsSerie<Line>() || IsSerie<Bar>())
|
||||
return m_Large && m_Data.Count > m_LargeThreshold;
|
||||
else
|
||||
return false;
|
||||
return m_Large && m_Data.Count > m_LargeThreshold;
|
||||
}
|
||||
|
||||
public bool IsLegendName(string legendName)
|
||||
|
||||
Reference in New Issue
Block a user