ColorEachPoint not working

TeeChart for ActiveX, COM and ASP
Post Reply
Eric
Newbie
Newbie
Posts: 99
Joined: Wed Sep 14, 2005 4:00 am

ColorEachPoint not working

Post by Eric » Thu Sep 15, 2005 3:46 am

Dear Sir

Please test run below the code. The ColorEachPoint not work.....

TChart1.AddSeries (scBar3D)
Call TChart1.Series(0).Add(1232323, "Testing", &H51FF66)
Call TChart1.Series(0).Add(1232323, "Testing2", &H51FF66)
Call TChart1.ChangeSeriesType(0, scPie)
TChart1.Series(0).asPie.AutoMarkPosition = True
TChart1.Series(0).ColorEachPoint = True
TChart1.Repaint

Thank & Best Regard
Eric

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

Post by Narcís » Thu Sep 15, 2005 8:19 am

Hi Eric,

This is because you already added points to the series specifying the same colour for all of them (&H51FF66). The code below works fine.

Code: Select all

    TChart1.AddSeries (scBar3D)
    
    Call TChart1.Series(0).Add(1232323, "Testing", clTeeColor)
    Call TChart1.Series(0).Add(1232323, "Testing2", clTeeColor)
    Call TChart1.ChangeSeriesType(0, scPie)
    TChart1.Series(0).asPie.AutoMarkPosition = True
    TChart1.Series(0).ColorEachPoint = True
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

Eric
Newbie
Newbie
Posts: 99
Joined: Wed Sep 14, 2005 4:00 am

Post by Eric » Thu Sep 15, 2005 8:57 am

Dear Sir/Madam

The Active-X version 5 works fine on this method and only pie chart we need to user ColorEachPoint. If user change the chart style to bar, we need to remain the custom color set by user.

The code that you given, User not able to retrieve back the color that set by she/he.

So do you got any code can work around?

Thank & Best Regard
Eric

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

Post by Narcís » Thu Sep 15, 2005 9:40 am

Hi Eric,

Yes, this is possible, use something similar to:

Code: Select all

Dim Col As OLE_COLOR

Private Sub Command1_Click()
    Call TChart1.ChangeSeriesType(0, scBar)
    TChart1.Series(0).ColorEachPoint = False
    TChart1.Series(0).Color = Col
End Sub

Private Sub Form_Load()
    TChart1.AddSeries (scBar3D)
    
    Col = &H51FF66
    
    Call TChart1.Series(0).Add(1232323, "Testing", Col)
    Call TChart1.Series(0).Add(1232323, "Testing2", Col)
    
    Call TChart1.ChangeSeriesType(0, scPie)
    
    For i = 0 To TChart1.Series(0).Count - 1
        TChart1.Series(0).PointColor(i) = clTeeColor
    Next
    
    TChart1.Series(0).asPie.AutoMarkPosition = True
    TChart1.Series(0).ColorEachPoint = True
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

Eric
Newbie
Newbie
Posts: 99
Joined: Wed Sep 14, 2005 4:00 am

Post by Eric » Thu Sep 15, 2005 9:54 am

Dear Sir/Madam

Yes.. It work... But no need to define Col


Private Sub Command1_Click()
Call TChart1.ChangeSeriesType(0, scBar)
TChart1.Series(0).ColorEachPoint = False
' TChart1.Series(0).Color = Col
End Sub

Private Sub Form_Load()
TChart1.AddSeries (scBar3D)
TChart1.Series(TChart1.SeriesCount - 1).Color = &H51FF66
'Col = &H51FF66
Call TChart1.Series(TChart1.SeriesCount - 1).Add(1232323, "Testing", TChart1.Series(TChart1.SeriesCount - 1).Color)
Call TChart1.Series(TChart1.SeriesCount - 1).Add(1232323, "Testing2", TChart1.Series(TChart1.SeriesCount - 1).Color)

Call TChart1.ChangeSeriesType(TChart1.SeriesCount - 1, scPie)

For i = 0 To TChart1.Series(0).Count - 1
TChart1.Series(TChart1.SeriesCount - 1).PointColor(i) = clTeeColor
Next

TChart1.Series(TChart1.SeriesCount - 1).asPie.AutoMarkPosition = True
TChart1.Series(TChart1.SeriesCount - 1).ColorEachPoint = True
End Sub

Anyway.. Thank a lot....

Eric

Post Reply