Skip to content

This content is for v4.x (Alpha). Switch to the Stable version.

Bar

Add chart method present in slide component or you can replace the chart using shape component.

Basic Code Sample

// Bare minimum
powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK)
.AddChart(CreateDataCellPayload(), new G.BarChartSetting<G.PresentationSetting>());
// Some additional samples
powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK)
.AddChart(CreateDataCellPayload(), new G.BarChartSetting<G.PresentationSetting>()
{
chartAxesOptions = new()
{
isHorizontalAxesEnabled = false,
},
barChartDataLabel = new G.BarChartDataLabel()
{
dataLabelPosition = G.BarChartDataLabel.DataLabelPositionValues.INSIDE_END,
showValue = true,
},
barChartSeriesSettings = new(){
new(),
new(){
barChartDataLabel = new G.BarChartDataLabel(){
dataLabelPosition = G.BarChartDataLabel.DataLabelPositionValues.OUTSIDE_END,
showCategoryName= true
}
}
}
});

BarChartSetting<G.PresentationSetting> Options

Contains options details extended from ChartSetting that are specific to bar chart.

PropertyTypeDetails
barChartDataLabelBarChartDataLabelGeneral Data label option applied for all series
barChartSeriesSettingsList<BarChartSeriesSetting?>Data Series specific options are used from the list. The position on the list is matched with the data series position. you can use null to skip a series
barChartTypesBarChartTypesType of chart
chartAxesOptionsChartAxesOptionsChart axes options
barGraphicsSettingBarGraphicsSettingSet properties related to bar placement

BarChartDataLabel Options

Contains options details extended from ChartDataLabel that are specific to bar chart.

PropertyTypeDetails
dataLabelPositionDataLabelPositionValuesData Label placement options.

barChartSeriesSetting Options

Contains options details extended from ChartSeriesSetting that are specific to bar chart.

barChartDataLabelBarChartDataLabelData Label Option specific to one series
fillColorstring?Fill color specific to one series
barChartDataPointSettingsList<BarChartDataPointSetting?>Data point specific options are used from the list. The position on the list is matched with the data point position. you can use null to skip a data point.

BarGraphicsSetting Options only applied in cluster type

PropertyTypeDetails
categoryGapintGap between Category. Default : 219
seriesGapintGap between Series. Default : -27

BarChartDataPointSetting Options

Contains options details extended from ChartDataPointSetting that are specific to bar chart.