Back to Devexpress

ChartControl.Clone() Method

windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-43131ccb.md

latest2.7 KB
Original Source

ChartControl.Clone() Method

Creates a copy of the current ChartControl object.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public object Clone()
vb
Public Function Clone As Object

Returns

TypeDescription
Object

A ChartControl object which is a copy of the current object.

|

Remarks

This method creates a new instance of the ChartControl class and copies all the values of the current ChartControl‘s properties to it.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Clone() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-charts-show-chart-legend-with-markers-in-separate-control/CS/Form1.cs#L23

csharp
{
    using (ChartControl fakeChart = (ChartControl)sourceChart.Clone())
    {

winforms-charts-show-chart-legend-with-markers-in-separate-control/VB/Form1.vb#L23

vb
Private Sub CreateLegendMarkers(ByVal sourceChart As ChartControl)
    Using fakeChart As ChartControl = CType(sourceChart.Clone(), ChartControl)
        fakeChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True

See Also

ChartControl Class

ChartControl Members

DevExpress.XtraCharts Namespace