problems with TGanttSeries and LeftAxis Labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Friis
Newbie
Newbie
Posts: 23
Joined: Mon May 07, 2012 12:00 am

problems with TGanttSeries and LeftAxis Labels

Post by Friis » Tue Dec 04, 2012 10:08 am

Hi,

When making the code below, The marks seems to interfere with the LeftAxis Labels. I have attached a figure illustraing the problem. How can I avoid that??

Code: Select all

procedure TForm10.FormShow(Sender: TObject);
var
  I: Integer;
begin

Chart1.View3D := false;

     with Chart1.AddSeries(TGanttSeries.Create(self)) as TGanttSeries do
        begin
          ParentChart := Chart1;
          ShowInLegend := true;
          XValues.Order:=loNone;
          ShowInLegend := false;
          Marks.visible := true;
          Marks.Transparent := true;
          Xvalues.DateTime := true;
        end;

      for I := 0 to 9 do
        with Chart1[Chart1.SeriesCount -1] as TGanttSeries do
          begin
            Pointer.VertSize:=10;
            AddGanttcolor(now-5-i,now-5+i,i div 2,'',clred);
          end;

chart1.BottomAxis.SetMinMax(now-5,now+10);
end;
Attachments
TGanttProblems.JPG
TGanttProblems.JPG (72.77 KiB) Viewed 11062 times

Friis
Newbie
Newbie
Posts: 23
Joined: Mon May 07, 2012 12:00 am

Re: problems with TGanttSeries and LeftAxis Labels

Post by Friis » Tue Dec 04, 2012 10:09 am

The problem seems to be related to the problem with

Code: Select all

Marks.Transparent := true;

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: problems with TGanttSeries and LeftAxis Labels

Post by Yeray » Tue Dec 04, 2012 2:33 pm

Hi,
Friis wrote:How can I avoid that??
It depends. How do you want to avoid that?
- Do you want the left axis labels not to be drawn? You can hide them setting a blank space in the string given at the OnGetAxisLabel event. Here it is a .NET example, but the same applies to VCL.
- Do you want the gantt marks to be drawn elsewhere? You can set a different bottom axis scale, or you can manually set the marks positions as shown here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Friis
Newbie
Newbie
Posts: 23
Joined: Mon May 07, 2012 12:00 am

Re: problems with TGanttSeries and LeftAxis Labels

Post by Friis » Tue Dec 04, 2012 3:07 pm

Hi Yeray,

Actually, what I would like is that, that part of the marks that are "outside" of the Chart area is not being shown. So that the area with the Left Axis Labels does not show the marks at all.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: problems with TGanttSeries and LeftAxis Labels

Post by Yeray » Tue Dec 04, 2012 3:42 pm

Hi Friis,

This is a clipping, isn't it? There's a property for it: Marks.Clip

Code: Select all

  with Chart1.AddSeries(TGanttSeries) as TGanttSeries do
  begin
    ParentChart := Chart1;
    ShowInLegend := true;
    XValues.Order:=loNone;
    ShowInLegend := false;
    Marks.visible := true;
    Marks.Transparent := true;
    Xvalues.DateTime := true;
    OnGetMarkText:=GetMarkText;
    Marks.Clip:=true;
  end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Friis
Newbie
Newbie
Posts: 23
Joined: Mon May 07, 2012 12:00 am

Re: problems with TGanttSeries and LeftAxis Labels

Post by Friis » Wed Dec 05, 2012 12:50 pm

Hi Yeray,

I didn't know that property existed - Thank you; it works fantatsic know :D

Post Reply