We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to copy and insert a chart in the same worksheet using C#,VB.NET?

This article explains how to copy and insert a chart in the same worksheet in XlsIO using C#/VB.NET.

How to copy and insert chart in same worksheet?

When a chart with same formatting is to be applied for different charts, there is no need of creating a new chart every time. Instead, we can copy the existing chart and make use of the cloned chart. This can be achieved by cloning and repositioned the chart in the worksheet.

To copy and insert a chart in same worksheet, you need to follow the below steps.

Steps to copy and insert a chart

  1. Create a workbook and add chart data in it.

 

  1. Add a chart in the worksheet.

 

The below screenshot shows output of the chart created using the above code.

  1. Then clone the chart added and set the positions for the new chart.

 

  1. Add data for the new chart.

 

  1. Save the workbook.

 

To know more about working with charts in XlsIO, please refer the documentation.

Download complete sample

The following C#/VB.NET complete code snippet shows how to copy and insert a chart in the same worksheet in XlsIO.

 

 

The below screenshot shows the output of the generated Excel file after inserting the chart in XlsIO.

Article ID: Published Date: Last Revised Date: Platform: Control:
8635 03/29/2018 03/29/2018 WPF XlsIO
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.