Progamatically Setting Line Chart Properties

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
chipshot
Newbie
Newbie
Posts: 18
Joined: Fri Feb 13, 2004 5:00 am

Progamatically Setting Line Chart Properties

Post by chipshot » Fri Feb 20, 2004 2:27 am

I am having difficulty setting the style for simple line charts. Does anybody have any simple sample code?

Why is it that I can control the width and style of the line with the following code but it won't set the color?

Dim Line_LCL As New Steema.TeeChart.Styles.Line(WebChart1.Chart)
With Line_LCL.LinePen
.Width = 2
.Color = Color.Orange
.Style = Drawing.Drawing2D.DashStyle.Dash
End With

I have to later go in and set the color with:

.Series(3).Color = Color.Orange

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 20, 2004 10:31 am

Hi,
I am having difficulty setting the style for simple line charts. Does anybody have any simple sample code?
A simple example could be :

Code: Select all

        Dim Line_LCL As New Steema.TeeChart.Styles.Line(WebChart1.Chart)
        Line_LCL.FillSampleValues(10)
        WebChart1.Chart.Aspect.View3D = False
        With Line_LCL
            .LinePen.Width = 10
            .LinePen.Style = Drawing2D.DashStyle.Dash
            .Color = Color.Orange
        End With
Why is it that I can control the width and style of the line with the following code but it won't set the color?
This depends if you're are working in 2D or 3D mode, the LinePen.Color property is used to set the color of the Outline that appears in 3D mode, so to change the color of the Series you always should use the Series.Color property.

Post Reply