# Binding the Chart Control with Spread

Learn how you can bind the Chart control to data in the Spread control with the formula parameters. Learn more in documentation.

## Content

You can bind the Chart control to data in the Spread control with the formula parameters in the [SpreadChart](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.-ctor.html) constructor. The constructor uses formula syntax to specify the cell range.
You can also bind the Chart control in Spread with the [CategoryFormula](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.CategoryFormula.html), [DataFormula](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.DataFormula.html), [Formula](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.Formula.html), or [SeriesNameFormula](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.SeriesNameFormula.html) properties.

## Using Code

Add values to the cells and then use the formula parameters in the [SpreadChart](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.-ctor.html) constructor to create the Chart control.

## Example

The following example uses the [SpreadChart](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.-ctor.html) constructor to create a Chart control.

```csharp
FpSpread1.Sheets[0].RowCount = 10;
FpSpread1.Sheets[0].ColumnCount = 10;
FpSpread1.Sheets[0].Cells[0, 0].Value = 3;
FpSpread1.Sheets[0].Cells[1, 1].Value = 7;
FpSpread1.Sheets[0].Cells[2, 2].Value = 7;
FpSpread1.Sheets[0].Cells[3, 3].Value = 5;
FarPoint.Web.Spread.Chart.SpreadChart chart = new FarPoint.Web.Spread.Chart.SpreadChart("Sheet1!$A$2:$A$7", "Sheet1!$B$1:$D$1", "Sheet1!$B$2:$D$7", typeof(FarPoint.Web.Chart.BarSeries));
FpSpread1.Sheets[0].Charts.Add(chart);
```

```vbnet
FpSpread1.Sheets(0).RowCount = 10
FpSpread1.Sheets(0).ColumnCount = 10
FpSpread1.Sheets(0).Cells(0, 0).Value = 3
FpSpread1.Sheets(0).Cells(1, 1).Value = 7
FpSpread1.Sheets(0).Cells(2, 2).Value = 7
FpSpread1.Sheets(0).Cells(3, 3).Value = 5
Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart("Sheet1!$A$2:$A$7", "Sheet1!$B$1:$D$1", "Sheet1!$B$2:$D$7", GetType(FarPoint.Web.Chart.BarSeries))
FpSpread1.Sheets(0).Charts.Add(chart)
```

## See Also

[SpreadChart Class](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Chart.SpreadChart.html)