Page 1 of 1

Left Axis scalling change

Posted: Sun Feb 06, 2005 2:16 am
by 9523566
(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.

Posted: Wed Feb 16, 2005 12:18 pm
by Pep
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