Page 1 of 1

Bug in WPF 3.5.3700.30575 (no in 3.5.3498.27368!)

Posted: Tue Apr 06, 2010 6:00 am
by 13052485
In WPF TChart (3.5.3498.27368) I can use this code for Histogram series:
series.Delete(0, series.Count);
All works Ok. But in the latest 3.5.3700.30575 version when series.Count > 1 I get an exception "Index out of range"
System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
в System.ThrowHelper.ThrowArgumentOutOfRangeException()
в System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
в Steema.TeeChart.WPF.Styles.ColorList.RemoveRange(Int32 index, Int32 count)
в Steema.TeeChart.WPF.Styles.Series.Delete(Int32 index, Int32 count, Boolean removeGap)
в Steema.TeeChart.WPF.Styles.Series.Delete(Int32 index, Int32 count)

What to do?

Re: Bug in WPF 3.5.3700.30575 (no in 3.5.3498.27368!)

Posted: Tue Apr 06, 2010 10:52 am
by narcis
Hi Neurosoft,

It works fine for me here using code below with 3.5.3700.30575. Does this work fine at your end? Can you attach a simple example project we can run "as-is" to reproduce the problem here?

Code: Select all

		public Window1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private Steema.TeeChart.WPF.Styles.Histogram histogram1;

		private void InitializeChart()
		{
			histogram1 = new Steema.TeeChart.WPF.Styles.Histogram(tChart1.Chart);
			histogram1.FillSampleValues();
		}

		private void button1_Click(object sender, RoutedEventArgs e)
		{
			histogram1.Delete(0, histogram1.Count);
		}
Thanks in advance.

Re: Bug in WPF 3.5.3700.30575 (no in 3.5.3498.27368!)

Posted: Tue Apr 06, 2010 11:16 am
by 13052485
Narcís!

For bug reproduce only change

histogram1.FillSampleValues();

to this code

histogram1.Add(10, 10, string.Empty, Colors.Beige);
histogram1.Add(20, 20, string.Empty, Colors.Beige);

Regards

Re: Bug in WPF 3.5.3700.30575 (no in 3.5.3498.27368!)

Posted: Tue Apr 06, 2010 11:54 am
by narcis
Hi Neurosoft,

Thanks for the feedback. I could reproduce the issue and added it (TW16014781) to the defect list to be fixed. In the meantime a workaround is using code below. The problem is in point colors ValueList.

Code: Select all

		public Window1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private Steema.TeeChart.WPF.Styles.Histogram histogram1;

		private void InitializeChart()
		{
			histogram1 = new Steema.TeeChart.WPF.Styles.Histogram(tChart1.Chart);

			histogram1.Color = Colors.Beige;
			histogram1.Add(10, 10);//, string.Empty, Colors.Beige);
			histogram1.Add(20, 20);//, string.Empty, Colors.Beige);
		}

		private void button1_Click(object sender, RoutedEventArgs e)
		{
			histogram1.Delete(0, histogram1.Count);
		}

Re: Bug in WPF 3.5.3700.30575 (no in 3.5.3498.27368!)

Posted: Tue Apr 06, 2010 12:03 pm
by 13052485
Hello Narcís!

I need each bar with different color, so your workaround is not useful for me.

Thanks for you care, we shall wait bug fix