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. Then they 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.
You can prevent the user from moving or resizing 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
C# | ![]() |
---|---|
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; |
VB | ![]() |
---|---|
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 |