Page 1 of 1

How to set line's color to black?

Posted: Wed Jul 02, 2008 3:20 am
by 14048132
When I add one line to TChart,and set it color with black.
It will looks like the orange color.

But, if set series.Color = Color.Red . It will show the red color.

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line
        Dim dMin, dMax As Double
        Me.TChart1.Axes.Left.CalcMinMax(dMin, dMax)
        series.Add(5, dMin)
        series.Add(5, dMax)
        series.Color = Color.Black
        Me.TChart1.Series.Add(series)
How to set line's color to black?

Posted: Wed Jul 02, 2008 8:44 am
by narcis
Hi Chris,

You should try creating series like this:

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
And comment in this line:

Code: Select all

        'Me.TChart1.Series.Add(series)

Posted: Wed Jul 02, 2008 9:40 am
by 14048132
Thanks for your quick response.

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        'Dim series As New Steema.TeeChart.Styles.Line
        Dim dMin, dMax As Double
        Me.TChart1.Axes.Left.CalcMinMax(dMin, dMax)
        series.Add(5, dMin)
        series.Add(5, dMax)
        series.Color = Color.Black
        'Me.TChart1.Series.Add(series)
The line's color is black. But, if add some codes below.

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        'Dim series As New Steema.TeeChart.Styles.Line
        Dim dMin, dMax As Double
        Me.TChart1.Axes.Left.CalcMinMax(dMin, dMax)
        series.Add(5, dMin)
        series.Add(5, dMax)
        series.Color = Color.Black
        'Me.TChart1.Series.Add(series)
        TChart1.Series.Groups.Add("GRP1")
        TChart1.Series.Groups.FindByName("GRP1", True).Series.Add(series)
It shows the orange.

Posted: Wed Jul 02, 2008 9:45 am
by narcis
Hi Chris,

In that case you can use this:

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        'Dim series As New Steema.TeeChart.Styles.Line
        Dim dMin, dMax As Double
        dMin = 5
        dMax = 15
        Me.TChart1.Axes.Left.CalcMinMax(dMin, dMax)
        series.Add(5, dMin)
        series.Add(15, dMax)
        'series.Color = Color.Black
        'Me.TChart1.Series.Add(series)
        TChart1.Series.Groups.Add("GRP1")
        TChart1.Series.Groups.FindByName("GRP1", True).Series.Add(series)
        TChart1.Series.Groups.FindByName("GRP1", True).Series.Item(0).Color = Color.Black