Page 1 of 1

Inherit steema.teechart.styles.line

Posted: Mon Dec 05, 2005 9:52 am
by 8129334
i’m working with the TeeChart .Net Version and Visual Basic .NET.
I have a problem when I try to inherit from the styles.line object.

The tool shows the series correct, but when I start the built-in editor, there’s no graphic icon for the series and when I want to look up the properties for the series the application crashes.

Here’s my source code: (reduced to a minimum)

“””

Public Class Form1
Inherits System.Windows.Forms.Form

Public Sub New()
MyBase.New()
dim chart As New Steema.TeeChart.TChart
chart.Series.Add(New Line)
chart.Series(0).FillSampleValues(20)
End sub
End class

Public Class Line
Inherits Steema.TeeChart.Styles.Line

Public Sub New()
MyBase.new()
End Sub
End Class

Posted: Mon Dec 05, 2005 10:06 am
by narcis
Hi,

It works fine for me here using the code below. Can you please test if this works for you?

Code: Select all

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(696, 533)
        Me.Name = "Form1"
        Me.Text = "Form1"

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim chart As New Steema.TeeChart.TChart
        chart.Parent = Me
        chart.Series.Add(New Line)
        chart.Series(0).FillSampleValues(20)
    End Sub
End Class

Public Class Line
    Inherits Steema.TeeChart.Styles.Line

    Public Sub New()
        MyBase.new()
    End Sub
End Class

Posted: Mon Dec 05, 2005 10:25 am
by 8129334
Hi,

Thanks for your help.
I tested it, and work as well as my code.
I can see the series and the series points, but when i run the editor in run-time and try to click on the series tab, the application crashes.

the error description:
"""
Eine nicht behandelte Ausnahme des Typs 'System.IndexOutOfRangeException' ist in teechart.dll aufgetreten.

Zusätzliche Informationen: Der Index war außerhalb des Arraybereichs.
"""

Posted: Mon Dec 05, 2005 11:00 am
by 8129334
When i first change the style in the editor to line and then try to click on the series tab, everything is okay.

Posted: Mon Dec 05, 2005 11:31 am
by narcis
Hi,

Yes, this is because the editor dialogs are specific for each series type because each series type has different properties and methods. As you created a custom series type, editor dialogs for that series type doesn't exist and that's why you get that error.

To be able to edit your custom series via the chart editor you should customize so that it supports your custom series types. To customize the chart editor you should purchase TeeChart for .NET source code which is available as an option.

Posted: Mon Dec 05, 2005 12:02 pm
by 8129334
Okay. Thanks for your help.