Levels in contour plots

TeeChart for ActiveX, COM and ASP
Post Reply
Raimund
Newbie
Newbie
Posts: 5
Joined: Thu May 04, 2006 12:00 am

Levels in contour plots

Post by Raimund » Wed Jan 14, 2009 11:07 am

Hello,

I'm a little confused: in th following code segment (C++)

Serie1.FillSampleValues(20);
Serie1.GetAsContour().SetAutomaticLevels(true);
Serie1.GetAsContour().SetNumLevels(15);
long lNumLevels=Serie1.GetAsContour().GetNumLevels();
//
Serie1.GetAsContour().SetAutomaticLevels(false);
Serie1.GetAsContour().SetNumLevels(15);
lNumLevels=Serie1.GetAsContour().GetNumLevels();

"serie1" is a contour serie. I try to get the Number of contour levels. In the first case (SetAutomaticLevels(true) ) the function GetNumLevels() returns the correct value 15.
In the second case (SetAutomaticLevels(false)) the function GetNumLevels() returns 0.

What happens here, what I'm doing wrong?

Raimund

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 Jan 14, 2009 12:18 pm

Hi Raimund,

I'm afraid this is a bug. I've added it (TV52013723) to the defect list to be investigated for next releases.
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

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 Mar 17, 2009 3:14 pm

Hi Raimund,

I've been investigating the issue now and found that if you set AutomaticLevels to false you need to create the levels before retrieving its value, for example:

Code: Select all

Private Sub Form_Load()
    TChart1.Aspect.View3D = False
    
    TChart1.AddSeries scContour
    TChart1.Series(0).FillSampleValues 10
    
    TChart1.Series(0).asContour.AutomaticLevels = False
    TChart1.Series(0).asContour.Levels.AddLevel -1, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel -0.8, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel -0.6, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel -0.4, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel -0.2, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel 0, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel 0.2, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel 0.4, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel 0.5, clTeeColor
    TChart1.Series(0).asContour.Levels.AddLevel 0.8, clTeeColor

    TChart1.Header.Text.Clear
    TChart1.Header.Text.Add CStr(TChart1.Series(0).asContour.NumLevels)
End Sub
So I don't consider this being a bug and therefore closed the issue in the defect list.
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