Page 1 of 1

ColorGrid locations

Posted: Tue Jul 28, 2009 6:49 am
by 10550286
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?

Re: ColorGrid locations

Posted: Tue Jul 28, 2009 9:03 am
by yeray
Hi Sam,

Are you using the latest TeeChart version available at the download area (8.05)?

Re: ColorGrid locations

Posted: Wed Aug 05, 2009 2:39 am
by 10550286
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.

Re: ColorGrid locations

Posted: Wed Aug 05, 2009 7:52 am
by yeray
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;