CalcBarBounds behavior changed?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
skassan
Newbie
Newbie
Posts: 27
Joined: Fri Sep 18, 2009 12:00 am

CalcBarBounds behavior changed?

Post by skassan » Wed Sep 30, 2009 6:31 pm

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;
    }
}

skassan
Newbie
Newbie
Posts: 27
Joined: Fri Sep 18, 2009 12:00 am

Re: CalcBarBounds behavior changed?

Post by skassan » Wed Sep 30, 2009 6:56 pm

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.

Post Reply