Histogram Queries

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
drillright40
Newbie
Newbie
Posts: 57
Joined: Mon Nov 19, 2007 12:00 am

Histogram Queries

Post by drillright40 » Thu Nov 13, 2008 5:30 am

Hi,

Thanks for your previous reply.

Following is my requirement for plotting a Histogram:

Lets say i have following data : 10, 20 30 , 40 , 50 ,60 , 70 , 80 ,90, 100.For this data the Histogram should be plotted in following manner.

1.The range (R) of values is divided into 50 equal bins that are (R/50) wide where R = (Maximum Value – Minimum Value). = (100 - 10)/50 = 1.8
So Number of Bins = 1.8.

2.The number of data values in each bin is calculated and the largest number (L) of values in a bin is determined.
L = 1

3.The histogram is drawn over the x-axis range of R and y-axis range from zero to L with 50 columns.

Queries:
1.Since this is floating point number , it is not accepted.What do i do for this?

2.Which Histogram overload do i use for providing the data.I mean do i need to calculate the NumberOfOccurrances on my own and then Provide them to Histogram. So do i need to use Overload this.HistogramClip.Add(double[] valueArray); OR this.HistogramClip.Add(double[] valueArray, double[] ccurranceArray)

3.Which Series do i use Bar OR Histogram.

Could u please give me the code snippet which will plot the above in appropriate manner.

Thanks
Sanyog.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 13, 2008 9:27 am

Hi Sanyog,

Sorry but I may not understand your requirements.

Please notice that you may be confusing TeeChart's series and functions:

1. TeeChart has Bar and Histogram series styles (Steema.TeeChart.Styles.Bar and Steema.TeeChart.Styles.Histogram). Both of them are bar based series with little different settings and in a simple manner they could be described like this:

http://en.wikipedia.org/wiki/Bar_chart


2. Then there's also Histogram function (Steema.TeeChart.Functions.Histogram), which is what I showed you in the example I posted in your other thread:

http://www.teechart.net/support/viewtopic.php?t=8704

Histogram function is a statistical function calculated from a given data set in a source series. You may be interested in reading some histogram function information here:

http://en.wikipedia.org/wiki/Histogram

In TeeChart's Histogram function, as discussed in other threads, you can set histogram's number of bins. I showed you how they are calculated (internally) here:

http://www.teechart.net/support/viewtopic.php?t=8718


So I don't think it makes much sense an histogram with a decimal number of bins.

Having said that, notice that Bar/Histogram series styles draw as many bars as you wish and they are automatically sized to fit chart's drawing area. So you may better use one of those series styles.

If this doesn't help please give us more detailed information on what you are trying to achieve.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply