Page 1 of 1

Alternative labels on right axis

Posted: Wed Apr 22, 2009 9:25 pm
by 10052969
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

Posted: Thu Apr 23, 2009 7:52 am
by yeray
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;

Posted: Thu Apr 23, 2009 8:27 am
by 10052969
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

Posted: Thu Apr 23, 2009 11:35 am
by yeray
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;

Posted: Thu Apr 23, 2009 12:14 pm
by 10052969
Excellent. That does the job!
Regards,
Stephan