The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ChartObject.MoveToWorksheet(Worksheet) Method

Moves a chart to the specified worksheet.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

Chart MoveToWorksheet(Worksheet worksheet)
Function MoveToWorksheet(worksheet As Worksheet) As Chart
Chart MoveToWorksheet(Worksheet worksheet)
Function MoveToWorksheet(worksheet As Worksheet) As Chart

Parameters

Name Type Description
worksheet Worksheet

A Worksheet object that specifies a worksheet in the current workbook where the chart will be placed.

Parameters

Name Type Description
worksheet Worksheet

A Worksheet object that specifies a worksheet in the current workbook where the chart will be placed.

Returns

Type Description
Chart

A Chart object that specifies the embedded chart.

Returns

Type Description
Chart

A Chart object that specifies the embedded chart.

Remarks

The following example demonstrates how to use the MoveToWorksheet method to move a chart from a separate chart sheet to a worksheet containing the source data.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask1")

' Create a chart sheet containing a pie chart.
Dim chartSheet As ChartSheet = workbook.ChartSheets.Add(ChartType.Pie, worksheet("B2:C7"))

' Move the chart to the worksheet with chart data.
Dim embeddedChart As Chart = chartSheet.Chart.MoveToWorksheet(worksheet)
' Adjust the chart location.
embeddedChart.TopLeftCell = worksheet.Cells("E2")
embeddedChart.BottomRightCell = worksheet.Cells("K15")

workbook.Worksheets.ActiveWorksheet = worksheet
See Also