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 106 - If you remove the SeriesStats tool it doesn't remove the extra Series that is added in chart.
Summary: If you remove the SeriesStats tool it doesn't remove the extra Series that is...
Status: IN_PROGRESS
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 08:42 EST by sandra pazos
Modified: 2013-11-25 11:24 EST (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sandra pazos 2013-11-18 08:42:35 EST
If you work at the same time with a Standard Series and a SeriesStats tool, when you mark the average function of Statistics tool, one extra series (function average) is added to the Series tab in Chart Editor, too.  After, if you remove the tool, the extra Series isn't removed from the Chart. The same problem occurs in TeeChartFor.Net, bug number [id52]. 

To reproduce the problem you only need following next steps in Design-Time or Run- Time: 

1.- Add Chart in the Form.
2.- Open editor, Add Series and Add Statistics tool.
3.- In Statistic tool check the Average function.
One extra series is added in the Chart and in the Series Editor Chart.
4.- Remove the  Statistics tool. 
6.- Close Editor.
The extra Series isn't removed from the Chart.
Comment 1 david berneda 2013-11-19 09:55:22 EST
This was made on purpose. 
The tool is just an easy way (shortcut) to add basic functions to a chart.

Added series can be easily removed using the editor.
Comment 2 sandra pazos 2013-11-25 09:31:12 EST
I understand you, but I think, if you remove the Statistics tool, is logical, extra series were added in the chart, are removed, too, so, if the tool doesn't exist, don't make sense extra series exist.
Comment 3 david berneda 2013-11-25 10:14:01 EST
The problem is, you use the tool to add series, then you modify the series properties, etc. 
And then you remove the tool thinking it will not remove anything, and suddenly the series are removed.

I think the best solution we can do is to ask the developer a Yes/No confirmation to remove or not the series, when removing the tool.

But what to do if removing the tool by code ? (ie:  ChartTool123.Free or ChartTool123.ParentChart:=nil)
Comment 4 david berneda 2013-11-25 11:24:26 EST
(In reply to sandra pazos from comment #2)
> I understand you, but I think, if you remove the Statistics tool, is
> logical, extra series were added in the chart, are removed, too, so, if the
> tool doesn't exist, don't make sense extra series exist.

I've added a new method that removes all series created using the Stats tool editor dialog:

ChartTool1.FreeAllSeries;

And a button at Stats editor dialog ("Remove All") that calls that method.

Its a pending decision to call this method automatically at tool destroy time.

Maybe a new property should be needed to indicate the tool should free all possible created series, something like:

ChartTool1.FreeSeriesOnDestroy := True;
ChartTool1.Free;