Point sytle color problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Cliven
Newbie
Newbie
Posts: 18
Joined: Fri May 14, 2004 4:00 am
Location: Malaysia

Point sytle color problem

Post by Cliven » Fri Jun 24, 2005 8:01 am

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)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jun 28, 2005 2:01 pm

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply