Page 1 of 1

Having same width on all TSeriesMarks

Posted: Thu Feb 25, 2010 1:20 pm
by 10545837
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

Re: Having same width on all TSeriesMarks

Posted: Thu Feb 25, 2010 4:29 pm
by yeray
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;