Skip to content

Column

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.ColumnChartSetting<G.PresentationSetting>());
// Some additional samples
powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK)
.AddChart(CreateDataCellPayload(), new G.ColumnChartSetting<G.PresentationSetting>()
{
titleOptions = new()
{
title = "Column Chart"
},
chartLegendOptions = new G.ChartLegendOptions()
{
legendPosition = G.ChartLegendOptions.LegendPositionValues.TOP,
fontSize = 5
},
columnChartSeriesSettings = new(){
null,
new(){
columnChartDataPointSettings = new(){
null,
new(){
fillColor = "FF0000"
},
new(){
fillColor = "00FF00"
},
},
fillColor= "AABBCC"
},
new(){
fillColor= "CCBBAA"
}
}
});

ColumnChartSetting<G.PresentationSetting> Options

Section titled “ColumnChartSetting<G.PresentationSetting> Options”

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

PropertyTypeDetails
columnChartDataLabelColumnChartDataLabelGeneral Data label option applied for all series
columnChartSeriesSettingsList<ColumnChartSeriesSetting?>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
columnChartTypesColumnChartTypesType of chart
chartAxesOptionsChartAxesOptionsChart axes options
columnGraphicsSettingColumnGraphicsSettingSet properties related to bar placement

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

PropertyTypeDetails
dataLabelPositionDataLabelPositionValuesData Label placement options.

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

columnChartDataLabelColumnChartDataLabelData Label Option specific to one series
fillColorstring?Fill color specific to one series
columnChartDataPointSettingsList<ColumnChartDataPointSetting?>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.

ColumnGraphicsSetting Options only applied in cluster type

Section titled “ColumnGraphicsSetting 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 column chart.