Using Chart Tools on the Fly lazarus / 55-TAChart ---------------------------------------------------------------------- chucky · 2013-06-02 04:54 I am trying to create a form with a TChart object on the fly also with chart tools. I am using 1.0.8 which has a builtin zoom but not a builtin pan. The relevant code in the class   TForm1 = class(TForm)     Chart                      : TChart;     Toolset                     :TChartToolset;     PanDragTool             : TPanDragTool;     ZoomDragTool          : TZoomDragTool;   end; The relevant code in the constructor: Constructor TForm1.Create(AOwner : TComponent); Begin   Chart := TChart.Create(Self); // ---------------------------- Chart Tool Set   ToolSet := TChartToolset.Create(Self);   Chart.ToolSet := ToolSet;    // This assignment will set activetool count to -1     ZoomDragTool := TZoomDragTool.Create(ToolSet);   ZoomDragTool.Shift := [ssLeft];     PanDragTool := TPanDragTool.Create(ChartToolSet);   PanDragTool.Shift := [ssRight]; end; The program builds the chart and displays data correctly but no zooming and and no panning. The default zooming works again if I comment out the line:   Chart.ToolSet := ToolSet; Apparently I am not enabling or registering something correctly. Can anyone help???? ---------------------------------------------------------------------- chucky · 2013-06-02 05:39 I solved my problem. The zoom and pan toos need to point back to the tool set like this:   ZoomDragTool := TZoomDragTool.Create(ToolSet); ***  ZoomDragTool.ToolSet := ToolSet; ***   ZoomDragTool.Shift := [ssLeft];     PanDragTool := TPanDragTool.Create(ChartToolSet); ***  PanDragTool.ToolSet := ToolSet ***   PanDragTool.Shift := [ssRight]; Now both Zoomming and Panning works!!!