Replacement for FillSequence after deleting data ?
Posted: Thu Feb 21, 2008 12:41 pm
Hi !
I use this code to delete data from a chart:
It uses a TColorBandTool for selecting the area which will be deleted. This works nearly perfect, but I´m in big trouble with FillSequence.
We often have x values for the series which are in double format. So the increment from x value to the next x value is not 1.
If I run FillSequence it sets all X values to integer values with the increment of 1. This ends up in a wrong display for the x axis. The values are no longer correct.
So is there a FillSequence replacement which won´t destroy the X axis values?
Let me show you a simple example what I expect:
This should be my original x Axis vaules:
Now I set my TColorBandTool and delete all values from 2 to 3.
The result after this step:
What I need is this (the function should recalculate the values after 3):
But FillSequence does this:
Can you give me an example how I can realize this?
I use this code to delete data from a chart:
Code: Select all
// Daten löschen
if Tool <> NIL then begin
for i := Form1.MainChart[0].Count-1 downto 0 do
begin
tmp := Form1.MainChart[0].XValue[i];
if ((tmp >= Tool.StartValue) and (tmp <= Tool.EndValue)) then
begin
for j := 0 to Form1.MainChart.SeriesCount - 1 do
if Form1.MainChart[j].Count > 0 then
Form1.MainChart[j].Delete(i);
end;
end;
{ for j := 0 to Form1.MainChart.SeriesCount - 1 do
Form1.MainChart[j].XValues.FillSequence; }
end;
We often have x values for the series which are in double format. So the increment from x value to the next x value is not 1.
If I run FillSequence it sets all X values to integer values with the increment of 1. This ends up in a wrong display for the x axis. The values are no longer correct.
So is there a FillSequence replacement which won´t destroy the X axis values?
Let me show you a simple example what I expect:
This should be my original x Axis vaules:
Code: Select all
0 0,5 1 1,5 2 2,5 3 3,5 4
The result after this step:
Code: Select all
0 0,5 1 1,5 3,5 4
Code: Select all
0 0,5 1 1,5 2 2,5
Code: Select all
0 1 2 3 4 5