Page 1 of 1

Progamatically Setting Line Chart Properties

Posted: Fri Feb 20, 2004 2:27 am
by 8123840
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

Posted: Fri Feb 20, 2004 10:31 am
by Pep
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.