Search code examples
delphidelphi-xe2teechart

Delphi XE2 and TeeChart 9


i download TeeChart Pro v2012 Evaluation, i'm working with Delphi XE2. I run the demo exe i found with the product, and i tried to reproduce the code about Gantt charts, more precisely the part to drag and drop the element of the Gantt. I got the following error: "TGanttTool is not declared" I was unable to find this object anywhere in the code, any idea?


Solution

  • It seems to work fine for me here. Simplifying the Mouse dragging example to the maximum, creating everything at runtime, here it is the minimum code to have a Gantt dragging example. Does it work for you?

    uses VCLTee.Chart, VCLTee.GanttCh, VCLTee.TeeGanttTool;
    
    var Chart1 : TChart;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Chart1:=TChart.Create(Self);
      Chart1.Parent:=Self;
      Chart1.Align:=alClient;
    
      Chart1.View3D:=False;
      Chart1.Zoom.Allow:=False;
    
      with Chart1.AddSeries(TGanttSeries) as TGanttSeries do
      begin
        FillSampleValues(5);
        Marks.Visible:=True;
      end;
    
      (Chart1.Tools.Add(TGanttTool) as TGanttTool).Series:=Chart1[0];
    end;
    

    Maybe the problem is just in the paths in your IDE. Please check there aren't wrong references present in the library/search path. And check the correct ones (referencing TeeChart) are ont he top of the lists.