This commit is contained in:
monitor1394
2022-03-18 08:23:17 +08:00
parent 407b3625d7
commit 4e24ba7922
16 changed files with 166 additions and 114 deletions

View File

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

View File

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