SpreadsheetGear 2023
Charts
SpreadsheetGear 2023 > Tutorials > Key Concepts > Charts

SpreadsheetGear 2023 provides a comprehensive charting API in the SpreadsheetGear.Charts namespace as well as support for chart rendering and chart editing in the WorkbookView control and chart image generation with the Image class.

Add charts to a worksheet using the AddChart method of the worksheet's shape collectionAddChart returns an instance of IShape whose Chart property may be used to access the new chart.

Access and modify the type of an entire chart with the ChartType property. Modify legends with HasLegend and Legend. Modify chart titles with HasTitle and ChartTitle. Access and modify individual series with SeriesCollection, an individual axis with Axes and individual chart groups with ChartGroups,

Create combination charts by changing the chart type of individual series with the series ChartType property.  Specify whether a series will be plotted on the primary or secondary axis with the AxisGroup property.

Each series in a chart is associated with one chart group. Typically there is one chart group for each chart type.  Multiple chart groups are created automatically when using combination charts (charts where not all series have the same chart type) and also when series are plotted on both primary and secondary axes. The IChartGroup interface provides options for customizing the appearance of the series in a group, such as setting the start angle on a pie chart, changing the gap width on a bar or column chart, as well as showing or hiding stock chart options on a line chart with HasHiLoLines and HasUpDownBars.

The IAxis interface provides options for fixed minimum scale and maximum scale values on a value axis or changing the tick label spacing on a category axis.  Show or hide major or minor gridlines with HasMajorGridlines and HasMinorGridlines.

Many chart objects, such as the chart area, plot area, chart title, legend and series provide a Format property which can be used to access and modify fills and lines, including support for solid fill colors, gradient fills, dashed line styles and transparency.