Making custom axis visible

TeeChart for ActiveX, COM and ASP
Post Reply
bluebird
Newbie
Newbie
Posts: 2
Joined: Thu Nov 03, 2005 5:00 am

Making custom axis visible

Post by bluebird » Wed Nov 08, 2006 4:43 pm

We have upgraded form TeeChart v5 to v7 and code that used to make a custom axis and its grid visible now doesn't work anymore. It is meant to be a vertical axis (I'm not sure why the left axis isn't used instead!) The real code is a bit complicated but I've got two routines: one to set the left axis and one to set the custom axis. The one that sets the left works but the one for the custom one doesn't. What am I missing here??

Code: Select all

Private Sub Check1_Click(Index As Integer)
Debug.Print "Index is " & Index
If Check1(Index).Value = vbChecked Then
    If gbDarkBackground Then
        frmPI.TChart(Index).Axis.Custom(0).GridPen.Color = DARK_GRID_COLOUR
    Else
        frmPI.TChart(Index).Axis.Custom(0).GridPen.Color = LIGHT_GRID_COLOUR
    End If
    frmPI.TChart(Index).Axis.Custom(0).SetMinMax 0, 4
    frmPI.TChart(Index).Axis.Custom(0).Increment = 1
    frmPI.TChart(Index).Axis.Custom(0).GridPen.Visible = True
    frmPI.TChart(Index).Axis.Custom(0).Visible = True
    frmPI.TChart(Index).Axis.Custom(0).AxisPen.Visible = True
    frmPI.TChart(Index).Axis.Custom(0).Labels.Visible = False
    
Else
    frmPI.TChart(Index).Axis.Custom(0).GridPen.Visible = False
    frmPI.TChart(Index).Axis.Custom(0).Visible = True
    frmPI.TChart(Index).Axis.Custom(0).AxisPen.Visible = True
    frmPI.TChart(Index).Axis.Custom(0).Ticks.Visible = False
    frmPI.TChart(Index).Axis.Custom(0).Labels.Visible = False
End If
End Sub
Private Sub Check1_Click_old(Index As Integer)
Debug.Print "Index is " & Index
If Check1(Index).Value = vbChecked Then
    If gbDarkBackground Then
        frmPI.TChart(Index).Axis.Left.GridPen.Color = DARK_GRID_COLOUR
    Else
        frmPI.TChart(Index).Axis.Left.GridPen.Color = LIGHT_GRID_COLOUR
    End If
    frmPI.TChart(Index).Axis.Left.SetMinMax 0, 4
    frmPI.TChart(Index).Axis.Left.Increment = 1
    frmPI.TChart(Index).Axis.Left.GridPen.Visible = True
    frmPI.TChart(Index).Axis.Left.Visible = True
    frmPI.TChart(Index).Axis.Left.AxisPen.Visible = True
    frmPI.TChart(Index).Axis.Left.Labels.Visible = False
    
Else
    frmPI.TChart(Index).Axis.Left.GridPen.Visible = False
    frmPI.TChart(Index).Axis.Left.Visible = True
    frmPI.TChart(Index).Axis.Left.AxisPen.Visible = True
    frmPI.TChart(Index).Axis.Left.Ticks.Visible = False
    frmPI.TChart(Index).Axis.Left.Labels.Visible = False
End If
End Sub
Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 08, 2006 5:38 pm

Hi bluebird,

Do you have any series assigned to this custom axis? For example:

Code: Select all

    TChart1.Series(0).VerticalAxisCustom = 0
This code sets the first series vertical axis to the first custom axis.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

bluebird
Newbie
Newbie
Posts: 2
Joined: Thu Nov 03, 2005 5:00 am

Post by bluebird » Thu Nov 09, 2006 11:37 am

Thanks. That solved the problem!

Post Reply