Histogramfunction without DBNull
Histogramfunction without DBNull
Hello,
i will show a histogramfunction within a histogramseries. Like your example i need an other series (sourceseries) whitch hold (show) the data and than put this series as datasource to the histogram. This way still calculate the rigth values and shows it.
My problem in that way is, that DBNull values are possible in my datatable (sourceseries) and this values are included in the histogramcalculation. The property TreatNulls.Skip in any series does not help, how i can eliminate this values without manipulation in my datatable?
thanks!
i will show a histogramfunction within a histogramseries. Like your example i need an other series (sourceseries) whitch hold (show) the data and than put this series as datasource to the histogram. This way still calculate the rigth values and shows it.
My problem in that way is, that DBNull values are possible in my datatable (sourceseries) and this values are included in the histogramcalculation. The property TreatNulls.Skip in any series does not help, how i can eliminate this values without manipulation in my datatable?
thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
You could try doing as in the example I posted on this thread. Then you could use the setting you want for TreatNulls property and also assign DBNull.Value to DefaultNullValue property.
Hope this helps!
You could try doing as in the example I posted on this thread. Then you could use the setting you want for TreatNulls property and also assign DBNull.Value to DefaultNullValue property.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know how you'd expect null values being treated in the series?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know how you'd expect null values being treated in the series?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
Thanks for the example project. I could reproduce the issue here and added it (TF02013173) to the defect list to be fixed for next releases. Unfortunatelly there's no workaround I can think of at the moment.
Thanks for the example project. I could reproduce the issue here and added it (TF02013173) to the defect list to be fixed for next releases. Unfortunatelly there's no workaround I can think of at the moment.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
A workaround could be using a dummy series with no null values as a datasource for the function, for example:
A workaround could be using a dummy series with no null values as a datasource for the function, for example:
Code: Select all
private void InitializeTChart()
{
FastLine dataLine = new FastLine();
Histogram histogram = new Histogram();
HistogramFunction histogramFunction = new HistogramFunction();
tChart1.Series.Clear();
// Configure dataLine
// dataLine.DefaultNullValue = ???
dataLine.TreatNulls = TreatNullsStyle.Skip; // skip DBNull values
dataLine.DrawAllPoints = false; // faster
//dataLine.Visible = false; // Line is not intressting, only for calculation needed
dataLine.XValues.Order = ValueListOrder.None; // TeeChart is faster (DataTable is presorted within DB select)
dataLine.XValues.DataMember = data.Columns[0].ColumnName; // Timestamp
dataLine.YValues.DataMember = data.Columns[1].ColumnName; // Measurement
dataLine.DataSource = data; // set Source
FastLine dummySeries = new FastLine();
for (int i = 0; i < dataLine.Count; i++)
{
if (dataLine.YValues[i] != dataLine.DefaultNullValue)
{
dummySeries.Add(dataLine.XValues[i],dataLine.YValues[i]);
}
}
// Configure histogram
histogram.Function = histogramFunction; // set Function
//histogram.DataSource = dataLine; // Source for calculation
histogram.DataSource = dummySeries; // Source for calculation
tChart1.Series.Add(histogram);
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hello Narcís,
this workaround can be temporary work, but i think i go one data level higher to the sourcedatatable and try to delete such DBNull.Values. Unfortunatly its not a good way, because if there are a lot of Rows and Columns in my DataTable it slows my application down due to my dataconcept.
Nevertheless it works
Thanks!
this workaround can be temporary work, but i think i go one data level higher to the sourcedatatable and try to delete such DBNull.Values. Unfortunatly its not a good way, because if there are a lot of Rows and Columns in my DataTable it slows my application down due to my dataconcept.
Nevertheless it works
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AIS,
We have added IncludeNulls property to HistogramFunction for handling such cases. By default it's true so to get what you are looking for you should add line below to your project.
We have added IncludeNulls property to HistogramFunction for handling such cases. By default it's true so to get what you are looking for you should add line below to your project.
Code: Select all
histogramFunction.IncludeNulls = false;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |