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 - TChartSeries.Delete damages XValues
Summary: TChartSeries.Delete damages XValues
Status: RESOLVED NOTABUG
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-29 01:59 EDT by Maris Vasilevskis
Modified: 2021-09-29 03:35 EDT (History)
1 user (show)

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


Attachments
TChartSeries.Delete sample (52.87 KB, application/zip)
2021-09-29 01:59 EDT, Maris Vasilevskis
Details

Note You need to log in before you can comment on or make changes to this bug.
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);