Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1545 - Index out of range when series is drawing
Summary: Index out of range when series is drawing
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: 150901
Hardware: PC Windows
: High critical
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-19 11:19 EDT by IMT
Modified: 2021-04-21 03:01 EDT (History)
3 users (show)

See Also:
Chart Series: Line
Delphi / C++ Builder RAD IDE Version: RAD XE7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description IMT 2016-05-19 11:19:18 EDT
Hi,

Just discovered a bug in the latest build for VCL. The only thing required to reproduce is to recompile TeeChart with Range checking. 

Function TCustomSeries.DoDrawAll contains the bug on the line 4104:

DoDrawPointers(True,P[tmpIndex]);

tmpIndex - is wrong if tmpFraction is False. You are trying to address wrong tmpIndex = max. index + 1. To solve it quick, just replace above

      if tmpFraction then
      begin
        tmpValue:=XValues.Value[t-1]+tmpFractionValue;
        P[tmpIndex].X:=CalcXPosValue(tmpValue);
        P[tmpIndex].Y:=CalcPosLeftRight(tmpValue,tmpIndex-1,tmpIndex);
      end;

with

      if tmpFraction then
      begin
        tmpValue:=XValues.Value[t-1]+tmpFractionValue;
        P[tmpIndex].X:=CalcXPosValue(tmpValue);
        P[tmpIndex].Y:=CalcPosLeftRight(tmpValue,tmpIndex-1,tmpIndex);
      end
      else
        dec(tmpIndex);

It might help. Thank you very much!
Comment 1 IMT 2016-05-20 04:16:56 EDT
I forgot to add that you need to have all series points visible.
Comment 2 marc meumann 2021-04-21 03:01:56 EDT
I see the code mod is in there and this issue should have been closed down. Late to day, but thx for the observation.