Charts are used to display series of numeric data in a graphical format to make it easier to understand large quantities of data and the relationship between different series of data.
The following sections contain information about charts in GemBox.Spreadsheet component:
GemBox.Spreadsheet supports following chart types:
Additionally, GemBox.Spreadsheet supports following chart groupings:
Manipulating charts with GemBox.Spreadsheet component is easy and straightforward. See chart sample how to create chart and select data for it using GemBox.Spreadsheet.
Every chart is composed of components.
Some charts, for example, have axes, and others, like PieChart don't. Most charts have horizontal axis of type CategoryAxis (or DateAxis in case when categories are dates) and vertical axis of type ValueAxis, but some, like BarChart, have the opposite.
An Axis can have a title, labels, tick marks, gridlines, etc.
Following diagram outlines chart components and links each chart component to its corresponding member in GemBox.Spreadsheet API so you can easily locate each member by following the link:
To view code how to set/modify chart components using GemBox.Spreadsheet, see chart components sample.
An instance of ExcelDrawing (base class for pictures, charts, etc.) can be exported to a file or a stream, be printed or be embedded into WPF application.
To enable these operations, first drawing has to be formatted - its components must be measured and arranged. For example, chart components (chart title, axis titles, legend and axes) must be measured and arranged, before they can be rendered. This is done by calling one of the ExcelDrawingFormat method overloads which returns instance of FormattedExcelDrawing which contains export methods.
FormattedExcelDrawing enables the following functionalities:
Export drawing to PDF, XPS and image file formats.
Export can be made to a file, a stream or an ASP.NET response object (streamed to client's browser).
Embed drawing into WPF application.
When exporting entire workbook or worksheet into HTML format, charts are exported as PNG images using the same functionality described in this section.
To view chart export example code, go to chart components sample and set its last parameter Save to Chart.
Exporting a chart to a fixed document file format, such as PDF and XPS, and to image formats is accomplished with GemBox.Spreadsheet internal renderer that is commonly used for all formats mentioned.
This means that PDF, XPS and image formats share the same level of support for chart features, since they are all rendered in the same way.
The following list contains GemBox.Spreadsheet.Charts API members that are, currently, not supported when exporting to PDF, XPS and image formats:
Support for these members will be added in future versions of GemBox.Spreadsheet based on customer feedback.
Following charts types are currently not supported by GemBox.Spreadsheet API:
3D charts (Column, Bar, Line, Area and Pie).
X Y (Scatter) charts.
Support for these chart types will be added in future versions of GemBox.Spreadsheet based on customer feedback.
Although not supported by GemBox.Spreadsheet API, these chart types are still preserved, so you don't lose any chart when loading and saving to XLSX file format. There are even techniques to update data for preserved chart when workbook is opened in MS Excel as shown in chart preservation sample.