chart 3D - coloring

TeeChart for ActiveX, COM and ASP
Post Reply
adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

chart 3D - coloring

Post by adenin » Wed May 28, 2008 12:25 pm

Hello,

I use AddXYZ to fill chart.
there is posibility to set color for each point added in this way.

Problem which appears is marked in file I uploaded: chart3D.jpg
(with http://www.steema.net/upload/Default.aspx)

So there are points one next to other which are in different "layer"
and one vertical half is coloured by different color.
( where layer is part of surface bounded with contours defined by me)

So my question is: Is there possibility to define coloring of 3D chart
with and only with intervals on vertical (left) axis? in order to avoid
cases I pointed.

thanks

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 May 28, 2008 12:43 pm

Hi adenin,

Yes, you can do the same I suggested to another client today here. This is a TeeChart VCL thread but the same applies to the ActiveX version.
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

adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

Post by adenin » Thu May 29, 2008 6:16 am

I did not find answer to my question there.

I already use coloring:

.Series(0).asSurface.AddXYZ 315,51.213840,24,"",RGB(0,255,176)

but this does not produce surface colored by contours.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu May 29, 2008 8:29 am

Hi adenin,

We think that probably you should work with a color range, one of predefined palettes or with a custom palette.

With this code you could see a simple color range example:

Code: Select all

Private Sub Form_Load()
Dim i, j As Integer
  TChart1.AddSeries scSurface
  
  With TChart1.Series(0).asSurface
    .IrregularGrid = False
    .UseColorRange = True
  
    For i = 0 To 50
      For j = 0 To 5
        .AddXYZ i, i * j, j, "", clTeeColor
      Next j
    Next i
  End With
End Sub
A simple predefined palette example:

Code: Select all

Private Sub Form_Load()
Dim i, j As Integer
  TChart1.AddSeries scSurface
  
  With TChart1.Series(0).asSurface
    .IrregularGrid = False
    .UseColorRange = False
    .UsePalette = True
    .PaletteStyle = psInvGray
     
    For i = 0 To 50
      For j = 0 To 5
        .AddXYZ i, i * j, j, "", clTeeColor
      Next j
    Next i
  End With
End Sub
And finally, a simple custom palette example:

Code: Select all

Private Sub Form_Load()
Dim i, j As Integer
  TChart1.AddSeries scSurface
  
  With TChart1.Series(0).asSurface
    .IrregularGrid = False
    .UseColorRange = False
    .UsePalette = True

    .PaletteStyle = psCustom
    .ClearPalette
    .AddPalette 50, vbGreen
    .AddPalette 100, vbYellow
    .AddPalette 200, vbRed
     
    For i = 0 To 50
      For j = 0 To 5
        .AddXYZ i, i * j, j, "", clTeeColor
      Next j
    Next i
  End With
End Sub
You can also take a look at "new features demos" if you want more examples.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply