Page 1 of 1

Point sytle color problem

Posted: Fri Jun 24, 2005 8:01 am
by 8125487
Please try below the code
the point chart color should be blue right?
but is showing red color.


TChart.Series.Add(New Steema.TeeChart.Styles.Bar)
TChart.Series(0).FillSampleValues(6)
TChart.Series(0).Color = Color.Blue
TChart.Series(0).ColorEach = False

Dim objChartStyle As New Steema.TeeChart.Styles.Points
TChart.Series(0).ChangeType(TChart.Series(0), objChartStyle.GetType)

Posted: Tue Jun 28, 2005 2:01 pm
by narcis
Hi Cliven,

You should use the code below to achieve what you request. Notice that using next TeeChart for .NET v2 releases you will be able to remove the last line as commented.

Code: Select all

    Private Bar1 As Steema.TeeChart.Styles.Bar
    Private Points1 As Steema.TeeChart.Styles.Points

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Bar1 = New Steema.TeeChart.Styles.Bar(TChart.Chart)
        For i As Integer = 0 To 10
            Bar1.Add(Rnd(100), Color.Blue)
        Next
        Bar1.Color = Color.Blue
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim S As Steema.TeeChart.Styles.Series = Bar1
        Dim T As System.Type = GetType(Steema.TeeChart.Styles.Points)
        Steema.TeeChart.Styles.Series.ChangeType(S, T)
        Points1 = TChart.Series(0)
        Points1.Color = Bar1.Color 'this line won't be necessary in the next v2 release.
    End Sub