Chart

The Chart class, a versatile component within the OpenXMLOffice.Spreadsheet library, empowers developers to seamlessly integrate various types of charts into Excel spreadsheet. This class supports multiple chart types and configurations, allowing users to add new charts to a sheet with dynamic and data-driven visualizations.

List of supported charts
  • Area Chart (2007) :

    • Cluster

    • Stacked

    • 100% Stacked

    • Cluster 3D

    • Stacket 3D

    • 100% Stacked 3D

  • Bar Chart (2007) :

    • Cluster

    • Stacked

    • 100% Stacked

    • Cluster 3D

    • Stacket 3D

    • 100% Stacked 3D

  • Column Chart (2007) :

    • Cluster

    • Stacked

    • 100% Stacked

    • Cluster 3D

    • Stacket 3D

    • 100% Stacked 3D

  • Line Chart (2007) :

    • Cluster

    • Stacked

    • 100% Stacked

    • Cluster Marker

    • Stacked Marker

    • 100% Stacked Marker

  • X Y (Scatter) Chart (2007) :

    • Scatter

    • Scatter Smooth Line Marker

    • Scatter Smooth Line

    • Scatter Line Marker

    • Scatter Line

    • Bubble

    • Bubble 3D

Basic Code Samples

For each chart family ChartSetting<ExcelSetting> have its releavent options and settings for customization.

public void ChartSample(Excel excel)
{
	// Default Chart Type
	Excel excel1 = new("./TestFiles/basic_test.xlsx", true);
	Worksheet worksheet = excel1.AddSheet("AreaChart");
	worksheet.AddChart(new()
	{
		cellIdStart = "A1",
		cellIdEnd = "D4"
	}, new AreaChartSetting<ExcelSetting>()
	{
		applicationSpecificSetting = new()
		{
			from = new()
			{
				row = 5,
				column = 5
			},
			to = new()
			{
				row = 20,
				column = 20
			}
		}
	});
}

ChartSetting<ExcelSetting> Options

This section outlines the options available when configuring charts with ChartSetting using ExcelSetting parameters.

ExcelSetting Options

AnchorPosition Options

ChartDataSetting Options

ChartGridLinesOptions Options

ChartLegendOptions Options

ChartDataLabel Options

This is base data label class extended by each chart type to give more specific/relavent options

AdvancedDataLabel Options (2013)

ChartAxesOptions Options

This properties give control over the X and Y axes. (Relate placement based on your chart option)

ChartSeriesSetting Options

ChartDataPointSettings Options

Last updated