Hi,
I use the last TChart V8.05 / D2007 ( but the same is with V8.03, V8.04).
If I fill the Tcontourplot with YValues all the same values ( for example 0 or 0.2) the program hangs.
Can you please help me, I have to deliver the program next week !!
A test program is attached.
Please press the load button and select the DADMIX.01Z file. Oberve that the program hangs if you switch to contour via the tabsheet.
with best regards
Werner
TContourplot hang when all YValues =0
TContourplot hang when all YValues =0
- Attachments
-
- BugHangProg.zip
- File for Tcontourplot hang
- (168.84 KiB) Downloaded 926 times
Re: TContourplot hang when all YValues =0
Hi Werner,
Considering what is explained at teechart help for this series:
Considering what is explained at teechart help for this series:
And also looking at this explanation from Narcis, I cant' see the sense of having a contour series with the same value for all the Y values. The contour series seems to need different YValues to define the levels.TContourSeries help wrote:Description
Calculates and displays "isolines" from a custom array of XYZ points.
The number of contour levels can be specified from 1 to 250.
To see a visual representation of this Series type, go to the TeeChart User Guide.
The Surface'sUseColorRange
andUsePalette
properties also apply to contour series.
Each contour Level can be coloured using a range (ie: from blue to white) or a "Palette", which can be customized for specific value intervals (ie: red from 100 to 200, green from 201 to 400 ). Same as withTSurfaceSeries
.
Contour points can be assigned to a Surface and vice-versa:
Each Level can be colored using a different color by doing:Code: Select all
Series1.AssignValues( Series2 );
Levels can be displayed at custom "Y" vertical positions:Code: Select all
ContourSeries1.ColorEachPoint := True;
Each Level can display at it's own Level "Y" position by setting this property:Code: Select all
ContourSeries1.YPosition := 123;
The ContourSeries, by default, shows at the Legend one item for each corresponding Contour "Level". The Contour Series has an eventCode: Select all
ContourSeries1.YPositionLevel := True;
OnGetLevel
which can be used to override each automatic LevelValue
andColor
:
TheCode: Select all
procedure TForm1.Series1GetLevel(Sender: TContourSeries; LevelIndex: Integer; var Value: Double; var Color: TColor); begin Value:=LevelIndex*100.0; if Value<500 then Color:=clBlue else Color:=clRed; end;
LevelIndex
parameter specifies each contour level, from0
toNumLevels-1
.
*Note
ContourSeries1.MaxYValue
andMinYValue
refer to Contour Y values.
Since version 5, this depends on the 2D / 3D setting.
When the Chart is in 2D mode (Chart1.View3D:=False
) then ContourMaxYValue
andMinYValue
methods return the Z values minimum and maximum values.
In 3D mode, the behaviour is the same as in version 4 (they refer to Contour Y values).
To remain independent on the above issue, you should useContour.YValues.MaxValue
andContour.YValues.MinValue
properties.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TContourplot hang when all YValues =0
Dear Yeray,
sorry , but I disagree completely. The data are sampled from a detector machine and therefore it could be happen, that all y-values have the same value. So you can't say to the user 'I cant' see the sense of having a contour series with the same value for all the Y values'. The program hangs, that is the fact.
Indeed, the problem is the calculation of the levels and your software guys have to have a look to the bounds of ranges that could be happen. If all y-values are the same value the following line in the teesurfa.pas (
This value gets a problem in the following algorithm.
I have give you enough information, even a sample project (spendig my weekend to do this) to fix this bug, so please do it !
best regards
Werner
sorry , but I disagree completely. The data are sampled from a detector machine and therefore it could be happen, that all y-values have the same value. So you can't say to the user 'I cant' see the sense of having a contour series with the same value for all the Y values'. The program hangs, that is the fact.
Indeed, the problem is the calculation of the levels and your software guys have to have a look to the bounds of ranges that could be happen. If all y-values are the same value the following line in the teesurfa.pas (
Procedure TContourSeries.CreateAutoLevels;
) get the result of tmp= '0'
Code: Select all
tmp:=MandatoryValueList.Range/Max(1,NumLevels-1);
I have give you enough information, even a sample project (spendig my weekend to do this) to fix this bug, so please do it !
best regards
Werner
Re: TContourplot hang when all YValues =0
Hi Werner,
My apologies if I looked immovable. The problem is that I'm still not able to understand how would you expect TeeChart to draw that situation. Maybe I'll understand better the expected result if you could attach also a picture showing it.
My apologies if I looked immovable. The problem is that I'm still not able to understand how would you expect TeeChart to draw that situation. Maybe I'll understand better the expected result if you could attach also a picture showing it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TContourplot hang when all YValues =0
Hi Yeray,
the major problem is the program hang, if all y-values have the same value. Please compile my sample project, load the file as I described and see what happen.
Meanwhile I have fixed the problem, but I am not sure if it works in any cases, so please have a look at it.
I have attached the picture showing in the case of all y-values have the same value;
With best regards
Werner
the major problem is the program hang, if all y-values have the same value. Please compile my sample project, load the file as I described and see what happen.
Meanwhile I have fixed the problem, but I am not sure if it works in any cases, so please have a look at it.
Code: Select all
Procedure TContourSeries.CreateAutoLevels;
......
tmp:=MandatoryValueList.Range/Max(1,NumLevels-1); // v8 changed to include max value
if tmp=0 then tmp:=1; //wdu
tmpMin:=MandatoryValueList.MinValue;
for t:=0 to NumLevels-1 do
begin
tmpUpTo:=tmpMin+tmp*(t+1); //wdu
With best regards
Werner
- Attachments
-
- Contour.zip
- Countour plot for all y-values have the same values
- (10.51 KiB) Downloaded 884 times
Re: TContourplot hang when all YValues =0
Hi Werner,
Excuse me again. For some reason I can't see, the first time I ran your application (and tried for several times) I got always a series without data. Then I guessed that there should be some problem in your loading file and that made me to think that the real problem was the "meaning" of the contour series and not a real hang.
Once retested your application and reproduced the hang, I've reduced the problem into a simpler example:
Note that the program finishes after about 5~10 seconds and there are only 1600 points. And I also could see that your patch seems to solve this really bad performance issue.
Finally, I'd like you to know that I've added this to the wish list to be fixed as soon as possible (TV52014344).
Excuse me again. For some reason I can't see, the first time I ran your application (and tried for several times) I got always a series without data. Then I guessed that there should be some problem in your loading file and that made me to think that the real problem was the "meaning" of the contour series and not a real hang.
Once retested your application and reproduced the hang, I've reduced the problem into a simpler example:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var x, z, index: Integer;
begin
for x := 0 to 39 do
for z := 0 to 39 do
series1.AddXYZ(x,1,z)
end;
Finally, I'd like you to know that I've added this to the wish list to be fixed as soon as possible (TV52014344).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |