Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: TeeChart FastLineSeries with custom positioning marks



Permlink Replies: 3 - Last Post: Dec 12, 2016 9:49 AM Last Post By: Fred Fonar
Fred Fonar

Posts: 137
Registered: 3/16/00
TeeChart FastLineSeries with custom positioning marks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 6, 2016 4:31 PM
I used code below to set marks above series but it is not working - my marks if not fitting are showing above and below series line. Where should I put this code? I used it in GetMarkText, AfterDrawValues - no success.
var i: Integer;
begin
     for i := 0 to Series1.Marks.Positions.Count - 1 do
     with Series1.Marks.Positions.Position[i] do
     begin
          Custom := true;
          LeftTop.x := Series1.CalcXPos(i);
     end;
 
     Series1.Repaint;
end;
Yeray Alonso

Posts: 65
Registered: 6/12/11
Re: TeeChart FastLineSeries with custom positioning marks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2016 2:33 AM   in response to: Fred Fonar in response to: Fred Fonar
Hello Fred,

Fred Fonar wrote:
I used code below to set marks above series but it is not working - my marks if not fitting are showing above and below series line. Where should I put this code? I used it in GetMarkText, AfterDrawValues - no success.

You could use AfterDrawValues event forcing a chart repaint as follows:
procedure TForm1.Series1AfterDrawValues(Sender: TObject);
var i: Integer;
    afterDrawEvent: TNotifyEvent;
begin
  for i := 0 to Series1.Marks.Positions.Count - 1 do
    with Series1.Marks.Positions.Position[i] do
    begin
      Custom := true;
      LeftTop.x := Series1.CalcXPos(i);
    end;
 
  afterDrawEvent:=Series1.AfterDrawValues;
  Series1.AfterDrawValues:=nil;
  Chart1.Draw;
  Series1.AfterDrawValues:=afterDrawEvent;
end;


--
Best Regards,

Yeray Alonso
Steema Software
Facebook, Twitter, GPlus, LinkedIn, YouTube, GitHub, RSS
Support Options
David Berneda

Posts: 205
Registered: 5/5/98
Re: TeeChart FastLineSeries with custom positioning marks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2016 7:01 AM   in response to: Fred Fonar in response to: Fred Fonar
Fred Fonar wrote:
I used code below to set marks above series but it is not working - my marks if not fitting are showing above and below series line. Where should I put this code? I used it in GetMarkText, AfterDrawValues - no success.
var i: Integer;
begin
     for i := 0 to Series1.Marks.Positions.Count - 1 do
     with Series1.Marks.Positions.Position[i] do
     begin
          Custom := true;
          LeftTop.x := Series1.CalcXPos(i);
     end;
 
     Series1.Repaint;
end;

Maybe instead of this code you can disable the automatic positioning of non-fitting marks:

Series1.Marks.AutoPosition:=False;

regards
david
Fred Fonar

Posts: 137
Registered: 3/16/00
Re: TeeChart FastLineSeries with custom positioning marks
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 12, 2016 9:49 AM   in response to: David Berneda in response to: David Berneda
David Berneda wrote:
Fred Fonar wrote:
I used code below to set marks above series but it is not working - my marks if not fitting are showing above and below series line. Where should I put this code? I used it in GetMarkText, AfterDrawValues - no success.
var i: Integer;
begin
     for i := 0 to Series1.Marks.Positions.Count - 1 do
     with Series1.Marks.Positions.Position[i] do
     begin
          Custom := true;
          LeftTop.x := Series1.CalcXPos(i);
     end;
 
     Series1.Repaint;
end;

Maybe instead of this code you can disable the automatic positioning of non-fitting marks:

Series1.Marks.AutoPosition:=False;

regards
david

Thanks David, setting Marks.AutoPosition:=False is solving the issue, so no up/down marks shown - Thanks!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02