title: How do I create a line chart that uses a table as a datasource?
body: <p>The OpenXML SDK Productivity tool is no doubt extremely useful, however
  creating a line chart in open XML which refers to a table with six cells results in 8000 generated lines of code.</p>
  
  <p>I couldn't find any documentation on how to do this seemingly simple thing:</p>
  
  <ol>
  <li>Create a chart </li>
  <li>Link the chart to a table within the same excel file using a formula like <code>x1=Table1[Date], y1=Table1[Temp1], x2=Table1[Date], y2=Table1[Temp2]</code></li>
  </ol>
  
  <p>I've re-factored a lot of this code generated by the OpenXMLSDK tool it in an attempt to make a simple method: Pass it as many formulas/series referring to the table/cells containing your data as you want.</p>
  
  <p>It works, <strong>however there's still a lot of generated code, it's still very ugly, convulted and a work in progress</strong>. If you improve it, feel free to post your changes.</p>
  
  <p>Sample Usage:</p>
  
  <ol>
  <li>Generate code from an excel file using the OpenXML SDK productivity tool. Create a new table in the file named Table1 with the columns "Time", "Temp 1" and "Temp 2". Do not insert a chart.</li>
  <li><p>Paste the below code at the end of the "CreateParts" method:</p>
  
  <pre><code>using C = DocumentFormat.OpenXml.Drawing.Charts;
  C.Marker marker3 = OpenXMLUtils.CreateMarker(C.MarkerStyleValues.Circle, 5, A.SchemeColorValues.Accent1);
  C.Marker marker2 = OpenXMLUtils.CreateMarker(C.MarkerStyleValues.Circle, 5, A.SchemeColorValues.Accent2);
  C.ScatterChartSeries scatterChartSeries1 = OpenXMLUtils.CreateSeries(0U, "Table1[Time]", "Table1[Temp 1]", marker3);
  C.ScatterChartSeries scatterChartSeries2 = OpenXMLUtils.CreateSeries(1U, "Table1[Time]", "Table1[Temp 2]", marker2);
  
  OpenXMLUtils.CreateChartSheet(workbookPart1, 2U, "Chart Sheet", scatterChartSeries1, scatterChartSeries2);
  </code></pre></li>
  </ol>