Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelChart

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

Represents a chart on a worksheet.

Inheritance

  • object
  • ExcelChart

Usage

Explore 108 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 106

Accepted by parameters 2

Methods

ApplyStylePreset 2 overloads
public ExcelChart ApplyStylePreset(int styleId = 251, int colorStyleId = 10) #

Applies a built-in chart style/color preset.

Parameters

styleId int = 251 optional
colorStyleId int = 10 optional

Returns

ExcelChart
public ExcelChart ApplyStylePreset(ExcelChartStylePreset preset) #

Applies a chart style/color preset.

Parameters

preset OfficeIMO.Excel.ExcelChartStylePreset required

Returns

ExcelChart
ClearSeriesTrendline 2 overloads
public ExcelChart ClearSeriesTrendline(int seriesIndex) #

Removes trendlines from a chart series by index.

Parameters

seriesIndex int required

Returns

ExcelChart
public ExcelChart ClearSeriesTrendline(string seriesName, bool ignoreCase = true) #

Removes trendlines from a chart series by name.

Parameters

seriesName string required
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart ClearTitle() #

Removes the chart title.

Returns

ExcelChart
public ExcelChart ClearValueAxisDisplayUnits(OfficeChartAxisGroup axisGroup = Primary) #

Clears display units from the value axis.

Parameters

axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart HideLegend() #

Hides the chart legend.

Returns

