Page 1 of 1

Bug in HistogramFunction?

Posted: Fri Jul 11, 2008 2:52 pm
by 13049497
Hello,

i have a problem with a HistogramFunction. If the Function only get a DataTable with one value it calculate something wrong. See the Code below to better understand what i mean:

Code: Select all

Steema.TeeChart.TChart tChart = new Steema.TeeChart.TChart();
tChart.Dock = DockStyle.Fill;
tChart.Aspect.View3D = false;
this.Controls.Add(tChart);

DataTable data = new DataTable();

Steema.TeeChart.Styles.Points baseData = new Steema.TeeChart.Styles.Points();
Steema.TeeChart.Styles.Histogram histogram = new Steema.TeeChart.Styles.Histogram();
Steema.TeeChart.Functions.HistogramFunction histoFunc = new Steema.TeeChart.Functions.HistogramFunction();
            
data.Columns.Add(new DataColumn("Y", typeof(double)));
data.Rows.Add(5);
//data.Rows.Add(5); // delete comment to see difference

baseData.DataSource = data;
baseData.YValues.DataMember = "Y";
histogram.Function = histoFunc;
histogram.DataSource = baseData;

tChart.Series.Add(baseData);
tChart.Series.Add(histogram);
case 1:
The DataTable have one Value (5) and the Point is drawn correctly at X:0 and Y:5. But the Histogram show, that there is one Y=0 value. Correctly it musst show one Y=5 value.

case 2:
The DataTAble have two Values (5,5) and the Points are drawn correctly at X:0,Y:5 and X:1,Y:5. The Histogram also correctly show two Y=5 values.

I would think this is a bug, or is there any property, which is not set?

Thanks in advance!

Posted: Fri Jul 11, 2008 3:02 pm
by narcis
Hi AIS,

I'm afraid this is a bug (TF02013240) which I've added to the list to be fixed for next releases.

Posted: Fri Jul 11, 2008 3:15 pm
by 13049497
Hi NarcĂ­s,

i think an analog problem has the HorizBox, if there only is one value in a DataTable. In that case occurs a "System.IndexOutOfRangeException".

Bye!

Posted: Fri Jul 11, 2008 5:47 pm
by narcis
Hi AIS,

Yes, this is a known issue that has been fixed for next maintenance release.