Page 1 of 1

Determine if custom axis is visible.

Posted: Fri Oct 17, 2014 1:53 pm
by 13052810

I'm using TeeChart Pro v2013.
Using FastLine.

When a series is assigned to a custom vertical axis, the axis will only be visible if the series is active. This also applies to assigning multiple series to a single axis.

When there is no active series, the axis becomes invisible.

How can I detect when the custom axis turns invisible?

I have tried this:

This does not change when a "no active series" condition causes the axis to become invisible.


Re: Determine if custom axis is visible.

Posted: Fri Oct 17, 2014 2:33 pm
by narcis
Hi tirby,

You can do it manually like this:

Code: Select all

Private Sub Form_Load()

    TeeCommander1.ChartLink = TChart1.ChartLink
    TChart1.Aspect.View3D = False
    TChart1.Legend.CheckBoxes = True
    Dim CustomAxis As Integer
    CustomAxis = TChart1.Axis.AddCustom(False)
    For i = 0 To 5
        TChart1.AddSeries scLine
        If i Mod 2 = 0 Then
            TChart1.Series(i).VerticalAxisCustom = CustomAxis
        End If
    TChart1.Axis.Left.EndPosition = 50
    TChart1.Axis.Custom(CustomAxis).StartPosition = 50
End Sub

Private Sub TChart1_OnClickLegend(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    For i = 0 To TChart1.Axis.CustomCount - 1
        Dim AxisVisible As Boolean
        AxisVisible = False
        For j = 0 To TChart1.SeriesCount - 1
            If ((TChart1.Series(j).VerticalAxisCustom = i) And (TChart1.Series(j).Active)) Then
                AxisVisible = True
            End If
        Dim text As String
        If AxisVisible Then
            text = "Custom Axis " & CStr(i) & " is VISIBLE"
            text = "Custom Axis " & CStr(i) & " is NOT visible"
        End If
        List1.AddItem text
End Sub