I am going through the code found in this hyperlink – How to insert chart in excel to insert a chart into a excel file and I am going through the sample code given at the bottom of the page. Now, there is a method called InsertChartInSpreadsheet(string docName, string worksheetName, string title=”SomeTitle”, Dictionary<string, int> data). For my program I used the following:
string docName = “some pathsample.xlsx”;
string worksheetName = “Sheet1”;
Dictionary<string, int> data = new Dictionary<string, int>() { {“Category 1”, 100}, {“Category 2”, 200},{“Category 3”, 300},{“Category 4”, 400},{“Category 5”, 500}}
Now the generated excel file is corrupted. Your valuable advice is appreciated.