Having same width on all TSeriesMarks

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
JohanI
Newbie
Newbie
Posts: 5
Joined: Fri Jun 29, 2007 12:00 am

Having same width on all TSeriesMarks

Post by JohanI » Thu Feb 25, 2010 1:20 pm

Hi all,

I have run into a "strange" problem, im using a chart with a couple of TSeriesMarks, I only show the marks in the chart, no values etc... but what I want is that all Marks should have the same width, but setting the witdh property on the series TSeriesMarks or setting it on each mark individually doesnt seem to work. The widths still vary between the different marks.Ive set the width property to the series MaxMarkWidth property which in this case is 106. Have i missed something fundamental?

Best Regards,

Johan Ingemansson

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

Re: Having same width on all TSeriesMarks

Post by Yeray » Thu Feb 25, 2010 4:29 pm

Hi Johan,

You should change TSeriesMarks' TSeriesMarksPositions' widths. Here it is an example:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var Series1: TPointSeries;
    i: Integer;
begin
  Chart1.View3D:=false;

  Series1:=Chart1.AddSeries(TPointSeries.Create(self)) as TPointSeries;
  Series1.Add(10);
  Series1.Add(10.1256546456);
  Series1.Add(5);
  Series1.Add(15);

  Series1.Marks.Visible:=true;
  Series1.ValueFormat:='#.##########';
  Series1.Pointer.Visible:=false;

  Chart1.Draw;

  for i:=0 to Series1.Count-1 do
  begin
    Series1.Marks.Positions[i].Custom:=true;
    Series1.Marks.Positions[i].Width:=Series1.MaxMarkWidth+10;
  end;
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

Post Reply