Left Axis scalling change

TeeChart for ActiveX, COM and ASP
Post Reply
M.Takeda
Newbie
Newbie
Posts: 18
Joined: Tue Aug 17, 2004 4:00 am

Left Axis scalling change

Post by M.Takeda » Sun Feb 06, 2005 2:16 am

(TChartAXPro V7)
In TChart Editor, Axis->Label->Format->ValueFormat->Percent does not work(Always Thousands if set to percent).How can I use this dialog ?

I wish to set left axis scale to actual min,max and percent(0-100) alternatively.
What property/method should be used and how to coding for it.
Please show me a small sample code.

Thanks in advance. Best Regards.

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

Post by Pep » Wed Feb 16, 2005 12:18 pm

Hi,
In TChart Editor, Axis->Label->Format->ValueFormat->Percent does not work(Always Thousands if set to percent).How can I use this dialog ?
You must add (or change the format) directly in the ValueFormat field.
ie : From #,##0.### to #,##0.### %
I wish to set left axis scale to actual min,max and percent(0-100) alternatively.
What property/method should be used and how to coding for it.
Please show me a small sample code.
You must do this manually, by "reformatting" axis labels after they are added to chart series. You can use the OnGetAxisLabel event to transform "normal" values to percent values. Something like this :

Code: Select all

Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
    If Axis = TChart1.Axis.Left Then
       ' 1. convert string in LabelText to double value
       ' 2. perform transformation on double value. In your case transform
       '     in to percentage
       ' 3. convert transformed value back to string and assign it to LabelText
    End If
End Sub

Post Reply