Page 1 of 1

Empty Mark Text displays Value on Chart

Posted: Tue May 02, 2006 3:36 pm
by 9637245
Hi!

Little problem: I only want to see on defined points custom mark text, the other marks should not be visible in the chart.

e.g.:

Code: Select all

        With TChart1
            .Series.Clear()
            .Aspect.View3D = False

            Dim Test_ As New Steema.TeeChart.Styles.Line(.Chart)
            With Test_
                .Add(-10, 50, "Maximum")
                .Add(0, 20, "")
                .Add(10, 25, "Local Max")
                .Add(20, 20, "")
                .Add(30, -10, "Minimum")
            End With

            With Test_.Marks
                .Visible = True
                .Style = Steema.TeeChart.Styles.MarksStyles.Label
            End With

            .Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value

        End With
In this example the empty strings on Point 2 and 4 are ignored and a mark is displayed on the chart. Is it possible to adjust the chart to not display the empty marks? I calculate in a different sub wheter the actual point is an extrem point or not and adjust the label according the result...

Thanks in advance!

Alex

Posted: Wed May 03, 2006 11:14 am
by narcis
Hi Alex,

I could reproduce the problem here and added the issue (TF02011394) to our defect list to be fixed for future releases. In the meantime, a workaround is using the series' GetSeriesMark event as shown here:

Code: Select all

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With TChart1
            .Series.Clear()
            .Aspect.View3D = False

            Dim Test_ As New Steema.TeeChart.Styles.Line(.Chart)
            With Test_
                .Add(-10, 50, "Maximum")
                .Add(0, 20, "")
                .Add(10, 25, "Local Max")
                .Add(20, 20, "")
                .Add(30, -10, "Minimum")
                AddHandler .GetSeriesMark, AddressOf Test__GetSeriesMark

            End With

            With Test_.Marks
                .Visible = True
                .Style = Steema.TeeChart.Styles.MarksStyles.Label
            End With

            .Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value

        End With
    End Sub

    Private Sub Test__GetSeriesMark(ByVal series As Steema.TeeChart.Styles.Series, ByVal e As Steema.TeeChart.Styles.GetSeriesMarkEventArgs)
        If e.MarkText.Length < 5 Then e.MarkText = ""
    End Sub

Posted: Wed May 03, 2006 12:48 pm
by 9637245
Hi Narcis,

thanks for your fast answer and the workaround!

Best regards

Alex