Page 1 of 1

CalcBarBounds behavior changed?

Posted: Wed Sep 30, 2009 6:31 pm
by 10054271
I had some code that was working correctly in TeeChart 7 Standard to identify which point on a TBarSeries the cursor is hovering over.
That code is no longer working now that I've upgraded to TeeChart 8 Pro. Now, whenever I call CalcBarBounds, the BarBounds rectangle
always reflects the bounds of the last point in the series, not the point whose index was passed to CalcBarBounds. Has this functionality
changed?

Code: Select all

void __fastcall TTestChartForm::CentroidDataChartMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
    TPoint MousePosition(X, Y);

    for (CurrentIndex = 0; CurrentIndex < CentroidData->Count(); CurrentIndex++)
    {
      CentroidData->CalcBarBounds(CurrentIndex);
      if (CentroidData->BarBounds.Contains(MousePosition))
      {
        break;
      }
    }

    if (CurrentIndex == CentroidData->Count())
    {
      CentroidData->ValueColor[CurrentIndex] = clRed;
    }
}

Re: CalcBarBounds behavior changed?

Posted: Wed Sep 30, 2009 6:56 pm
by 10054271
To answer my own question, yes, the behavior has changed.
The old version was a void function that set the BarBounds rectangle for the series.
The new version returns a TRect that can be used in the same fashion as the old Series->BarBounds rectangle.