Alternative labels on right axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Stephan
Newbie
Newbie
Posts: 3
Joined: Tue Apr 21, 2009 12:00 am

Alternative labels on right axis

Post by Stephan » Wed Apr 22, 2009 9:25 pm

I have box plot graph with numerical values on the left axis running from 1 to 10. On the right axis I would like to display text descriptions instead of numbers 1 to 10. Can be achieved? If yes, how?
Regards,
Stephan

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

Post by Yeray » Thu Apr 23, 2009 7:52 am

Hi Stephan,

If you have labels in your points and you want to show them, you simply need this:

Code: Select all

  Series1.VertAxis := aBothVertAxis;
  Chart1.Axes.Right.LabelStyle := talText;
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

Stephan
Newbie
Newbie
Posts: 3
Joined: Tue Apr 21, 2009 12:00 am

Post by Stephan » Thu Apr 23, 2009 8:27 am

Thanks for quick response. Unfortunately it's not quite what I looking for.
In the picture (see url) you will see the numbers 5, 6 and 7 on the left Y-axis. On the right axis I would like to show text descriptions for the three numbers.
http://www.synbiosys.alterra.nl/download/boxplot.png
Is that possible?
Regards,
Stephan

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

Post by Yeray » Thu Apr 23, 2009 11:35 am

Hi Stephan,

If I understand well you would like to show a custom text in the right axis at the same Y position than the left axis labels. In that case, the easiest way could be using OnGetAxisLabel to customize your labels:

Code: Select all

procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
  Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
  if ((sender = Chart1.Axes.Right) and (LabelText = '6')) then
    LabelText := 'my description';
end;
Note that you should activate the right axis for the series. Something as said before:

Code: Select all

Series1.VertAxis := aBothVertAxis;
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

Stephan
Newbie
Newbie
Posts: 3
Joined: Tue Apr 21, 2009 12:00 am

Post by Stephan » Thu Apr 23, 2009 12:14 pm

Excellent. That does the job!
Regards,
Stephan

Post Reply