Histogram Control


Show/Hide Series

This page describes how to show and hide 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 showing/hiding the series:

  • Visibility

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

Show and Hide Series

Below, we will show the second series and hide the first series (named hsSeries in the examples below) of a Histogram control (named hcControl the examples below):

[Visual Basic]
' Hide the first series
hsSeries.Show = False

' An alternative method of hiding the first series
hcControl.SeriesCollection(0).Visibility = System.Windows.Visibility.Collapsed

' Show the second series
hcControl.SeriesCollection(1).Visibility = System.Windows.Visibility.Visible

[Visual C#]
// Hide the first series
hsSeries.Show = false;

// An alternative method of hiding the first series
hcControl.SeriesCollection[0].Visibility = System.Windows.Visibility.Collapsed;

// Show the second series
hcControl.SeriesCollection[1].Visibility = System.Windows.Visibility.Visible;

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

Get Microsoft Silverlight