Page 1 of 1

TColorGridSeries problem

Posted: Fri Sep 02, 2005 12:14 pm
by 9337437
I’m working with TChart 7.04 and Delphi7 and I have a problem using TColorGridSeries. I am using TCurfaceSeries quite a lot to display diffraction data (Intensity (left axis) versus angle (bottom axis) versus temperature (depth axis)) in 3D. This works quite nice using the property IrregularGrid. Now I want to have a 2D display where the left axis is temperature and the bottom axis is position and where the intensity is just indicated by color. But when I try to fill the same data into TColorGridSeries (using IrregularGrid too) the data is only partly/wrongly displayed. Is this a bug in TcolorGridSeries ?

The data looks like this (equidistant in X and Z):

X Y Z
10.7082240104675 12.5848870624066 50
11.4080919265747 12.9363183755674 50
12.1079598426819 13.5824166472051 50
... SNIP
77.1956760406496 0 50
77.8955439567567 22.8596734475052 50
78.5954118728639 17.5346573981186 50
79.2952797889711 7.71011795852651 50
10.7082240104675 0 55
11.4080919265747 11.5798706308204 55
12.1079598426819 0.732731579074542 55
...SNIP
77.8955439567567 0 55
78.5954118728639 5.86593713309289 55
79.2952797889711 12.9955287277329 55
10.7082240104675 11.2484747868198 60
11.4080919265747 6.69369585810638 60
12.1079598426819 0 60
...SNIP
77.8955439567567 6.22940407184953 60
78.5954118728639 11.7662954111015 60
79.2952797889711 11.3490199604541 60
10.7082240104675 13.1156948942984 65
11.4080919265747 12.0883070579915 65
12.1079598426819 6.61220631430137 65
12.8078277587891 0 65
…and so on…

Posted: Fri Sep 02, 2005 1:17 pm
by narcis
Hi Thomas,

The most important thing you have to care about when using TColorGridSeries is its structure. TColorGridSeries works like a matrix where the cells are defined by X and Z values and each cell value is determined by Y values. You have to design TColorGridSeries as being able to be populate by a for nested loop as:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  x,z: Integer;
begin
  for x:=0 to 10 do
    for z:=0 to 10 do
      Series1.AddXYZ(x,random,z);
end;
Is your project considering this structure?

Posted: Fri Sep 02, 2005 5:29 pm
by 9337437
Hi Narcis,

please just look at the data displayed in my former post.
The difference to your loop is that X is double instead of integer
and that the steps in X and Y are different (but still constant) in my case.
That seems to screw up TColorGridSeries but not TSurfaceSeries.
Am i right? But why? There should be no difference, it looks like a bug.

best regards,

Thomas

Posted: Mon Sep 05, 2005 8:11 am
by narcis
Hi Thomas,

Yes, you are right. I've checked that your X and Z intervals are regular. I've tried using data similar to yours in the code below and the ColorGrid seems to draw correctly. Could you please test if this works for you? Also what do you exactly mean with "the data is only partly/wrongly displayed"?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  x,z: Integer;
  XStart,ZStart,XStep: double;
begin
  XStart:=10.7082240104675;
  ZStart:=50;
  XStep:=11.4080919265747-XStart;

  With Series1 do
  begin
    for x:=0 to 20 do
      for z:=0 to 20 do
        AddXYZ(XStart+(XStep*x),random,ZStart+z);

    Pen.Visible:=false;
    IrregularGrid:=true;
  end;
end;

TColorGridSeries Problems

Posted: Wed Sep 07, 2005 8:30 am
by 9337437
Hi Narcis,

please try this example:

var
x,z: Integer;
XStart,ZStart,ZStep,XStep: double;
begin
XStart := 10.358;
ZStart := 50;
XStep := 0.35;
ZStep := 5;

With Series1 do
begin
for x := 0 to 199 do
for z := 0 to 9 do
AddXYZ(XStart + (XStep * x), random, ZStart + (z * ZStep));
Pen.Visible := False;
IrregularGrid := True;
end;
end;

Then you see what I mean by:
"the data is only partly/wrongly displayed".

By the way the same code works perfectly using
TSurfaceSeries instead.
Another problem I see using TColorGridSeries is that it completely disappears when I switch TTeeOpenGL.Active to true.

best regards,

Thomas

Posted: Wed Sep 07, 2005 8:58 am
by narcis
Hi Thomas,

Using the code you posted it seems to work fine for me here or I can't appreciate the problem you are reporting. Could you please send us a screen-shot so that I can figure it out? you can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Also, are you using the latest TeeChart sources from our website? If so, as you are a source code customer, I can send you our very latest sources which are the ones I am using.

Regarding the OpenGL issue you report, it works fine for me here just using:

Code: Select all

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  TeeOpenGL1.Active:=CheckBox1.Checked;
end;

TColorGridSeries Problems

Posted: Wed Sep 07, 2005 1:00 pm
by 9337437
Hi Narcis,

I am using TeeChart sources version 7.04.
So could you please send me the latest sources?

Unfortunately I can't use a newsreader at my workplace, due to some
network restrictions. But when I am home I will post some screen-shots at the newsgroup which show the problems.

best regards,

Thomas

Posted: Wed Sep 07, 2005 1:06 pm
by narcis
Hi Thomas,

If you have newsgroups restrictions then send them to me and I'll include very latest TeeChart sources with the reply to your e-mail.

Posted: Wed Sep 07, 2005 2:30 pm
by narcis
Hi Thomas,

I've received your e-mail and sent you latest sources, the example I used for testing and some screen captures.

Please let us know how it goes for you.

TColorGridSeries Problems

Posted: Thu Sep 08, 2005 10:55 am
by 9337437
Hi Narcis,

thank you very much for the fast reply!
Both issues are solved using the latest source codes.
But unfortunately a new problem now occurs.
I used to display the ColorGridSeries Smoothed, but even if the Smooth property is set the series is still displayed "un-Smooth".
Please see the attached screen-shot (in the email I sent separately) from your example application where you can see that the
smooth property is checked but series is still shown in an un-smoothed fashion.

best regards,

Thomas

Posted: Thu Sep 08, 2005 3:43 pm
by narcis
Hi Thomas,

I can reproduce this. However smooth works fine with IrregularGrid:=false. When you used it before, where you using IrregularGrid to true or false?

TColorGridSeries Problems

Posted: Thu Sep 08, 2005 5:04 pm
by 9337437
Hi Narcis,

before I used TColorGridSeries of course with IrregularGrid:=true,
because the steps in X and Z were different.
Do you think this bug is solvable?

best regards,

Thomas

Posted: Fri Sep 09, 2005 11:42 am
by narcis
Hi Thomas,

I've been able to reproduce that and found when this change was introduced. We will work on it and I'll get back to you when I have more information.

Posted: Thu Sep 22, 2005 12:14 pm
by 8572663
Hi Narcis,

How can I get this fix when it is available. I have been working with Pep regarding same issues that Thomas is having. We too found ColorGridSeries issues solved in v705. But I also need to smooth when IrregularGrid = True.

Thanks

Posted: Mon Sep 26, 2005 1:36 pm
by narcis
Hi leaf,

We will try to have it fixed for v7.06 which is expected to be released in about a month.