Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just created a simple example where you have company A B C and the number of licenses they have for 5 years. </p> <p>you can see that you can select a worksheet by name and then add data to it and add a chart to it as well. </p> <pre><code> Sheets excelSheets = workbook.Worksheets; string currentSheet = "Sheet1"; Worksheet worksheet1 = (Worksheet)excelSheets.get_Item(currentSheet); </code></pre> <p>on the selected sheet you can add your chart, and tell it that you want the range from worksheet1, you can use any sheet's range and push it to that chart using SetSourceData hopefully this helps to answer your question about not figuring out how to " to take the data from one of the other worksheets and graph it. "</p> <pre><code> var app = new Application(); app.Visible = true; var workbook = app.Workbooks.Add(1); Sheets excelSheets = workbook.Worksheets; string currentSheet = "Sheet1"; Worksheet worksheet1 = (Worksheet)excelSheets.get_Item(currentSheet); worksheet1.Cells[1, 1] = ""; worksheet1.Cells[1, 2] = "Year 1"; worksheet1.Cells[1, 3] = "Year 2"; worksheet1.Cells[1, 4] = "Year 3"; worksheet1.Cells[1, 5] = "Year 4"; worksheet1.Cells[1, 6] = "Year 5"; worksheet1.Cells[2, 1] = "Company A"; worksheet1.Cells[2, 2] = "10"; worksheet1.Cells[2, 3] = "50"; worksheet1.Cells[2, 4] = "70"; worksheet1.Cells[2, 5] = "70"; worksheet1.Cells[2, 6] = "70"; worksheet1.Cells[3, 1] = "Company B"; worksheet1.Cells[3, 2] = "30"; worksheet1.Cells[3, 3] = "70"; worksheet1.Cells[3, 4] = "80"; worksheet1.Cells[3, 5] = "80"; worksheet1.Cells[3, 6] = "80"; worksheet1.Cells[4, 1] = "Company C"; worksheet1.Cells[4, 2] = "55"; worksheet1.Cells[4, 3] = "65"; worksheet1.Cells[4, 4] = "75"; worksheet1.Cells[4, 5] = "75"; worksheet1.Cells[4, 6] = "75"; ChartObjects xlCharts = (ChartObjects)worksheet1.ChartObjects(Type.Missing); ChartObject myChart = (ChartObject) xlCharts.Add(60, 10, 300, 300); Range chartRange = worksheet1.get_Range("A1", "F4"); Chart chartPage = myChart.Chart; chartPage.SetSourceData(chartRange, System.Reflection.Missing.Value); chartPage.ChartType = XlChartType.xlLine; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload