Histogram Control


Number of Bins/Cells

This page describes how to change the number of bins (also known as cells) of a histogram series. The histogram chart/control of the .Net Analytics package are of the following types:

The series class of the histogram chart/control is:

and the following property is responsible for the number of bins/cells:

The first step is to include the necessary namespace and add a new chart/control.

Change the Number of Bins/Cells

Below, we will change the number of bins/cells for the first series (named hsSeries in the examples below) of a Histogram control (named hcControl in the examples below):

[Visual Basic]
' Change the number of bins
hsSeries.Bins = 5

' An alternative method
hcControl.SeriesCollection(0).Bins = 5

[Visual C#]
// Change the number of bins
hsSeries.Bins = 5;

// An alternative method
hcControl.SeriesCollection[0].Bins = 5;

In the chart below, you can test the code to see what the result will look like:

Get Microsoft Silverlight