PlotLab VCL
Axis Tick Labels
Thread Starter: Orlando Started: 7/27/2007 4:23 PM UTC
Replies: 4
Axis Tick Labels
Does anyone know how to change axis tock labels.
The "What's New" for 3.0 release of Plot lab says "Added custom axis labels", but there's no example of how to do this. Specifically, I would like to be able to change the tick labels to whatever I'd like.  Is this really possible? If so, then how?
This is a showstopper for me.

Anyone?

Orlando
Re: Axis Tick Labels
Hi Orlando,

Use the XAxis.OnCustomLabel and YAxis.OnCustomLabel. If you use Delphi here
is example code:

procedure TForm1.SLScope1XAxisCustomLabel(Sender: TObject;
  SampleValue: Real; var AxisLabel: String);
begin
  AxisLabel := 'Label' + Format( '%.2f', [ SampleValue ] );
end;

With best regards,
  Boian Mitov

Orlando wrote:
Does anyone know how to change axis tock labels.
The "What's New" for 3.0 release of Plot lab says "Added custom axis labels", but there's no example of how to do this. Specifically, I would like to be able to change the tick labels to whatever I'd like.  Is this really possible? If so, then how?
This is a showstopper for me.
Anyone?
Orlando  
Re: Axis Tick Labels
Seems lake a good solution. But how to do it under Visual Studio 2003 ?

Re: Axis Tick Labels

I tryied to do the same using Visual Studio 2003 (MFC) but it didn't work. I switched to .Net and it looks that implementation is quite simple I'm starting to work with.

Re: Axis Tick Labels
Hi Marcus,

You can also do it in MFC, however you need to use the SetTickText in the callback:

void __stdcall CAdvancedScopeDlg::OnCustomXAxesLabel( void *Sender, double Value, CString & )
{
if( m_CustomLabelXCheck.GetCheck() != 0 )
{
CString str;
str.Format( "Sample : %d", (int)( Value + 0.5 ));

Scope.XAxis.SetTickText( str );
}
}

This is a MFC specific issue.

With best regards,
  Boian Mitov

Markus wrote:
I tryied to do the same using Visual Studio 2003 (MFC) but it didn't work. I switched to .Net and it looks that implementation is quite simple I'm starting to work with.