# GrapeCity.Spreadsheet.Drawing.IShapes.AddChart

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddChart*">AddChart Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddChart*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_GrapeCity_Spreadsheet_Charts_ChartType_System_Double_System_Double_System_Double_System_Double_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType,System.Double,System.Double,System.Double,System.Double,System.Boolean)">AddChart(ChartType, double, double, double, double, bool)</h4>
<div class="markdown level1 summary"><p>Adds a chart to the document. Returns an <a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a> object that represents a chart and adds it to the specified collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IShape AddChart(ChartType chartType = ChartType.ColumnClustered, double left = NaN, double top = NaN, double width = NaN, double height = NaN, bool newLayout = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function AddChart(Optional chartType As ChartType = ChartType.ColumnClustered, Optional left As Double = NaN, Optional top As Double = NaN, Optional width As Double = NaN, Optional height As Double = NaN, Optional newLayout As Boolean = True) As IShape</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Charts.ChartType.html">ChartType</a></td>
      <td><span class="parametername">chartType</span></td>
      <td><p>The type of chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">left</span></td>
      <td><p>The position, in pixels, of the left edge of the chart, relative to the anchor.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">top</span></td>
      <td><p>The position, in pixels, of the top edge of the chart, relative to the anchor.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">newLayout</span></td>
      <td><p>If <code class="paramref">newLayout</code> is <code>true</code>, the chart is inserted by using the new dynamic formatting rules (Title is on, and Legend is on only if there are multiple series).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a></td>
      <td><p>The <a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a> object represents the new chart.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_GrapeCity_Spreadsheet_Charts_ChartType_System_Double_System_Double_System_Double_System_Double_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This function works with Spread WPF only.</p>
</div>


<a id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddChart*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_GrapeCity_Spreadsheet_Charts_BuiltInChartStyles_GrapeCity_Spreadsheet_Charts_ChartType_System_Double_System_Double_System_Double_System_Double_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddChart(GrapeCity.Spreadsheet.Charts.BuiltInChartStyles,GrapeCity.Spreadsheet.Charts.ChartType,System.Double,System.Double,System.Double,System.Double,System.Boolean)">AddChart(BuiltInChartStyles, ChartType, double, double, double, double, bool)</h4>
<div class="markdown level1 summary"><p>Adds a chart to the document. Returns an <a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a> object that represents a chart and adds it to the specified collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IShape AddChart(BuiltInChartStyles style, ChartType chartType, double left = NaN, double top = NaN, double width = NaN, double height = NaN, bool newLayout = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function AddChart(style As BuiltInChartStyles, chartType As ChartType, Optional left As Double = NaN, Optional top As Double = NaN, Optional width As Double = NaN, Optional height As Double = NaN, Optional newLayout As Boolean = True) As IShape</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Charts.BuiltInChartStyles.html">BuiltInChartStyles</a></td>
      <td><span class="parametername">style</span></td>
      <td><p>The chart style.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Charts.ChartType.html">ChartType</a></td>
      <td><span class="parametername">chartType</span></td>
      <td><p>The type of chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">left</span></td>
      <td><p>The position, in pixels, of the left edge of the chart, relative to the anchor.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">top</span></td>
      <td><p>The position, in pixels, of the top edge of the chart, relative to the anchor.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the chart.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">newLayout</span></td>
      <td><p>If <code class="paramref">newLayout</code> is <code>true</code>, the chart is inserted by using the new dynamic formatting rules (Title is on, and Legend is on only if there are multiple series).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a></td>
      <td><p>The <a class="xref" href="GrapeCity.Spreadsheet.Drawing.IShape.html">IShape</a> object represents the new chart.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddChart_GrapeCity_Spreadsheet_Charts_BuiltInChartStyles_GrapeCity_Spreadsheet_Charts_ChartType_System_Double_System_Double_System_Double_System_Double_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This function works with Spread WPF only.</p>
</div>
</div>
