ColorGrid Grid

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

ColorGrid Grid

Post by RSpence » Fri Feb 25, 2005 4:18 pm

Hi,

I have a colorGrid series - 85 columns X 60 rows. That's 5,100 values. If I add 5,100 values to the series, I get a nice little grid drawn over the top of my colored cells. My axis captions are appearing every 5 - 0, 5, 10 ... 85 etc. All working as I want.

What I want to next is clear the colors, but leave the grid there - so it appears empty, then add values one by one. If I call the series clear method, I lose the palette, and my grid lines are drawn every 5 - the same as my axis captions. How do I

a) Keep the palette visible when there are no values
b) Have the grid display in increments of 1.

Regards,

Rick

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

Post by Narcís » Fri Feb 25, 2005 4:56 pm

Hi Rick,
a) Keep the palette visible when there are no values
You can do:

Code: Select all

  for t:=0 to Series1.Count -1 do Series1.SetNull(t);
b) Have the grid display in increments of 1.


Yes, you can set the axes desired increment as:

Code: Select all

  Chart1.BottomAxis.Increment:=1;
  Chart1.LeftAxis.Increment:=1;
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

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Fri Feb 25, 2005 5:35 pm

Hi Narcis,

Thanks for the reply. Interesting results.

1. If I call the clear method, before calling SetNull, I loose the palette (even adding the palette values again does not help).

2. If I don't call clear, and just call SetNull, it does leave the grid exactly as I want it - empty - palettle shows, and I have the grid every point, and the axis captions every 5. perfect. However....subsequent calls to draw values using AddXYZ() do nto show anything...the grid remains empty. Do I need to undo the nulls somehow?

Thnks,

Rick

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Sat Feb 26, 2005 11:39 pm

More news:

Inthe previous message I wrote:
<<
2. If I don't call clear, and just call SetNull, it does leave the grid exactly as I want it - empty - palettle shows, and I have the grid every point, and the axis captions every 5. perfect. However....subsequent calls to draw values using AddXYZ() do nto show anything...the grid remains empty. Do I need to undo the nulls somehow?
>>
If smoothBitmap is on, everything works fine. I call SetNull for each point, the grid is empty. I then re-add points using AddXYZ, everthing works fine. If smoothbitmap is off, I see nothing...

Any ideas? Anyone want a sample project? Using 7.04.

Rick

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

Post by Narcís » Mon Feb 28, 2005 10:53 am

Hi Rick,

Yes, please post the example project we can run "as-is" at steema.public.attachments newsgroup available at news://www.steema.net.

Thanks in advance.
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

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Mon Feb 28, 2005 4:42 pm

Hi,

Posted a zip file on the newsgroup as requested. I stripped it down to this:

procedure TForm1.Button1Click(Sender: TObject);
begin
series1.addXyz(0, 10, 0);
end;

procedure TForm1.Button2Click(Sender: TObject);

begin
series1.SetNull(0);
end;

Call Button1CLick, then Button2Click, then button1Click again. You see nothing.

Bit stuck now...

Regards,

Rick

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Mar 01, 2005 3:22 pm

Hi Rick,

yes, you're correct, it seems to be a problem when you set it as Null, it does not get the pallete colors. I've added it on our defect list so it can be reviewed for the next maintenance releases.
I think the best way to accomplish that is by using two ColorGrid Series, one which you will use to set the null values and desired increment ..., and then use the other Serie to add the colored points.

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Tue Mar 01, 2005 5:59 pm

Hi,

Thanks for the message. I'll play with a second series. One thing I have tried - and works - is to add an extra color to the palette - a value of -1 with white. To "clear" the grid, I then populate it with -1. This works fine, except I now see the -1 / White in the legend. Is there any way to not show a color in the legend?

Regards,

Rick

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Mar 09, 2005 11:17 pm

Hi Rick,

the only way I can think of (except of drawing your won legend on the panel using the Canvas techniques) is to use the OnGetLegendText :

Code: Select all

procedure TForm1.Chart1GetLegendText(Sender: TCustomAxisPanel;
  LegendStyle: TLegendStyle; Index: Integer; var LegendText: String);
begin
if index = 0 then
legendtext :='';
end;
And also set the Color to clNone intead of clWhite.

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Mon Mar 14, 2005 11:44 pm

To anyone interested

I solved the issue of "not drawing" the legend by using the onGetlegendPos event - if it's the one I don't want to see (always the last one in my case) - I set x and y to large negative values so they are not seen...

pep - your suggestion of using a clNone color, unfortuately, does not work - presumably because of the problems T-Chart has with nulls - and then making the value non null. I reported this already and it was confirmed as a bug.

Regards,

Rick

Post Reply