Page 1 of 1

ColorGrid Grid

Posted: Fri Feb 25, 2005 4:18 pm
by 9336985
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

Posted: Fri Feb 25, 2005 4:56 pm
by narcis
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;

Posted: Fri Feb 25, 2005 5:35 pm
by 9336985
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

Posted: Sat Feb 26, 2005 11:39 pm
by 9336985
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

Posted: Mon Feb 28, 2005 10:53 am
by narcis
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.

Posted: Mon Feb 28, 2005 4:42 pm
by 9336985
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

Posted: Tue Mar 01, 2005 3:22 pm
by Pep
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.

Posted: Tue Mar 01, 2005 5:59 pm
by 9336985
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

Posted: Wed Mar 09, 2005 11:17 pm
by Pep
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.

Posted: Mon Mar 14, 2005 11:44 pm
by 9336985
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