# Data Binding RadChart to a Generic List of Objects

> caution **RadChart** has been deprecated since Q3 2014 and is marked as obsolete as of the 2026 Q2 SP1 (v2026.2.708) release. This is the last release that includes the RadChart component — its source code will be removed from the assembly in the next release. We strongly recommend using [RadHtmlChart](https://www.telerik.com/products/aspnet-ajax/html-chart.aspx), Telerik's modern client-side charting component.
> To transition from RadChart to RadHtmlChart, refer to the following migration articles:
>
> * [Migrating Series](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-series-configuration)
> * [Migrating Axes](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-axes-configuration)
> * [Migrating Date Axes](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-date-axis-configuration)
> * [Migrating Databinding](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-data-binding-configuration)
> * [Features parity](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-functionalities---features-and-series-types-parity)
>
> Explore the [RadHtmlChart documentation](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/overview) and online demos to determine how it fits your development needs.

You can bind to a [generic lists](https://msdn2.microsoft.com/en-us/library/6sh2ey19.aspx) of objects that have multiple properties. The example below binds to a list of "Product" objects that contain two properties, one property for "Name" and a second for "QuantityInStock". The Y axis binds to the QuantityInStock and the X axis label binds to the "Name" property.

![RadChart bound to a generic list of product objects](https://www.telerik.com/products/aspnet-ajax/documentation/assets/6ea1ffa5d6b82579c78dfa4ec3c24db1/radchart-building010.png)

The Product object is defined with a constructor that passes both Name and QuantityInStock:

> caption Example: Define the product type used by the RadChart data source

```C#
public class Product
{
   public Product(string name, int quantityInStock)
   {
	   _name = name;
	   _quantityInStock = quantityInStock;
   }
   private string _name;
   public string Name
   {
	   get { return _name; }
	   set { _name = value; }
   }
   private int _quantityInStock;
   public int QuantityInStock
   {
	   get { return _quantityInStock; }
	   set { _quantityInStock = value; }
   }
} 				
```

```VB
' Define the chart item type with the fields used for labels and values.
Public Class Product
	Public Sub New(ByVal name As String, ByVal quantityInStock As Integer)
		_name = name
		_quantityInStock = quantityInStock
	End Sub
	Private _name As String
	Public Property Name() As String
		Get
			Return _name
		End Get
		Set(ByVal value As String)
			_name = value
		End Set
	End Property
	Private _quantityInStock As Integer
	Public Property QuantityInStock() As Integer
		Get
			Return _quantityInStock
		End Get
		Set(ByVal value As Integer)
			_quantityInStock = value
		End Set
	End Property
End Class
```

After the Product object is defined the following steps configure and bind to the generic List:

1. A generic List of Product objects is created and assigned to the RadChart DataSource= property.

2. The DataYColumn property of the series is assigned the numeric "QuantityInStock" property of the Product object.

3. The XAxis DataLabelsColumn is assigned the "Name" property of the the Product object.

4. The RadChart DataBind()= method is called.

> caption Example: Bind a generic product list to RadChart

```C#
// Create the records that supply the chart's category and value fields.
List<Product> products = new List<Product>();
products.Add(new Product("Parka L", 120));
products.Add(new Product("Parka M", 100));
products.Add(new Product("Parka S", 132));
products.Add(new Product("Wool Cap", 45));
products.Add(new Product("Mittens", 67));
RadChart1.DataSource = products;
RadChart1.Series[0].DataYColumn = "QuantityInStock";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name";
RadChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Arial", 8);
RadChart1.DataBind();				
```

```VB
' Create the records that supply the chart's category and value fields.
Dim products As New List(Of Product)()
products.Add(New Product("Parka L", 120))
products.Add(New Product("Parka M", 100))
products.Add(New Product("Parka S", 132))
products.Add(New Product("Wool Cap", 45))
products.Add(New Product("Mittens", 67))
RadChart1.DataSource = products
RadChart1.Series(0).DataYColumn = "QuantityInStock"
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name"
RadChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Arial", 8)
RadChart1.DataBind()	
```

## See Also

* [Data Binding RadChart to a Generic List](https://www.telerik.com/products/aspnet-ajax/documentation/controls/chart/building-radcharts/data-binding-radchart-to-a-generic-list)

* [Data Binding RadChart to a Generic List of Simple Types](https://www.telerik.com/products/aspnet-ajax/documentation/controls/chart/building-radcharts/data-binding-radchart-to-a-generic-list-of-simple-types)
