Introduction
Developers can add a variety of charts to their spreadsheets using Aspose.Cells. Aspose.Cells provides many charting objects that can be used to create charts in a flexible manner. The primary aim of this topic is to make developers familiar with the charting objects of Aspose.Cells so that they may create any kind of chart easily.
Things to Know Before Creating a Chart
Before we start demonstrating the creation of charts, it's important to discuss some basic concepts that would be very helpful for the developers to create any kind of charts using Aspose.Cells.
Charting Objects
Aspose.Cells provides some special set of classes that are used to create all kinds of charts supported by Aspose.Cells. These classes are used to create Charting Objects, which act as the building blocks of a chart. These charting objects are listed below:
- ASeries, represents a single data series in a chart
- Axis, represents a chart's axis
- Chart, represents a single Excel chart
- ChartArea, represents the chart area in the worksheet
- ChartDataTable, represents a chart data table
- ChartFrame, represents the frame object in a chart
- ChartPoint, represents a single point in a series in a chart
- ChartPoints, represents a collection that contains all the points in one series
- Charts, represents a collection of Chart objects
- DataLabels, represents a collection of all the DataLabel objects for the specified ASeries
- FillFormat, represents fill format for a shape
- Floor, represents the floor of a 3D chart
- Legend, represents the chart legend
- Line, represents the chart line
- NSeries, represents a collection of ASeries objects
- TickLabels, represents the tick mark labels associated with tick marks on a chart axis
- Title, represents the title of a chart or axis
- Trendline, represents a trendline in a chart
- Trendlines, represents a collection of all Trendline objects for the specified data series
- Walls, represents the walls of a 3D chart
Using Charting Objects
As we have told above, all charting objects are the instances of their respective classes that provide specific properties and methods to perform specific tasks. Developers can use these charting objects to create charts according to their requirements.
Developers can add any type of chart to their worksheets using the Charts collection. Each item in the Charts collection represents a Chart object. A Chart object encapsulates all other Charting Objects that are required to customize the appearance of a chart. In our next section, we will learn the use of few basic charting objects to create a simple chart.
Creating a Simple Chart
Developers can create many types of charts using Aspose.Cells. All types of standard charts supported by Aspose.Cells are pre-defined in an enumeration named as ChartType. These pre-defined chart types in the ChartType enumeration are as follows:
|
Chart Types
|
Description
|
|
Column
|
Represents Clustered Column Chart
|
|
ColumnStacked
|
Represents Stacked Column Chart
|
|
Column100PercentStacked
|
Represents 100% Stacked Column Chart
|
|
Column3DClustered
|
Represents 3D Colustered Column Chart
|
|
Column3DStacked
|
Represents 3D Stacked Column Chart
|
|
Column3D100PercentStacked
|
Represents 3D 100% Stacked Column Chart
|
|
Column3D
|
Represents 3D Column Chart
|
|
Bar
|
Represents Clustered Bar Chart
|
|
BarStacked
|
Represents Stacked Bar Chart
|
|
Bar100PercentStacked
|
Represents 100% Stacked Bar Chart
|
|
Bar3DClustered
|
Represents 3D Clustered Bar Chart
|
|
Bar3DStacked
|
Represents 3D Stacked Bar Chart
|
|
Bar3D100PercentStacked
|
Represents 3D 100% Stacked Bar Chart
|
|
Line
|
Represents Line Chart
|
|
LineStacked
|
Represents Stacked Line Chart
|
|
Line100PercentStacked
|
Represents 100% Stacked Line Chart
|
|
LineWithDataMarkers
|
Represents Line Chart with data markers
|
|
LineStackedWithDataMarkers
|
Represents Stacked Line Chart with data markers
|
|
Line100PercentStackedWithDataMarkers
|
Represents 100% Stacked Line Chart with data markers
|
|
Line3D
|
Represents 3D Line Chart
|
|
Pie
|
Represents Pie Chart
|
|
Pie3D
|
Represents 3D Pie Chart
|
|
PiePie
|
Represents Pie of Pie Chart
|
|
PieExploded
|
Represents Exploded Pie Chart
|
|
Pie3DExploded
|
Represents 3D Exploded Pie Chart
|
|
PieBar
|
Represents Bar of Pie Chart
|
|
Scatter
|
Represents Scatter Chart
|
|
ScatterConnectedByCurvesWithDataMarker
|
Represents Scatter Chart connected by curves, with data markers
|
|
ScatterConnectedByCurvesWithoutDataMarker
|
Represents Scatter Chart connected by curves, without data markers
|
|
ScatterConnectedByLinesWithDataMarker
|
Represents Scatter Chart connected by lines, with data markers
|
|
ScatterConnectedByLinesWithoutDataMarker
|
Represents Scatter Chart connected by lines, without data markers
|
|
Area
|
Represents Area Chart
|
|
AreaStacked
|
Represents Stacked Area Chart
|
|
Area100PercentStacked
|
Represents 100% Stacked Area Chart
|
|
Area3D
|
Represents 3D Area Chart
|
|
Area3DStacked
|
Represents 3D Stacked Area Chart
|
|
Area3D100PercentStacked
|
Represents 3D 100% Stacked Area Chart
|
|
Doughnut
|
Represents Doughnut Chart
|
|
DoughnutExploded
|
Represents Exploded Doughnut Chart
|
|
Radar
|
Represents Radar Chart
|
|
RadarWithDataMarkers
|
Represents Radar Chart with data markers
|
|
RadarFilled
|
Represents Filled Radar Chart
|
|
Surface3D
|
Represents 3D Surface Chart
|
|
SurfaceWireframe3D
|
Represents Wireframe 3D Surface Chart
|
|
SurfaceContour
|
Represents Contour Chart
|
|
SurfaceContourWireframe
|
Represents Wireframe Contour Chart
|
|