# Allowing the User to Change the Chart

Learn how to allow users to resize, move, or change the range of elements displayed by the chart in Spread.NET with practical examples.

## Content

You can allow the users to resize, move, or change the range of elements displayed by the chart. The user can also select elements on the chart and the related cell range in the Spread control will be selected.
The user can make the following changes at run time.

* The user can select the chart and then move or resize the chart.
* The user can select the chart and then the range of data used by the chart.
* The user can resize the block of selected data to change the range of data in the chart.
* The user can edit the cells used by the chart to change the values.

The following image shows a selected range of data used by the chart. Put the mouse pointer over the blue square to get resize arrows.
![Select Chart](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/selectchart.png)
You can use the [CanMove](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.DrawingSpace.PSObject.CanMove.html) property to prevent the user from moving and [CanSize](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.DrawingSpace.PSObject.CanSize.html) property to resize the chart. The **Locked** property prevents the user from moving and resizing the chart control.

## Using Code

This example sets the **Locked**, **CanMove**, and **CanResize** properties.

## Example

```csharp
FarPoint.Win.Spread.Chart.SpreadChart chart;
chart = fpSpread1.Sheets[0].AddChart(0, 0, typeof(FarPoint.Win.Chart.BarSeries), 400, 400, 200, 80, FarPoint.Win.Chart.ChartViewType.View2D, true);
chart.Locked = true;
//chart.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.None;
//chart.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.Horizontal;
```

```vbnet
Dim chart As FarPoint.Win.Spread.Chart.SpreadChart
Dim range As New FarPoint.Win.Spread.Model.CellRange(0, 0, 7, 4)
chart = fpSpread1.Sheets(0).AddChart(range, GetType(FarPoint.Win.Chart.BarSeries), 400, 300, 300, 80, FarPoint.Win.Chart.ChartViewType.View3D, False)
chart.Locked = True
'chart.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.None
'chart.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.Horizontal
```

## See Also

[Saving or Loading a Chart](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartcreate/spwin-sheet-chart/fpchart-file-savechart)