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 100

Summary: Methods RemoveAt and Remove, don't remove the markers of NumericGauges
Product: .NET TeeChart Reporter: sandra pazos <sandra>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: major CC: chris
Priority: ---    
Version: TeeChart.NET 2013 4.1.2013.11080   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description sandra pazos 2013-11-14 04:53:02 EST
When you use the methods RemoveAt or Series.Remove to clear Numeric Gauges, the Gauge is removed but its markers not. The method works in correct way for the other series.  See next code to reproduce the problem: 

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
          Steema.TeeChart.Styles.NumericGauge num = new Steema.TeeChart.Styles.NumericGauge();
          tChart1.Series.Add(num);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            tChart1.Series.RemoveAt(0); //tChart.Series.Remove(); 
            tChart1.Refresh();

        }
Comment 1 christopher ireland 2013-11-14 07:42:30 EST
This is not a bug. The reason is that neither Remove nor RemoveAt are designed to Dispose of the series. You can see this in the comment of the SeriesCollection.RemoveAllSeries, which says, "Removes all Series from the Chart but not disposes (destroys) them".

You will note that calling Dispose on the series works as expected:

    Steema.TeeChart.Styles.NumericGauge num;

    private void InitializeChart()
    {
      num = new Steema.TeeChart.Styles.NumericGauge();
      tChart1.Series.Add(num);

      num.FillSampleValues();
    }

    private void button1_Click(object sender, EventArgs e)
    {
      num.Dispose();
    }