mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 03:58:49 +00:00
[feature][pie] support onPointerEnterPie
This commit is contained in:
@@ -123,6 +123,10 @@ namespace XCharts.Runtime
|
||||
serieData.context.highlight = false;
|
||||
serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor);
|
||||
}
|
||||
if (chart.onPointerEnterPie != null)
|
||||
{
|
||||
chart.onPointerEnterPie(serie.index, serie.context.pointerItemDataIndex);
|
||||
}
|
||||
if (needInteract)
|
||||
{
|
||||
chart.RefreshPainter(serie);
|
||||
@@ -131,8 +135,9 @@ namespace XCharts.Runtime
|
||||
return;
|
||||
}
|
||||
m_LastCheckContextFlag = needCheck;
|
||||
serie.context.pointerItemDataIndex = -1;
|
||||
var lastPointerItemDataIndex = serie.context.pointerItemDataIndex;
|
||||
var dataIndex = GetPiePosIndex(serie, chart.pointerPos);
|
||||
serie.context.pointerItemDataIndex = -1;
|
||||
for (int i = 0; i < serie.dataCount; i++)
|
||||
{
|
||||
var serieData = serie.data[i];
|
||||
@@ -154,6 +159,14 @@ namespace XCharts.Runtime
|
||||
serieData.interact.SetValueAndColor(ref needInteract, serieData.context.outsideRadius, color, toColor);
|
||||
}
|
||||
}
|
||||
if (lastPointerItemDataIndex != serie.context.pointerItemDataIndex)
|
||||
{
|
||||
needInteract = true;
|
||||
if (chart.onPointerEnterPie != null)
|
||||
{
|
||||
chart.onPointerEnterPie(serie.index, serie.context.pointerItemDataIndex);
|
||||
}
|
||||
}
|
||||
if (needInteract)
|
||||
{
|
||||
chart.RefreshPainter(serie);
|
||||
|
||||
Reference in New Issue
Block a user