Empty Mark Text displays Value on Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Alex
Newbie
Newbie
Posts: 2
Joined: Tue Jun 21, 2005 4:00 am

Empty Mark Text displays Value on Chart

Post by Alex » Tue May 02, 2006 3:36 pm

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

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 May 03, 2006 11:14 am

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
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

Alex
Newbie
Newbie
Posts: 2
Joined: Tue Jun 21, 2005 4:00 am

Post by Alex » Wed May 03, 2006 12:48 pm

Hi Narcis,

thanks for your fast answer and the workaround!

Best regards

Alex

Post Reply