[]
An IChartGroup is a member of the IChartGroups collection. Use this interface to access and configure group-level settings that apply to the series in the same chart group, such as axis grouping and chart-type-specific options.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 10},
{"Feb", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 10, 10, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
longbooleangetBinsOverflowValue() property is enabled.doublebooleangetBinsUnderflowValue() property is enabled.doubledoubleintintIChartLines object that represents the drop lines for a series on a line chart or area chart.intintbooleanbooleanbooleanbooleanIChartLines object that represents the high-low lines for a series on a line chart.intIChart that contains this chart group.intIChartLines object that represents the series lines for the chart group.booleanintbooleanvoidsetAxisGroup(AxisGroup value) voidsetBinsCountValue(long value) voidsetBinsOverflowEnabled(boolean value) getBinsOverflowValue() property is enabled.voidsetBinsOverflowValue(double value) voidsetBinsType(BinsType value) voidsetBinsUnderflowEnabled(boolean value) getBinsUnderflowValue() property is enabled.voidsetBinsUnderflowValue(double value) voidsetBinWidthValue(double value) voidsetBubbleScale(int value) voidsetDoughnutHoleSize(int value) voidsetFirstSliceAngle(int value) voidsetGapWidth(int value) voidsetHasDropLines(boolean value) voidsetHasHiLoLines(boolean value) voidsetHasSeriesLines(boolean value) voidsetHasUpDownBars(boolean value) voidsetOverlap(int value) voidsetSecondPlotSize(int value) voidsetShowNegativeBubbles(boolean value) voidsetSizeRepresents(SizeRepresents value) voidsetSplitType(ChartSplitType value) voidsetSplitValue(int value) voidsetVaryByCategories(boolean value) IChart that contains this chart group.Use this method to access the chart that owns the current chart group after retrieving the group from IChart.getChartGroups().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 100},
{"Feb", 120}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
IChart parent = chart.getChartGroups().get(0).getParent();
IChart of this chart group.The returned AxisGroup value indicates whether the chart group is plotted on the primary axis group or the secondary axis group.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 100},
{"Feb", 120}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
AxisGroup axisGroup = chartGroup.getAxisGroup();
AxisGroup of the chart group.Use this method to plot the chart group on either the primary axis group or the secondary axis group.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setAxisGroup(AxisGroup.Secondary);
AxisGroup axisGroup = chartGroup.getAxisGroup();
value - The AxisGroup to assign to the chart group.The returned value is an integer from 0 to 300, representing a percentage of the default bubble size. This property applies only to bubble charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{1, 2, 10},
{2, 3, 20},
{3, 5, 30},
{4, 4, 25}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
int bubbleScale = chartGroup.getBubbleScale();
The value must be an integer from 0 to 300, representing a percentage of the default bubble size. This property applies only to bubble charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{1, 2, 10},
{2, 3, 20},
{3, 5, 30},
{4, 4, 25}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBubbleScale(0);
value - The bubble scale as a percentage of the default bubble size, from 0 to 300.The hole size is expressed as a percentage of the chart size, from 10 to 90.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Sales"},
{"North", 10},
{"South", 20},
{"West", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Doughnut, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
IChartGroup doughnutGroup = chart.getDoughnutGroups().get(0);
int holeSize = doughnutGroup.getDoughnutHoleSize();
The hole size is expressed as a percentage of the chart size, from 10 to 90.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Sales"},
{"North", 10},
{"South", 20},
{"West", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Doughnut, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
IChartGroup doughnutGroup = chart.getDoughnutGroups().get(0);
doughnutGroup.setDoughnutHoleSize(10);
value - The hole size of the doughnut chart group, expressed as a percentage of the chart size, from 10 to 90.The returned IChartBars object represents the bars drawn for points where one line series decreases relative to another. This property applies only to line charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Planned", "Actual"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasUpDownBars(true);
IChartBars downBars = chartGroup.getDownBars();
IChartBars object that represents the down bars on the line chart.IChartLines object that represents the drop lines for a series on a line chart or area chart. This property applies only to line charts and area charts. Use setHasDropLines(boolean) to show or hide the drop lines before accessing their formatting.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "North", "South"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasDropLines(true);
IChartLines dropLines = chartGroup.getDropLines();
dropLines.getFormat().getLine().getColor().setRGB(Color.GetBlue());
IChartLines object that represents the drop lines for the current chart group.The angle is measured clockwise from the vertical direction. This property applies only to pie, 3-D pie, and doughnut charts. Use setFirstSliceAngle(int) to change the starting angle of the first slice.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Value"}, {"A", 30}, {"B", 70}
});
IShape shape = worksheet.getShapes().addChart(ChartType.Doughnut, 20, 20, 300, 200);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
shape.getChart().getChartGroups().get(0).setFirstSliceAngle(45);
int angle = shape.getChart().getChartGroups().get(0).getFirstSliceAngle();
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Value"}, {"A", 30}, {"B", 70}
});
IShape shape = worksheet.getShapes().addChart(ChartType.Doughnut, 20, 20, 300, 200);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
shape.getChart().getChartGroups().get(0).setFirstSliceAngle(45);
value - The angle of the first slice, in degrees measured clockwise from vertical.For bar and column charts, the gap width specifies the space between bar or column clusters as a percentage of the bar or column width. For Pie of Pie and Bar of Pie charts, it specifies the space between the primary and secondary sections of the chart.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Sales"},
{"North", 10},
{"South", 20},
{"West", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
chart.getChartGroups().get(0).setGapWidth(150);
int gapWidth = chart.getChartGroups().get(0).getGapWidth();
For bar and column charts, the gap width specifies the space between bar or column clusters as a percentage of the bar or column width. For Pie of Pie and Bar of Pie charts, it specifies the space between the primary and secondary sections of the chart.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Sales"},
{"North", 10},
{"South", 20},
{"West", 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
chart.getChartGroups().get(0).setGapWidth(150);
value - The gap width of the chart group.This property applies only to line charts and area charts. Use setHasDropLines(boolean) to enable or disable drop lines for the current chart group.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "North", "South"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasDropLines(true);
boolean hasDropLines = chartGroup.getHasDropLines();
true if the chart group has drop lines; otherwise, false.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "North", "South"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasDropLines(true);
value - true if the chart group has drop lines; otherwise, false.This property applies only to line charts. Use setHasHiLoLines(boolean) to show or hide high-low lines for the current chart group.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Series 1", "Series 2"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasHiLoLines(true);
boolean hasHiLoLines = chartGroup.getHasHiLoLines();
true if the line chart has high-low lines; otherwise, false.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Series 1", "Series 2"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasHiLoLines(true);
value - true if the line chart has high-low lines; otherwise, false.Returns true if a stacked column chart or bar chart displays series lines, or if a Pie of Pie chart or Bar of Pie chart displays connector lines between the two sections. This property applies only to stacked column charts, bar charts, Pie of Pie charts, and Bar of Pie charts.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Value"},
{"A", 30},
{"B", 70}
});
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
chart.getChartGroups().get(0).setHasSeriesLines(true);
boolean hasSeriesLines = chart.getChartGroups().get(0).getHasSeriesLines();
true if the chart group has series lines or connector lines; otherwise, false.Set value to true to display series lines for a stacked column chart or bar chart, or connector lines between the two sections of a Pie of Pie chart or Bar of Pie chart. This property applies only to stacked column charts, bar charts, Pie of Pie charts, and Bar of Pie charts.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Value"},
{"A", 30},
{"B", 70}
});
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
chart.getChartGroups().get(0).setHasSeriesLines(true);
value - true if the chart group has series lines or connector lines; otherwise, false.This property applies only to line charts. Use setHasUpDownBars(boolean) to show or hide up and down bars for the current chart group before accessing related formatting through getUpBars() or getDownBars().
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Series 1", "Series 2"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasUpDownBars(true);
boolean hasUpDownBars = chartGroup.getHasUpDownBars();
true if the line chart has up and down bars; otherwise, false.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Series 1", "Series 2"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasUpDownBars(true);
value - true if the line chart has up and down bars; otherwise, false.IChartLines object that represents the high-low lines for a series on a line chart. This property applies only to line charts. Use setHasHiLoLines(boolean) to show or hide the high-low lines before accessing their formatting.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Series 1", "Series 2"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getLineGroups().get(0);
chartGroup.setHasHiLoLines(true);
IChartLines hiLoLines = chartGroup.getHiLoLines();
hiLoLines.getFormat().getLine().getColor().setRGB(Color.GetRed());
IChartLines object that represents the high-low lines for the current chart group. Returns null if high-low lines are not enabled.The returned value can be between -100 and 100. This property applies only to 2-D bar charts and 2-D column charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Target"},
{"Jan", 10, 12},
{"Feb", 14, 11},
{"Mar", 16, 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getColumnGroups().get(0);
int overlap = chartGroup.getOverlap();
The value can be between -100 and 100. This property applies only to 2-D bar charts and 2-D column charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Target"},
{"Jan", 10, 12},
{"Feb", 14, 11},
{"Mar", 16, 15}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getColumnGroups().get(0);
chartGroup.setOverlap(0);
value - An integer that specifies how bars and columns are positioned in the chart group.This property applies to Pie of Pie charts and Bar of Pie charts. The returned value is between 5 and 200.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Name", "Sales"},
{"East", 35},
{"West", 25},
{"North", 40}
});
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
int secondPlotSize = chartGroup.getSecondPlotSize();
This property applies to Pie of Pie charts and Bar of Pie charts. The value must be between 5 and 200.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Name", "Sales"},
{"East", 35},
{"West", 25},
{"North", 40}
});
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSecondPlotSize(75);
value - The size of the secondary section as a percentage of the size of the primary pie.IChartLines object that represents the series lines for the chart group.Series lines connect the data values from each series in a stacked bar chart or stacked column chart. This member applies only to stacked bar and stacked column charts. Returns null if series lines are not enabled for the chart group.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "North", "South"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnStacked, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setHasSeriesLines(true);
IChartLines seriesLines = chartGroup.getSeriesLines();
seriesLines.getFormat().getLine().getColor().setRGB(Color.GetBlue());
IChartLines object for the chart group's series lines, or null if series lines are not shown.This property is valid only for bubble charts.
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setShowNegativeBubbles(true);
boolean showNegativeBubbles = chartGroup.getShowNegativeBubbles();
true if negative bubbles are shown for the chart group; otherwise, false.This property is valid only for bubble charts.
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setShowNegativeBubbles(true);
value - true if negative bubbles are shown for the chart group; otherwise, false.The returned value indicates whether bubble sizes are interpreted as SizeRepresents.SizeIsArea or SizeRepresents.SizeIsWidth.
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSizeRepresents(SizeRepresents.SizeIsWidth);
SizeRepresents sizeRepresents = chartGroup.getSizeRepresents();
SizeRepresents value that specifies whether bubble sizes represent area or width.Use this method to specify whether bubble sizes are interpreted as SizeRepresents.SizeIsArea or SizeRepresents.SizeIsWidth.
IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSizeRepresents(SizeRepresents.SizeIsWidth);
value - A SizeRepresents value that specifies whether bubble sizes represent area or width.Use this method to determine which split rule is currently applied to the chart group.
worksheet.getRange("A1:B6").setValue(new Object[][]{
{"Category", "Value"},
{"North", 45},
{"South", 12},
{"East", 18},
{"West", 8},
{"Other", 5}
});
IChart chart = worksheet.getShapes().addChart(ChartType.PieOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B6"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSplitType(ChartSplitType.SplitByValue);
ChartSplitType splitType = chartGroup.getSplitType();
Use this method to control how data points are moved to the second plot. For example, the second plot can be split by position, value, percent value, or a custom split. The threshold used by some split modes can be configured with setSplitValue(int).
worksheet.getRange("A1:B6").setValue(new Object[][]{
{"Category", "Value"},
{"North", 45},
{"South", 12},
{"East", 18},
{"West", 8},
{"Other", 5}
});
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B6"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSplitType(ChartSplitType.SplitByPercentValue);
value - The split type that determines how the two sections are divided.This property applies to Pie of Pie charts and Bar of Pie charts. The meaning of the returned value depends on the current split mode configured by getSplitType().
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSplitValue(4);
int splitValue = chartGroup.getSplitValue();
This property applies to Pie of Pie charts and Bar of Pie charts. The meaning of the value depends on the current split mode configured by getSplitType().
IChart chart = worksheet.getShapes().addChart(ChartType.BarOfPie, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setSplitValue(4);
value - The threshold value that separates the two chart sections.Up bars connect points where the last series in the chart group has a higher value than the first series. This property applies only to line charts.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Planned", "Actual"},
{"Jan", 10, 14},
{"Feb", 18, 12},
{"Mar", 15, 20}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:C4"), RowCol.Columns, true, true);
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setHasUpDownBars(true);
IChartBars upBars = chartGroup.getUpBars();
IChartBars object that represents the up bars in the chart group.If this property is true, Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setVaryByCategories(true);
boolean varyByCategories = chartGroup.getVaryByCategories();
true if the chart group uses a different color or pattern for each data marker; otherwise, false.If this property is true, Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setVaryByCategories(true);
value - true if the chart group uses a different color or pattern for each data marker; otherwise, false.Use the returned list to access the ISeries objects that belong to the current chart group.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Month", "Sales", "Target"},
{"Jan", 10, 12},
{"Feb", 20, 18},
{"Mar", 15, 16}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("B1:C4"));
chart.getSeriesCollection().get(1).setChartType(ChartType.Line);
IChartGroup chartGroup = chart.getChartGroups().get(0);
List<ISeries> seriesCollection = chartGroup.getSeriesCollection();
ISeries objects in the chart or chart group.Use this method to read the current binning mode for a histogram chart group, such as automatic, bin count, bin size, or categorical binning.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinCount);
BinsType binsType = chartGroup.getBinsType();
BinsType that specifies how the horizontal axis of the histogram chart is formatted.Use this method to control whether the chart groups values automatically, by bin count, by bin size, manually, or by category.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{12},
{18},
{25},
{31},
{44},
{52}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinCount);
value - The binning mode for the horizontal axis. This value determines how histogram bins are calculated.Use this method to read the current bin count configured for a histogram chart group.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinCount);
chartGroup.setBinsCountValue(4);
long binsCount = chartGroup.getBinsCountValue();
Use this method to set the bin count configured for a histogram chart group.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinCount);
chartGroup.setBinsCountValue(4);
value - The number of bins in the histogram chart.getBinsOverflowValue() property is enabled.This property applies to histogram charts and indicates whether values greater than the overflow threshold are grouped into a separate overflow bin.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsOverflowValue(20);
chartGroup.setBinsOverflowEnabled(true);
boolean overflowEnabled = chartGroup.getBinsOverflowEnabled();
true if the overflow bin is enabled; otherwise, false.getBinsOverflowValue() property is enabled.Set value to true to group values greater than the overflow threshold into a separate overflow bin, or false to disable the overflow bin.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsOverflowValue(20);
chartGroup.setBinsOverflowEnabled(true);
value - true if the overflow bin is enabled; otherwise, false.This property applies when getBinsOverflowEnabled() returns true.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsOverflowEnabled(true);
chartGroup.setBinsOverflowValue(20.0);
double overflowValue = chartGroup.getBinsOverflowValue();
This property applies when getBinsOverflowEnabled() returns true.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsOverflowEnabled(true);
chartGroup.setBinsOverflowValue(20.0);
value - The threshold value above which an overflow bin is displayed.getBinsUnderflowValue() property is enabled.This property applies to histogram charts and indicates whether values less than the underflow threshold are grouped into a separate underflow bin.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{8},
{10},
{12},
{18},
{24}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsUnderflowEnabled(true);
chartGroup.setBinsUnderflowValue(10.0);
boolean underflowEnabled = chartGroup.getBinsUnderflowEnabled();
true if the underflow bin is enabled; otherwise, false.getBinsUnderflowValue() property is enabled.Set value to true to group values less than the underflow threshold into a separate underflow bin, or false to disable the underflow bin.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{8},
{10},
{12},
{18},
{24}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsUnderflowValue(10.0);
chartGroup.setBinsUnderflowEnabled(true);
value - true if the underflow bin is enabled; otherwise, false.This property applies to histogram charts and is used when the underflow bin is enabled through setBinsUnderflowEnabled(boolean).
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{8},
{10},
{12},
{18},
{24}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsUnderflowEnabled(true);
chartGroup.setBinsUnderflowValue(10.0);
double underflowValue = chartGroup.getBinsUnderflowValue();
This property applies to histogram charts and is used when the underflow bin is enabled through setBinsUnderflowEnabled(boolean).
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{8},
{10},
{12},
{18},
{24}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsUnderflowEnabled(true);
chartGroup.setBinsUnderflowValue(10.0);
value - The threshold value below which an underflow bin is displayed.Use this method to read the current range size configured for a histogram chart group.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinSize);
chartGroup.setBinWidthValue(3.0);
double binWidth = chartGroup.getBinWidthValue();
Use this method to set the range size configured for a histogram chart group.
worksheet.getRange("A1:A6").setValue(new Object[][] {
{"Score"},
{10},
{12},
{15},
{18},
{22}
});
IChart chart = worksheet.getShapes().addChart(ChartType.Histogram, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:A6"));
IChartGroup chartGroup = chart.getChartGroups().get(0);
chartGroup.setBinsType(BinsType.BinsTypeBinSize);
chartGroup.setBinWidthValue(2.0);
value - The number of points in each range.