Left Axis Labels

TeeChart for ActiveX, COM and ASP
Post Reply
Ninj
Newbie
Newbie
Posts: 17
Joined: Wed Jun 16, 2004 4:00 am
Location: Singapore

Left Axis Labels

Post by Ninj » Mon Jul 26, 2004 8:44 am

Hi,

I have been trying to format the label of the left axis, i.e. from 25,000,000 to 25M, 3500 to 3.5K. My goal is to maximize the space in the chart. I am able to do this through the OnGetAxisLabel event. However, after the labels are formatted, the width of the label does not change which defies the purpose of doing so.
Isn't the label width supposed to change according to the width of the maximum width of the new labels?

Thanks,

Nina

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 26, 2004 9:22 am

Hi Nina,

to change the width automatically depending on the widh of the labels you can use :

Code: Select all

Private Sub TChart1_OnSeriesBeforeAdd(ByVal SeriesIndex As Long, MoreValues As Boolean)
  TChart1.Axis.Left.Labels.Size = TChart1.Axis.Left.Labels.Width(TChart1.Axis.Left.Maximum)
End Sub

Ninj
Newbie
Newbie
Posts: 17
Joined: Wed Jun 16, 2004 4:00 am
Location: Singapore

Post by Ninj » Mon Jul 26, 2004 9:31 am

Hi,

Thanks for the prompt reply.

Nina

Post Reply