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

Summary: Index out of range when series is drawing
Product: VCL TeeChart Reporter: IMT <roma_delta>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: critical CC: marc, roma_delta, sandra
Priority: High    
Version: 150901   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: Line Delphi / C++ Builder RAD IDE Version: RAD XE7

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.