Skip to content

Commit

Permalink
initialize/dispose tooltips and legends from core.
Browse files Browse the repository at this point in the history
fixes a new issue introduced with the new changes, because the older versions of tooltips where disposed/created evetime the data changed, now tooltips are cached and only updated when necessary,  we need to handle the creation/diposing when the control is loaded/disposed.
  • Loading branch information
beto-rodriguez committed Dec 15, 2024
1 parent fb6bf34 commit 3b17e68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/LiveChartsCore/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ public virtual void Load()
{
IsLoaded = true;
_isFirstDraw = true;
View.Tooltip = LiveCharts.DefaultSettings.GetTheme().DefaultTooltip();
View.Legend = LiveCharts.DefaultSettings.GetTheme().DefaultLegend();
Update();
}

Expand All @@ -307,6 +309,8 @@ public virtual void Load()
public virtual void Unload()
{
IsLoaded = false;
View.Tooltip = null;
View.Legend = null;
_everMeasuredElements.Clear();
_toDeleteElements.Clear();
_activePoints.Clear();
Expand Down

0 comments on commit 3b17e68

Please sign in to comment.