[SOLVED] DataPointDistanceTool programmatically clear result lazarus / 55-TAChart ---------------------------------------------------------------------- mig-31 · 2019-09-24 15:57 Hi, I set DataPointDistanceTool.Options to dpdoPermanent  to leave the result of distance measurement in the TChart. I need to clear(remove) distance measurement (distance line, label mark...) from the TChart programmatically for example on Button.Click event. I go through the DataPointDistanceTool code, but don't see where is it. It should be there, because clearing is done automatically, when the DataPointDistanceTool.Options sets to [].  How can I do this? Thank you. ---------------------------------------------------------------------- wp · 2019-09-24 16:51 Difficult... At first I thought of "Hide", but this works only when the tool is active. Finally I had the idea to destroy and recreate the tool. This works. But it seems that the "Assign" of the TDataPointDistanceTools has not been implemented, and some properties have to be transferred manually: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  t: TDataPointDistanceTool;begin  t := TDataPointDistanceTool.Create(Chart Toolset1DataPointDistanceTool1.Owner);  t.Assign(ChartToolset1DataPointDistanceTool1);  t.DrawingMode := ChartToolset1DataPointDistanceTool1.DrawingMode;  t.Options := ChartToolset1DataPointDistanceTool1.Options;  // transfer more properties here...  ChartToolset1DatapointDistanceTool1.Free;  ChartToolset1DataPointDistanceTool1 := t;  ChartToolset1DataPointDistanceTool1.Toolset := ChartToolSet1;  Chart1.Invalidate;end; [EDIT] Above text is a translation of my original answer which inicidentally had been in German: QuoteSchwierig... Zunächst dachte ich "Hide", aber das funktioniert nur, solange das Tool aktiv ist. Schließlich bin ich darauf gekommen, dass man das Tool zerstören und wieder erzeugen könnte. Das funktioniert, nur ist anscheinend das "Assign" beim DataPointDistanceTool nicht implementiert und man muss einige Properties von Hand übertragen ---------------------------------------------------------------------- mig-31 · 2019-09-25 08:11 Thank you. I don't speak German, but Google Translator helped me I also think by this way, but I try to find "more elegant" way. ---------------------------------------------------------------------- wp · 2019-09-25 08:25 OMG - I am writing too many posts... Replaced the text by an English version.