Skip to content

Bar

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

// 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

Section titled “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

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

PropertyTypeDetails
dataLabelPositionDataLabelPositionValuesData Label placement 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

Section titled “BarGraphicsSetting Options only applied in cluster type”
PropertyTypeDetails
categoryGapintGap between Category. Default : 219
seriesGapintGap between Series. Default : -27

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