.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> File Operation >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Excel chart & series object creation

Posted By:nishithraj       Posted Date: December 02, 2009    Points: 10    Category: File Operation    URL: http://www.dotnetspark.com  

Excel chart & series object creation. Charts can be created using the Microsoft.office.interop.excel componet. This can be created in a sheet with the values of the sheets. Series object is used to decide the values of the chart.

We can use the ChartWizard to create a new chart from the selected data as follows.

objRange = oWS.get_Range("E2:E6", Missing.Value);
objChart.ChartWizard( objRange, Excel.XlChartType.xl3DColumn, Missing.Value,
Excel.XlRowCol.xlColumns, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value);
objSeries = (Excel.Series)objChart.SeriesCollection(1);
//Pass the values from the excel sheet to create the chart values
objSeries.XValues = oWS.get_Range("A3", "A7");


Further Readings:

Author: TheBasin         Company URL: http://www.dotnetspark.com
Posted Date: November 05, 2010

I don't see where objSeries.XValues gets put to use in this example.

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend