Dundas Data Visualization Support Site
Dundas Support Site Home  |  Contact Us  |  Dundas Home  
Contact Us via Email
Home

Clone a Chart Series

 

Have you ever needed to make a duplicate of an existing Series in Dundas Chart while preserving all of its properties? This add-on makes it an easy one-liner.

Using the add-on

To use this add-on in your own code:

  1. Copy CloneSeries.cs to your project.
  2. On the Build tab of your project's Properties, add DUNDAS_CHART_WEB or DUNDAS_CHART_WIN to the "Conditional compilation symbols" field if you're using Dundas Chart for ASP.NET or Dundas Chart for Windows Forms, respectively.

    Conditional compilation symbols

    Note: One of DUNDAS_CHART_WEB or DUNDAS_CHART_WIN must be defined in each of your project's configurations.

  3. In your code, add the Dundas.Charting.Utilities namespace, and use Cloner.CloneSeries() to duplicate an existing series, copying all of its read-write properties except for Name.

    C#

    // Import the add-on namespace.
    using Dundas.Charting.Utilities;
    …
    // Duplicate an existing series.
    Series clonedSeries = Cloner.CloneSeries( originalSeries, "Cloned Series" );

    VisualBasic.NET

    ' Import the add-on namespace.
    Imports Dundas.Charting.Utilities
    …
    ' Duplicate an existing series.
    Dim clonedSeries As Series = Cloner.CloneSeries(originalSeries, "Cloned Series")

About the download

The download features the Cloner source code and a VisualStudio 2005 project to compile it.

 

Additional Downloads:

CloneSeries.zip
PoorExcellent