ColorGrid locations

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sam F
Newbie
Newbie
Posts: 45
Joined: Wed Sep 10, 2008 12:00 am

ColorGrid locations

Post by Sam F » Tue Jul 28, 2009 6:49 am

Hi,

I'm one of those waiting for an alignment fix (?) that made some properties 'NULL' for TColorGridSeries. That aside, trying to use it regardless, I'm trying to plot some data and it is behaving strangely. It seems like the colour grid minimum value is being offset by 1. So, for the code slice below:

Code: Select all

m_pColourGrid->CenteredPoints = false;
m_pColourGrid->IrregularGrid = false;
for(int i = 0; i < 10; i++)
  {
   for(int j = 0; j < 10; j++)
   {
    m_pColourGrid->AddXYZ(i,i * j,j);
   }
  }
Produces a grid with borders 1 to 10(rather than 0 to 10), the bottom-left being 1,1, and the top-right being 10,10. What this means is, for starters, the coloured boxes no longer represent a 1 by 1 cell, as it is trying to fit 10 by 10 cells into a 9 by 9 space. This is made more obvious when the 'frame' is visible, which outlines the grid as if it were plotting cells of the correct size, which means the frame does not match the coloured grid. This all seems very broken. Attached is an example screen capture.
Is this a known problem? Am I doing something wrong?
Attachments
ColorGrid.JPG
Example of colorgrid problem.
ColorGrid.JPG (68.04 KiB) Viewed 5263 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ColorGrid locations

Post by Yeray » Tue Jul 28, 2009 9:03 am

Hi Sam,

Are you using the latest TeeChart version available at the download area (8.05)?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Sam F
Newbie
Newbie
Posts: 45
Joined: Wed Sep 10, 2008 12:00 am

Re: ColorGrid locations

Post by Sam F » Wed Aug 05, 2009 2:39 am

I have now upgraded to 8.05 - that did fix the origins problem - as in, now my 10 by 10 color cells are painting on a 0 to 10 grid rather than a 1 to 10 grid. Thanks.

However, there was a secondary problem(perhaps part of the root cause of the original problem) - I've been defaulting my tcharts to have an axes offset so that points don't sit right on the axes. Code:

Code: Select all

m_pPseudoSectionChart->Axes->Left->MaximumOffset = 5;
m_pPseudoSectionChart->Axes->Left->MinimumOffset = 5;
m_pPseudoSectionChart->Axes->Bottom->MaximumOffset = 5;
m_pPseudoSectionChart->Axes->Bottom->MinimumOffset = 5;
The colour grid gets a bit confused by this - see attached - note while the left sits at 0,0, the cells aren't quite sizing correctly, and go past ten. This issue dissapears without the axis offset values. Now that I understand the cause, I can work around it fine, but I thought I'd let you know.
Attachments
ColorGrid2.JPG
Color grid problem
ColorGrid2.JPG (26.51 KiB) Viewed 5236 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ColorGrid locations

Post by Yeray » Wed Aug 05, 2009 7:52 am

Hi Sam,

Thank you for reporting this. I'll add it to the wish list to continue improving this series in the next releases.

In the meanwhile, I recommend you to avoid using axes offsets and adjust the axes with SetMinMax function. For example,this seems to work fine here:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i, j: Integer;
begin
  Chart1.View3D := false;

  for i := 0 to 9 do
    for j := 0 to 9 do
      series1.AddXYZ(i,i * j,j);

  Chart1.Axes.Bottom.SetMinMax(-0.1, 10.1);
  Chart1.Axes.Left.SetMinMax(-0.1, 10.1);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply