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 2461

Summary: TChartSeries.Delete damages XValues
Product: VCL TeeChart Reporter: Maris Vasilevskis <mahris>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: major CC: yeray
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: TChartSeries.Delete sample

Description Maris Vasilevskis 2021-09-29 01:59:42 EDT
Created attachment 983 [details]
TChartSeries.Delete sample

Fill a TChart with 101 value:
    for i := 0 to 100 do
      Chart1.Series[0].AddXY(i*5,i*5,'',clRed);
A line appears on the chart, X and Y axis show labels 0..500.

Now, delete 20 points:
    Chart1.Series[0].Delete(30,20,true);

The graph is updated correctly.
But X axis now show 0..80 - data point numbers instead of X values.
Same problem with another XValue functions - MinXValue, MaxXValue, etc.

Detected in versions 160129 and 201112,
Comment 1 Maris Vasilevskis 2021-09-29 02:12:06 EDT
My current workaround - manage XValue copy in my program, write correct values in OnGetAxisLabel.
Comment 2 yeray alonso 2021-09-29 03:35:45 EDT
Read the explanation in the signature of the Delete override:

// Deletes "Quantity" number of points from "Start" index.
// Faster than calling Delete repeteadly.
// If RemoveGap is True, "X" values are re-calculated to be sequential,
// to eliminate gaps created by deletion.
Procedure TChartSeries.Delete(Start,Quantity:Integer; RemoveGap:Boolean=False);