Colors incorrect as adding data to bar series in random ...

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Chris.CHWU
Newbie
Newbie
Posts: 57
Joined: Wed Jan 30, 2008 12:00 am

Colors incorrect as adding data to bar series in random ...

Post by Chris.CHWU » Tue Jun 10, 2008 7:12 am

Greetings,

   I found that if I add data to bar series in radom order, the color of bars would not be in my expectation.

   Did I misuse the bar series? Would you please help to check this? Thanks.

Code: Select all

    Private Sub mDrawBarInOrder(ByRef tchart As Steema.TeeChart.TChart)
        Dim bar As New Steema.TeeChart.Styles.Bar()

        bar.Add(0, 9, "item1", System.Drawing.Color.Red)
        bar.Add(1, 10, "item2", System.Drawing.Color.Red)

        tchart.Series.Add(bar)
    End Sub

    Private Sub mNOT_DrawBarInOrder(ByRef tchart As Steema.TeeChart.TChart)
        Dim bar As New Steema.TeeChart.Styles.Bar()

        bar.Add(1, 10, "item2", System.Drawing.Color.Red)
        bar.Add(0, 9, "item1", System.Drawing.Color.Red)

        tchart.Series.Add(bar)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.mDrawBarInOrder(TChart1)

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.mNOT_DrawBarInOrder(TChart2)
    End Sub

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 10, 2008 10:02 am

Hi Chris.CHWU,

You may need to set bar's YValues order to none before adding values to the series in the mNOT_DrawBarInOrder method, for example:

Code: Select all

    Private Sub mNOT_DrawBarInOrder(ByRef tchart As Steema.TeeChart.TChart)
        Dim bar As New Steema.TeeChart.Styles.Bar()

        bar.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
        bar.Add(1, 10, "item2", System.Drawing.Color.Red)
        bar.Add(0, 9, "item1", System.Drawing.Color.Red)

        tchart.Series.Add(bar)
    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

Chris.CHWU
Newbie
Newbie
Posts: 57
Joined: Wed Jan 30, 2008 12:00 am

Post by Chris.CHWU » Wed Jun 11, 2008 3:24 am

Hi Narcis,

    I copied your code to build my program, but the result was the same.
    I set bars on location 0, 1 both System.Color.Red, but only bar on location 0 is Red and the other seems dark blue.

    If I add data in order, both bars on location 0, 1 are in red.

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

Post by Narcís » Wed Jun 11, 2008 7:33 am

Hi Chris.CHWU,

Using your code works fine for me here using latest TeeChart for .NET v3 maintenance release, it plots all bars in red. Which TeeChart version are you using?

Thanks in advance.
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

Chris.CHWU
Newbie
Newbie
Posts: 57
Joined: Wed Jan 30, 2008 12:00 am

Post by Chris.CHWU » Wed Jun 11, 2008 9:47 am

Hi Narcis,

    I'm using TeeChart for .NET v3 2008/5/23 release version.
    Is this version as same as yours?

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

Post by Narcís » Wed Jun 11, 2008 10:19 am

Hi Chris.CHWU,

Sorry, no. I was using our latest sources. Using the same build as you I can reproduce the problem but works fine using current sources so you may expect this being fixed in the next maintenance release.

I recommend you to be aware at this forum or subscribe to our RSS feed for new release announcements.
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