ExcelChart
SaveAsImage 2 overloads
public OfficeConversionReport SaveAsImage(string path, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Writes the chart to a file and returns its fidelity report.

Parameters

path string required
options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeConversionReport
public OfficeConversionReport SaveAsImage(Stream stream, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Writes the chart to a caller-owned stream and returns its fidelity report.

Parameters

stream System.IO.Stream required
options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeConversionReport
SaveAsImageAsync 2 overloads
public async Task<OfficeConversionReport> SaveAsImageAsync(string path, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously writes the chart to a file and returns its fidelity report.

Parameters

path string required
options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OfficeConversionReport>
public async Task<OfficeConversionReport> SaveAsImageAsync(Stream stream, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously writes the chart to a caller-owned stream and returns its fidelity report.

Parameters

stream System.IO.Stream required
options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OfficeConversionReport>
public ExcelChart SetCategoryAxisCrossing(OfficeChartAxisCrossingPosition crosses, double? crossesAt = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets where the category axis crosses the value axis.

Parameters

crosses OfficeIMO.Drawing.OfficeChartAxisCrossingPosition required
crossesAt double? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisGridlines(bool? showMajor = null, bool? showMinor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets category axis gridlines visibility and optional styling.

Parameters

showMajor bool? = null optional
showMinor bool? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisLabelRotation(double rotationDegrees, OfficeChartAxisGroup axisGroup = Primary) #

Sets the category axis label rotation in degrees (-90..90).

Parameters

rotationDegrees double required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisLabelTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets the category axis label text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisLine(OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noLine = false, OfficeChartAxisGroup axisGroup = Primary) #

Sets category axis line visibility and optional styling.

Parameters

lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noLine bool = false optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
SetCategoryAxisNumberFormat 2 overloads
public ExcelChart SetCategoryAxisNumberFormat(string formatCode, bool sourceLinked = false) #

Sets the category axis number format.

Parameters

formatCode string required
sourceLinked bool = false optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisNumberFormat(string formatCode, bool sourceLinked, OfficeChartAxisGroup axisGroup) #

Sets the category axis number format for the selected axis group.

Parameters

formatCode string required
sourceLinked bool required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup required

Returns

ExcelChart
public ExcelChart SetCategoryAxisReverseOrder(bool reverseOrder = true, OfficeChartAxisGroup axisGroup = Primary) #

Sets the category axis orientation (normal or reversed order).

Parameters

reverseOrder bool = true optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetCategoryAxisScale(double? minimum = null, double? maximum = null, double? majorUnit = null, double? minorUnit = null, bool? reverseOrder = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets category axis scale parameters for line, bar, column, and area charts.

Parameters

minimum double? = null optional
Optional minimum category-axis value.
maximum double? = null optional
Optional maximum category-axis value.
majorUnit double? = null optional
Optional major unit spacing.
minorUnit double? = null optional
Optional minor unit spacing.
reverseOrder bool? = null optional
Optional category order direction.
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional
Primary or secondary category axis.

Returns

ExcelChart
public ExcelChart SetCategoryAxisTickLabelPosition(OfficeChartAxisTickLabelPosition position, OfficeChartAxisGroup axisGroup = Primary) #

Sets the category axis tick label position.

Parameters

position OfficeIMO.Drawing.OfficeChartAxisTickLabelPosition required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
SetCategoryAxisTitle 2 overloads
public ExcelChart SetCategoryAxisTitle(string title) #

Sets the category axis title.

Parameters

title string required

Returns

ExcelChart
public ExcelChart SetCategoryAxisTitle(string title, OfficeChartAxisGroup axisGroup) #

Sets the category axis title for the selected axis group.

Parameters

title string required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup required

Returns

ExcelChart
public ExcelChart SetCategoryAxisTitleTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets the category axis title text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetChartAreaStyle(OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false) #

Sets chart area fill/line styling.

Parameters

fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional

Returns

ExcelChart
public ExcelChart SetDataLabelCallouts(bool enabled = true, OfficeChartDataLabelPosition? position = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Enables callout-style labels by positioning labels outside with leader lines.

Parameters

enabled bool = true optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetDataLabelLeaderLines(bool showLeaderLines = true, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Configures data label leader lines for all chart labels.

Parameters

showLeaderLines bool = true optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetDataLabels(bool? showValue = null, bool? showCategoryName = null, bool? showSeriesName = null, bool? showLegendKey = null, bool? showPercent = null, OfficeChartDataLabelPosition? position = null, string? numberFormat = null, bool? sourceLinked = null) #

Updates supplied data-label settings for all supported chart families; omitted flags, position and number-format settings remain unchanged.

Parameters

showValue bool? = null optional
showCategoryName bool? = null optional
showSeriesName bool? = null optional
showLegendKey bool? = null optional
showPercent bool? = null optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
numberFormat string? = null optional
sourceLinked bool? = null optional

Returns

ExcelChart
public ExcelChart SetDataLabelSeparator(string? separator) #

Sets the separator for all data labels.

Parameters

separator string? required

Returns

ExcelChart
public ExcelChart SetDataLabelShapeStyle(OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false) #

Sets data label shape styling for all chart labels.

Parameters

fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional

Returns

ExcelChart
public ExcelChart SetDataLabelTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null) #

Sets data label text style for all chart labels.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional

Returns

ExcelChart
SetDataPointColor 2 overloads
public ExcelChart SetDataPointColor(int seriesIndex, uint pointIndex, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Sets fill and/or outline styling for a single chart data point by series index and zero-based point index.

Parameters

seriesIndex int required
pointIndex uint required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetDataPointColor(string seriesName, uint pointIndex, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool ignoreCase = true) #

Sets fill and/or outline styling for a single chart data point by series name and zero-based point index.

Parameters

seriesName string required
pointIndex uint required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetDataPointExplosion(int seriesIndex, uint pointIndex, int? percent) #

Sets one pie or doughnut slice's outward offset as a percentage of its radius. Null restores the series offset; zero explicitly removes the slice offset.

Parameters

seriesIndex int required
pointIndex uint required
percent int? required

Returns

ExcelChart
SetDataPointFillColor 2 overloads
public ExcelChart SetDataPointFillColor(int seriesIndex, uint pointIndex, OfficeColor color) #

Sets the fill color for a single chart data point by series index and zero-based point index.

Parameters

seriesIndex int required
pointIndex uint required
color OfficeIMO.OfficeColor required

Returns

ExcelChart
public ExcelChart SetDataPointFillColor(string seriesName, uint pointIndex, OfficeColor color, bool ignoreCase = true) #

Sets the fill color for a single chart data point by series name and zero-based point index.

Parameters

seriesName string required
pointIndex uint required
color OfficeIMO.OfficeColor required
ignoreCase bool = true optional

Returns

ExcelChart
SetDataPointLineColor 2 overloads
public ExcelChart SetDataPointLineColor(int seriesIndex, uint pointIndex, OfficeColor color, OfficeLength? width = null) #

Sets the outline color and optional outline width for a single chart data point by series index and zero-based point index.

Parameters

seriesIndex int required
pointIndex uint required
color OfficeIMO.OfficeColor required
width OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetDataPointLineColor(string seriesName, uint pointIndex, OfficeColor color, OfficeLength? width = null, bool ignoreCase = true) #

Sets the outline color and optional outline width for a single chart data point by series name and zero-based point index.

Parameters

seriesName string required
pointIndex uint required
color OfficeIMO.OfficeColor required
width OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetDataPointStyle(int seriesIndex, uint pointIndex, OfficeChartPointStyle? style) #

Replaces a point's fill/outline overrides. Null restores series/theme inheritance.

Parameters

seriesIndex int required
pointIndex uint required
style OfficeIMO.Drawing.OfficeChartPointStyle? required

Returns

ExcelChart
public ExcelChart SetLegend(OfficeChartLegendPosition? position = null, bool? overlay = null) #

Shows the legend and updates only the supplied position or overlay state.

Parameters

position OfficeIMO.Drawing.OfficeChartLegendPosition? = null optional
overlay bool? = null optional

Returns

ExcelChart
public ExcelChart SetLegendTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null) #

Sets the legend text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional

Returns

ExcelChart
public ExcelChart SetPivotSource(string pivotTableName, uint formatId = 0) #

Marks the chart as sourced from a pivot table.

Parameters

pivotTableName string required
Pivot table name to assign as the chart's pivot source.
formatId uint = 0 optional
Pivot chart format id.

Returns

ExcelChart
public ExcelChart SetPlotAreaStyle(OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false) #

Sets plot area fill/line styling.

Parameters

fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional

Returns

ExcelChart
public ExcelChart SetRadialLayout(OfficeChartRadialLayout layout) #

Sets geometry for an existing native two-dimensional pie or doughnut chart.

Parameters

layout OfficeIMO.Drawing.OfficeChartRadialLayout required

Returns

ExcelChart
public ExcelChart SetScatterXAxisCrossing(OfficeChartAxisCrossingPosition crosses, double? crossesAt = null) #

Sets where the scatter X-axis crosses the Y-axis.

Parameters

crosses OfficeIMO.Drawing.OfficeChartAxisCrossingPosition required
crossesAt double? = null optional

Returns

ExcelChart
public ExcelChart SetScatterXAxisScale(double? minimum = null, double? maximum = null, double? majorUnit = null, double? minorUnit = null, bool? reverseOrder = null, bool? logScale = null, double? logBase = null) #

Sets scatter chart X-axis scale (value axis on the bottom).

Parameters

minimum double? = null optional
maximum double? = null optional
majorUnit double? = null optional
minorUnit double? = null optional
reverseOrder bool? = null optional
logScale bool? = null optional
logBase double? = null optional

Returns

ExcelChart
public ExcelChart SetScatterYAxisCrossing(OfficeChartAxisCrossingPosition crosses, double? crossesAt = null) #

Sets where the scatter Y-axis crosses the X-axis.

Parameters

crosses OfficeIMO.Drawing.OfficeChartAxisCrossingPosition required
crossesAt double? = null optional

Returns

ExcelChart
public ExcelChart SetScatterYAxisScale(double? minimum = null, double? maximum = null, double? majorUnit = null, double? minorUnit = null, bool? reverseOrder = null, bool? logScale = null, double? logBase = null) #

Sets scatter chart Y-axis scale (value axis on the left).

Parameters

minimum double? = null optional
maximum double? = null optional
majorUnit double? = null optional
minorUnit double? = null optional
reverseOrder bool? = null optional
logScale bool? = null optional
logBase double? = null optional

Returns

ExcelChart
public ExcelChart SetSecondaryValueAxis(OfficeChartValueAxisLayout layout) #

Sets independent bounds, tick spacing and appearance, and number format on the existing secondary value axis.

Parameters

layout OfficeIMO.Drawing.OfficeChartValueAxisLayout required

Returns

ExcelChart
SetSeriesDataLabelCallouts 2 overloads
public ExcelChart SetSeriesDataLabelCallouts(int seriesIndex, bool enabled = true, OfficeChartDataLabelPosition? position = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Enables callout-style labels for a series by index.

Parameters

seriesIndex int required
enabled bool = true optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelCallouts(string seriesName, bool enabled = true, OfficeChartDataLabelPosition? position = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool ignoreCase = true) #

Enables callout-style labels for a series by name.

Parameters

seriesName string required
enabled bool = true optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelForPoint 2 overloads
public ExcelChart SetSeriesDataLabelForPoint(int seriesIndex, int pointIndex, bool? showValue = null, bool? showCategoryName = null, bool? showSeriesName = null, bool? showLegendKey = null, bool? showPercent = null, bool? showBubbleSize = null, OfficeChartDataLabelPosition? position = null, string? numberFormat = null, bool sourceLinked = false) #

Configures a single data label point by series index and point index.

Parameters

seriesIndex int required
pointIndex int required
showValue bool? = null optional
showCategoryName bool? = null optional
showSeriesName bool? = null optional
showLegendKey bool? = null optional
showPercent bool? = null optional
showBubbleSize bool? = null optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
numberFormat string? = null optional
sourceLinked bool = false optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelForPoint(string seriesName, int pointIndex, bool? showValue = null, bool? showCategoryName = null, bool? showSeriesName = null, bool? showLegendKey = null, bool? showPercent = null, bool? showBubbleSize = null, OfficeChartDataLabelPosition? position = null, string? numberFormat = null, bool sourceLinked = false, bool ignoreCase = true) #

Configures a single data label point by series name and point index.

Parameters

seriesName string required
pointIndex int required
showValue bool? = null optional
showCategoryName bool? = null optional
showSeriesName bool? = null optional
showLegendKey bool? = null optional
showPercent bool? = null optional
showBubbleSize bool? = null optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
numberFormat string? = null optional
sourceLinked bool = false optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelLeaderLines 2 overloads
public ExcelChart SetSeriesDataLabelLeaderLines(int seriesIndex, bool showLeaderLines = true, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Configures data label leader lines for a series by index.

Parameters

seriesIndex int required
showLeaderLines bool = true optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelLeaderLines(string seriesName, bool showLeaderLines = true, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool ignoreCase = true) #

Configures data label leader lines for a series by name.

Parameters

seriesName string required
showLeaderLines bool = true optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabels 2 overloads
public ExcelChart SetSeriesDataLabels(int seriesIndex, bool showValue = true, bool showCategoryName = false, bool showSeriesName = false, bool showLegendKey = false, bool showPercent = false, OfficeChartDataLabelPosition? position = null, string? numberFormat = null, bool sourceLinked = false) #

Configures data labels for a single series by index.

Parameters

seriesIndex int required
showValue bool = true optional
showCategoryName bool = false optional
showSeriesName bool = false optional
showLegendKey bool = false optional
showPercent bool = false optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
numberFormat string? = null optional
sourceLinked bool = false optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabels(string seriesName, bool showValue = true, bool showCategoryName = false, bool showSeriesName = false, bool showLegendKey = false, bool showPercent = false, OfficeChartDataLabelPosition? position = null, string? numberFormat = null, bool sourceLinked = false, bool ignoreCase = true) #

Configures data labels for a single series by name.

Parameters

seriesName string required
showValue bool = true optional
showCategoryName bool = false optional
showSeriesName bool = false optional
showLegendKey bool = false optional
showPercent bool = false optional
position OfficeIMO.Drawing.OfficeChartDataLabelPosition? = null optional
numberFormat string? = null optional
sourceLinked bool = false optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelSeparator 2 overloads
public ExcelChart SetSeriesDataLabelSeparator(int seriesIndex, string? separator) #

Sets the separator for data labels in a series by index.

Parameters

seriesIndex int required
separator string? required

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelSeparator(string seriesName, string? separator, bool ignoreCase = true) #

Sets the separator for data labels in a series by name.

Parameters

seriesName string required
separator string? required
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelSeparatorForPoint 2 overloads
public ExcelChart SetSeriesDataLabelSeparatorForPoint(int seriesIndex, int pointIndex, string? separator) #

Sets the separator for a specific data label point by series index.

Parameters

seriesIndex int required
pointIndex int required
separator string? required

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelSeparatorForPoint(string seriesName, int pointIndex, string? separator, bool ignoreCase = true) #

Sets the separator for a specific data label point by series name.

Parameters

seriesName string required
pointIndex int required
separator string? required
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelShapeStyle 2 overloads
public ExcelChart SetSeriesDataLabelShapeStyle(int seriesIndex, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false) #

Sets data label shape styling for a series by index.

Parameters

seriesIndex int required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelShapeStyle(string seriesName, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false, bool ignoreCase = true) #

Sets data label shape styling for a series by name.

Parameters

seriesName string required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelShapeStyleForPoint 2 overloads
public ExcelChart SetSeriesDataLabelShapeStyleForPoint(int seriesIndex, int pointIndex, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false) #

Sets data label shape styling for a specific point by series index.

Parameters

seriesIndex int required
pointIndex int required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelShapeStyleForPoint(string seriesName, int pointIndex, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noFill = false, bool noLine = false, bool ignoreCase = true) #

Sets data label shape styling for a specific point by series name.

Parameters

seriesName string required
pointIndex int required
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noFill bool = false optional
noLine bool = false optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesDataLabelTemplate 2 overloads
public ExcelChart SetSeriesDataLabelTemplate(int seriesIndex, ExcelChartDataLabelTemplate template) #

Applies a reusable data label template to a series by index.

Parameters

seriesIndex int required
template OfficeIMO.Excel.ExcelChartDataLabelTemplate required

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelTemplate(string seriesName, ExcelChartDataLabelTemplate template, bool ignoreCase = true) #

Applies a reusable data label template to a series by name.

Parameters

seriesName string required
template OfficeIMO.Excel.ExcelChartDataLabelTemplate required
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelTextStyle(int seriesIndex, OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null) #

Sets data label text style for a series by index.

Parameters

seriesIndex int required
fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelTextStyleByName(string seriesName, OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, bool ignoreCase = true) #

Sets data label text style for a series by name.

Parameters

seriesName string required
fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelTextStyleForPoint(int seriesIndex, int pointIndex, OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null) #

Sets data label text style for a specific point by series index.

Parameters

seriesIndex int required
pointIndex int required
fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesDataLabelTextStyleForPointByName(string seriesName, int pointIndex, OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, bool ignoreCase = true) #

Sets data label text style for a specific point by series name.

Parameters

seriesName string required
pointIndex int required
fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesFillColor 2 overloads
public ExcelChart SetSeriesFillColor(int seriesIndex, OfficeColor color) #

Sets the fill color for a chart series by index.

Parameters

seriesIndex int required
color OfficeIMO.OfficeColor required

Returns

ExcelChart
public ExcelChart SetSeriesFillColor(string seriesName, OfficeColor color, bool ignoreCase = true) #

Sets the fill color for a chart series by name.

Parameters

seriesName string required
color OfficeIMO.OfficeColor required
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesLineColor 2 overloads
public ExcelChart SetSeriesLineColor(int seriesIndex, OfficeColor color, OfficeLength? width = null) #

Sets the line color for a chart series by index.

Parameters

seriesIndex int required
color OfficeIMO.OfficeColor required
width OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesLineColor(string seriesName, OfficeColor color, OfficeLength? width = null, bool ignoreCase = true) #

Sets the line color for a chart series by name.

Parameters

seriesName string required
color OfficeIMO.OfficeColor required
width OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetSeriesMarker(int seriesIndex, OfficeChartMarkerShape? style = null, OfficeLength? size = null, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Sets the marker style for a chart series by index.

Parameters

seriesIndex int required
style OfficeIMO.Drawing.OfficeChartMarkerShape? = null optional
size OfficeIMO.OfficeLength? = null optional
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesMarkerByName(string seriesName, OfficeChartMarkerShape? style = null, OfficeLength? size = null, OfficeColor? fillColor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool ignoreCase = true) #

Sets the marker style for a chart series by name.

Parameters

seriesName string required
style OfficeIMO.Drawing.OfficeChartMarkerShape? = null optional
size OfficeIMO.OfficeLength? = null optional
fillColor OfficeIMO.OfficeColor? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetSeriesNoFill(int seriesIndex, bool noLine = true) #

Removes the fill from a chart series and optionally removes its outline.

Parameters

seriesIndex int required
noLine bool = true optional

Returns

ExcelChart
SetSeriesPointFillColor 2 overloads
public ExcelChart SetSeriesPointFillColor(int seriesIndex, int pointIndex, OfficeColor color) #

Sets the fill color for one point in a chart series by index.

Parameters

seriesIndex int required
pointIndex int required
color OfficeIMO.OfficeColor required

Returns

ExcelChart
public ExcelChart SetSeriesPointFillColor(string seriesName, int pointIndex, OfficeColor color, bool ignoreCase = true) #

Sets the fill color for one point in a chart series by name.

Parameters

seriesName string required
pointIndex int required
color OfficeIMO.OfficeColor required
ignoreCase bool = true optional

Returns

ExcelChart
SetSeriesTrendline 2 overloads
public ExcelChart SetSeriesTrendline(int seriesIndex, OfficeChartTrendlineType type, int? order = null, int? period = null, double? forward = null, double? backward = null, double? intercept = null, bool displayEquation = false, bool displayRSquared = false, OfficeColor? lineColor = null, OfficeLength? lineWidth = null) #

Adds or replaces a trendline for a chart series by index.

Parameters

seriesIndex int required
type OfficeIMO.Drawing.OfficeChartTrendlineType required
order int? = null optional
period int? = null optional
forward double? = null optional
backward double? = null optional
intercept double? = null optional
displayEquation bool = false optional
displayRSquared bool = false optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional

Returns

ExcelChart
public ExcelChart SetSeriesTrendline(string seriesName, OfficeChartTrendlineType type, int? order = null, int? period = null, double? forward = null, double? backward = null, double? intercept = null, bool displayEquation = false, bool displayRSquared = false, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool ignoreCase = true) #

Adds or replaces a trendline for a chart series by name.

Parameters

seriesName string required
type OfficeIMO.Drawing.OfficeChartTrendlineType required
order int? = null optional
period int? = null optional
forward double? = null optional
backward double? = null optional
intercept double? = null optional
displayEquation bool = false optional
displayRSquared bool = false optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
ignoreCase bool = true optional

Returns

ExcelChart
public ExcelChart SetTitle(string title) #

Sets the chart title text.

Parameters

title string required

Returns

ExcelChart
public ExcelChart SetTitleTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null) #

Sets the chart title text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional

Returns

ExcelChart
public ExcelChart SetValueAxisCrossBetween(OfficeChartAxisCrossBetween between, OfficeChartAxisGroup axisGroup = Primary) #

Sets how the value axis crosses between categories.

Parameters

between OfficeIMO.Drawing.OfficeChartAxisCrossBetween required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisCrossing(OfficeChartAxisCrossingPosition crosses, double? crossesAt = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets where the value axis crosses the category axis.

Parameters

crosses OfficeIMO.Drawing.OfficeChartAxisCrossingPosition required
crossesAt double? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
SetValueAxisDisplayUnits 4 overloads
public ExcelChart SetValueAxisDisplayUnits(OfficeChartDisplayUnit unit, bool showLabel = true, OfficeChartAxisGroup axisGroup = Primary) #

Sets display units for the value axis.

Parameters

unit OfficeIMO.Drawing.OfficeChartDisplayUnit required
showLabel bool = true optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisDisplayUnits(OfficeChartDisplayUnit unit, string labelText, bool showLabel = true, OfficeChartAxisGroup axisGroup = Primary) #

Sets display units for the value axis with custom label text.

Parameters

unit OfficeIMO.Drawing.OfficeChartDisplayUnit required
labelText string required
showLabel bool = true optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisDisplayUnits(double customUnit, bool showLabel = true, OfficeChartAxisGroup axisGroup = Primary) #

Sets custom display units for the value axis.

Parameters

customUnit double required
showLabel bool = true optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisDisplayUnits(double customUnit, string labelText, bool showLabel = true, OfficeChartAxisGroup axisGroup = Primary) #

Sets custom display units for the value axis with custom label text.

Parameters

customUnit double required
labelText string required
showLabel bool = true optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisGridlines(bool? showMajor = null, bool? showMinor = null, OfficeColor? lineColor = null, OfficeLength? lineWidth = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets value axis gridlines visibility and optional styling.

Parameters

showMajor bool? = null optional
showMinor bool? = null optional
lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisLabelRotation(double rotationDegrees, OfficeChartAxisGroup axisGroup = Primary) #

Sets the value axis label rotation in degrees (-90..90).

Parameters

rotationDegrees double required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisLabelTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets the value axis label text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
public ExcelChart SetValueAxisLine(OfficeColor? lineColor = null, OfficeLength? lineWidth = null, bool noLine = false, OfficeChartAxisGroup axisGroup = Primary) #

Sets value axis line visibility and optional styling.

Parameters

lineColor OfficeIMO.OfficeColor? = null optional
lineWidth OfficeIMO.OfficeLength? = null optional
noLine bool = false optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
SetValueAxisNumberFormat 2 overloads
public ExcelChart SetValueAxisNumberFormat(string formatCode, bool sourceLinked = false) #

Sets the value axis number format.

Parameters

formatCode string required
sourceLinked bool = false optional

Returns

ExcelChart
public ExcelChart SetValueAxisNumberFormat(string formatCode, bool sourceLinked, OfficeChartAxisGroup axisGroup) #

Sets the value axis number format for the selected axis group.

Parameters

formatCode string required
sourceLinked bool required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup required

Returns

ExcelChart
public ExcelChart SetValueAxisScale(double? minimum = null, double? maximum = null, double? majorUnit = null, double? minorUnit = null, double? logBase = null, bool? reverseOrder = null, OfficeChartAxisGroup axisGroup = Primary, bool? logScale = null) #

Sets value axis scale parameters for the selected axis group.

Parameters

minimum double? = null optional
maximum double? = null optional
majorUnit double? = null optional
minorUnit double? = null optional
logBase double? = null optional
reverseOrder bool? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional
logScale bool? = null optional

Returns

ExcelChart
public ExcelChart SetValueAxisTickLabelPosition(OfficeChartAxisTickLabelPosition position, OfficeChartAxisGroup axisGroup = Primary) #

Sets the value axis tick label position.

Parameters

position OfficeIMO.Drawing.OfficeChartAxisTickLabelPosition required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
SetValueAxisTitle 2 overloads
public ExcelChart SetValueAxisTitle(string title) #

Sets the value axis title.

Parameters

title string required

Returns

ExcelChart
public ExcelChart SetValueAxisTitle(string title, OfficeChartAxisGroup axisGroup) #

Sets the value axis title for the selected axis group.

Parameters

title string required
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup required

Returns

ExcelChart
public ExcelChart SetValueAxisTitleTextStyle(OfficeLength? fontSize = null, bool? bold = null, bool? italic = null, OfficeColor? color = null, string? fontFamily = null, OfficeChartAxisGroup axisGroup = Primary) #

Sets the value axis title text style.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
bold bool? = null optional
italic bool? = null optional
color OfficeIMO.OfficeColor? = null optional
fontFamily string? = null optional
axisGroup OfficeIMO.Drawing.OfficeChartAxisGroup = Primary optional

Returns

ExcelChart
ToImage 3 overloads
public OfficeImageExportResult ToImage(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Renders the chart using the encoding in OfficeImageExportOptions.Format.

Parameters

options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeImageExportResult
public OfficeImageExportResult ToImage(ExcelImageExportOptions? options, out OfficeConversionReport report, CancellationToken cancellationToken = default) #

Renders the chart and returns its immutable fidelity report.

Parameters

options OfficeIMO.Excel.ExcelImageExportOptions? required
report OfficeIMO.OfficeConversionReport required
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeImageExportResult
public OfficeImageExportResult ToImage(OfficeImageExportFormat format, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Exports this chart through the shared dependency-free chart renderer.

Parameters

format OfficeIMO.Drawing.OfficeImageExportFormat required
Target image format.
options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
Shared Excel image-export settings.
cancellationToken System.Threading.CancellationToken = default optional
Token used to cancel rendering.

Returns

OfficeImageExportResult The encoded chart image and any fidelity diagnostics.
public async Task<OfficeImageExportResult> ToImageAsync(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Renders the chart with cancellation and returns the encoded image and its diagnostics.

Parameters

options OfficeIMO.Excel.ExcelImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OfficeImageExportResult>
public bool TryGetData(out ExcelChartData data) #

Tries to read the chart data from the chart's source range.

Parameters

data OfficeIMO.Excel.ExcelChartData required

Returns

bool
public bool TryGetSnapshot(out ExcelChartInfo snapshot) #

Tries to create a dependency-free snapshot for rendering/export consumers.

Parameters

snapshot OfficeIMO.Excel.ExcelChartInfo required

Returns

bool
public ExcelChart UpdateData(ExcelChartData data, ExcelChartDataRange? dataRange = null, bool writeToSheet = true) #

Updates the chart data (series and categories).

Parameters

data OfficeIMO.Excel.ExcelChartData required
dataRange OfficeIMO.Excel.ExcelChartDataRange? = null optional
writeToSheet bool = true optional

Returns

ExcelChart
public ExcelChart UpdateData<T>(IEnumerable<T?> items, Func<T?, string> categorySelector, params ExcelChartSeriesDefinition<T?>[] seriesDefinitions) #

Updates the chart data using selectors.

Type Parameters

T

Parameters

items System.Collections.Generic.IEnumerable<T?> required
categorySelector System.Func<T?, string> required
seriesDefinitions OfficeIMO.Excel.ExcelChartSeriesDefinition<T?>[] required

Returns

ExcelChart

Properties

public string Name { get; set; } #

Gets or sets the chart name (non-visual drawing name).

public ExcelChartDataRange? DataRange { get; } #

Gets the chart data range when it is known.

public int DrawingOrder { get; } #

Gets this chart anchor's zero-based order in the worksheet drawing layer.

public OfficeChartType ChartType { get; } #

Gets the detected chart type.

public string? Title { get; } #

Gets the chart title text when present.

public bool IsPivotChart { get; } #

Gets whether the chart declares a pivot table source.

public string? PivotTableName { get; } #

Gets the pivot table name used as this chart's pivot source, if present.

public OfficeChartRadialLayout RadialLayout { get; } #

Native pie rotation and doughnut hole geometry, with native defaults when unspecified.

Extension Methods

public static ExcelChart ApplyDashboardPreset(ExcelChart chart, ExcelDashboardChartPreset preset = Comparison, int? styleId = null, int? colorStyleId = null) #

Applies a dashboard preset's style, legend and data labels to an existing chart.

Parameters

chart OfficeIMO.Excel.ExcelChart required
Chart to restyle.
preset OfficeIMO.Excel.Reports.ExcelDashboardChartPreset = Comparison optional
The dashboard appearance preset.
styleId int? = null optional
Optional chart style override.
colorStyleId int? = null optional
Optional chart color-style override.

Returns

ExcelChart The same chart for further editing.