[]
        
(Showing Draft Content)

ISeries

Interface ISeries


public interface ISeries
Represents a series in a chart.

An ISeries object stores the data and formatting for a single chart series and is a member of the ISeriesCollection collection. Use this interface to access series-level settings such as the chart type, axis group, markers, data labels, error bars, and trendlines.


 worksheet.getRange("A1:B4").setValue(new Object[][] {
     {"Month", "Sales"},
     {"Jan", 10},
     {"Feb", 14},
     {"Mar", 18}
 });
 IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200);
 shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
 ISeries series = shape.getChart().getSeriesCollection().get(0);
 
  • Method Details

    • getAxisGroup

      AxisGroup getAxisGroup()
      Gets the axis group of the series.

      The axis group indicates whether the series is plotted on the primary or secondary axis.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       AxisGroup axisGroup = series.getAxisGroup();
       
      Returns:
      The AxisGroup of the series.
    • setAxisGroup

      void setAxisGroup(AxisGroup value)
      Sets the axis group for the series.

      Use this method to assign the series to either the primary or secondary axis group.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       series.setAxisGroup(AxisGroup.Secondary);
       
      Parameters:
      value - The AxisGroup to assign to the series.
    • getBarShape

      BarShape getBarShape()
      Gets the shape used with the 3-D bar or column chart for this series.

      If a bar shape has not been set on the series, this method returns the bar shape of the parent chart.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered3D, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setBarShape(BarShape.Cylinder);
       BarShape barShape = series.getBarShape();
       
      Returns:
      The BarShape used by the series in a 3-D bar or column chart.
    • setBarShape

      void setBarShape(BarShape value)
      Sets the shape used with the 3-D bar or column chart.

      Use this method to control how the current series is rendered in a 3-D bar or 3-D column chart.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered3D, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setBarShape(BarShape.Cylinder);
       
      Parameters:
      value - The BarShape to apply to the series.
    • getBubbleSizes

      Double[] getBubbleSizes()
      Gets an array that contains the size data for the bubble chart.

      This method applies only to bubble charts. Each element in the returned array corresponds to one data point in the series.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"X", "Y", "Size"}, {1, 2, 10}, {2, 4, 15}, {3, 3, 12}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(0);
       Double[] bubbleSizes = series.getBubbleSizes();
       
      Returns:
      The array of bubble sizes for the series.
    • setBubbleSizes

      void setBubbleSizes(Double[] value)
      Sets an array that contains the size data for the bubble chart.

      This method applies only to bubble charts. Each element in the returned array corresponds to one data point in the series.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"X", "Y", "Size"}, {1, 2, 10}, {2, 4, 15}, {3, 3, 12}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setBubbleSizes(100);
       
      Parameters:
      value - The array of bubble sizes for the series.
    • getChartType

      ChartType getChartType()
      Gets the chart type of the series.

      The returned ChartType value identifies how the current series is plotted in the parent chart.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 10}, {"Feb", 18, 16}, {"Mar", 15, 14}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       series.setChartType(ChartType.Line);
       ChartType chartType = series.getChartType();
       
      Returns:
      The current ChartType of the series.
    • setChartType

      void setChartType(ChartType value)
      Sets the chart type for the series.

      Use this method to change how the current series is plotted in the parent chart. The specified chart type must be compatible with the chart and series context.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 10}, {"Feb", 18, 16}, {"Mar", 15, 14}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       series.setChartType(ChartType.Line);
       
      Parameters:
      value - The chart type to apply to the series.
    • getXErrorBar

      IErrorBar getXErrorBar()
      Gets the X direction error bar for the series.

      Use the returned IErrorBar object to read or modify the error bar settings for X values in the series. X direction error bars are supported for scatter series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"X", "Y"}, {1, 2}, {2, 4}, {3, 3}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHasErrorBars(true);
       IErrorBar errorBar = series.getXErrorBar();
       
      Returns:
      The IErrorBar object that represents the X direction error bar for the series.
      Throws:
      IllegalStateException - if the series chart type does not support error bars.
    • getYErrorBar

      IErrorBar getYErrorBar()
      Gets the Y direction error bar for the series.

      Use the returned IErrorBar object to read or modify the error bar settings for Y values in the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"X", "Y"}, {1, 2}, {2, 4}, {3, 3}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHasErrorBars(true);
       IErrorBar errorBar = series.getYErrorBar();
       
      Returns:
      The IErrorBar object that represents the Y direction error bar for the series.
      Throws:
      IllegalStateException - if the series chart type does not support error bars.
    • getExplosion

      int getExplosion()
      Gets the explosion value for the slices in a pie or doughnut series.

      Returns 0 if the slices are not exploded and the tip of each slice remains at the center of the pie.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Category", "Value"}, {"A", 30}, {"B", 20}, {"C", 50}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Pie, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       int explosion = series.getExplosion();
       
      Returns:
      The explosion value for the series slices. Returns 0 if the slices are not exploded.
    • setExplosion

      void setExplosion(int value)
      Sets the explosion value for the slices in a pie or doughnut series.

      Sets 0 if the slices are not exploded and the tip of each slice remains at the center of the pie.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Category", "Value"}, {"A", 30}, {"B", 20}, {"C", 50}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Pie, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setExplosion(0);
       
      Parameters:
      value - The explosion value for the series slices. Sets 0 if the slices are not exploded.
    • getFormat

      IChartFormat getFormat()
      Gets the format of the series.

      Use the returned IChartFormat object to access the fill and line formatting settings of the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IChartFormat format = series.getFormat();
       
      Returns:
      The IChartFormat object for the series.
    • getFormula

      String getFormula()
      Gets the series formula in A1-style notation.

      The returned formula describes the series definition by using A1-style references.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       String formula = series.getFormula();
       
      Returns:
      The series formula in A1-style notation.
    • setFormula

      void setFormula(String value)
      Sets the series formula in A1-style notation.

      The returned formula describes the series definition by using A1-style references.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setFormula("Sample");
       
      Parameters:
      value - The series formula in A1-style notation.
    • getFormulaR1C1

      String getFormulaR1C1()
      Gets the formula for the object using R1C1-style notation.

      Use this method to retrieve the series formula when you need row-and-column relative references instead of A1-style references. To work with the formula in A1-style notation, use getFormula().

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       String formula = series.getFormulaR1C1();
       
      Returns:
      The series formula in R1C1-style notation.
    • setFormulaR1C1

      void setFormulaR1C1(String value)
      Sets the formula for the object using R1C1-style notation.

      Use this method to set the series formula when you need row-and-column relative references instead of A1-style references. To work with the formula in A1-style notation, use setFormula(String).

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setFormulaR1C1("Sample");
       
      Parameters:
      value - The series formula in R1C1-style notation.
    • getHas3DEffect

      boolean getHas3DEffect()
      Gets whether the series has a three-dimensional appearance.

      This property applies only to bubble charts.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"X", "Y", "Size"}, {1, 10, 6}, {2, 14, 8}, {3, 9, 5}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHas3DEffect(true);
       boolean has3DEffect = series.getHas3DEffect();
       
      Returns:
      true if the series has a three-dimensional appearance; otherwise, false.
    • setHas3DEffect

      void setHas3DEffect(boolean value)
      Sets whether the series has a three-dimensional appearance.

      This property applies only to bubble charts.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"X", "Y", "Size"}, {1, 10, 6}, {2, 14, 8}, {3, 9, 5}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Bubble, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHas3DEffect(true);
       
      Parameters:
      value - true if the series has a three-dimensional appearance; otherwise, false.
    • getHasDataLabels

      boolean getHasDataLabels()
      Gets whether the series has data labels.

      This property indicates whether data labels are displayed for the series in the chart.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Amount"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean hasDataLabels = series.getHasDataLabels();
       
      Returns:
      true if the series has data labels; otherwise, false.
    • setHasDataLabels

      void setHasDataLabels(boolean value)
      Sets whether the series has data labels.

      Set this property to true to show data labels for the series, or false to hide them.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Amount"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHasDataLabels(true);
       
      Parameters:
      value - true if the series has data labels; otherwise, false.
    • getHasErrorBars

      boolean getHasErrorBars()
      Gets whether the series has error bars.

      This property is not available for 3-D charts.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"X", "Y"}, {1, 10}, {2, 12}, {3, 9}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHasErrorBars(true);
       boolean hasErrorBars = series.getHasErrorBars();
       
      Returns:
      true if the series has error bars; otherwise, false.
    • setHasErrorBars

      void setHasErrorBars(boolean value)
      Sets whether the series has error bars.

      This property is not available for 3-D charts.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"X", "Y"}, {1, 10}, {2, 12}, {3, 9}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setHasErrorBars(true);
       
      Parameters:
      value - true if the series has error bars; otherwise, false.
    • getInvertColor

      IColorFormat getInvertColor()
      Gets the fill color for negative data points in a series.

      Use this property together with setInvertIfNegative(boolean) to control how negative values are displayed in the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Amount"}, {"Jan", 12}, {"Feb", -8}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setInvertIfNegative(true);
       IColorFormat invertColor = series.getInvertColor();
       invertColor.setRGB(Color.GetRed());
       
      Returns:
      The fill color for negative data points in the series.
    • getInvertIfNegative

      boolean getInvertIfNegative()
      Gets whether Microsoft Excel inverts the pattern in the series when a data point corresponds to a negative number.

      When this property is true, negative data points in the series use the inverted pattern. This setting can be used together with getInvertColor() to control the appearance of negative values.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Amount"}, {"Jan", 12}, {"Feb", -8}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setInvertIfNegative(true);
       boolean invertIfNegative = series.getInvertIfNegative();
       
      Returns:
      true if Microsoft Excel inverts the pattern for negative values in the series; otherwise, false.
    • setInvertIfNegative

      void setInvertIfNegative(boolean value)
      Sets whether Microsoft Excel inverts the pattern in the series when a data point corresponds to a negative number.

      When this property is true, negative data points in the series use the inverted pattern. This setting can be used together with getInvertColor() to control the appearance of negative values.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Amount"}, {"Jan", 12}, {"Feb", -8}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setInvertIfNegative(true);
       
      Parameters:
      value - true if Microsoft Excel inverts the pattern for negative values in the series; otherwise, false.
    • getMarkerFormat

      IChartFormat getMarkerFormat()
      Gets the marker format for this series.

      Use the returned IChartFormat object to configure the fill and line formatting of markers in the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.LineMarkers, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IChartFormat markerFormat = series.getMarkerFormat();
       markerFormat.getFill().getColor().setRGB(Color.GetRed());
       
      Returns:
      The IChartFormat object that represents the marker formatting for this series.
    • getMarkerSize

      int getMarkerSize()
      Gets the data-marker size in points.

      Use this method to retrieve the marker size applied to the series.

      
       worksheet.getRange("A1:B5").setValue(new Object[][] {{1, 10}, {2, 12}, {3, 9}, {4, 15}, {5, 11}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setMarkerSize(10);
       int markerSize = series.getMarkerSize();
       
      Returns:
      The data-marker size, in points.
    • setMarkerSize

      void setMarkerSize(int value)
      Sets the data-marker size in points.

      Use this method to set the marker size applied to the series.

      
       worksheet.getRange("A1:B5").setValue(new Object[][] {{1, 10}, {2, 12}, {3, 9}, {4, 15}, {5, 11}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatter, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setMarkerSize(10);
       
      Parameters:
      value - The data-marker size, in points.
    • getMarkerStyle

      MarkerStyle getMarkerStyle()
      Gets the marker style for a point or series in a line chart, scatter chart, or radar chart.

      Use this method to retrieve the current marker appearance applied to the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"X", "Y"}, {1, 2}, {2, 4}, {3, 3}});
       IChart chart = worksheet.getShapes().addChart(ChartType.XYScatterLines, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setMarkerStyle(MarkerStyle.Diamond);
       MarkerStyle style = series.getMarkerStyle();
       
      Returns:
      The marker style of the series.
    • setMarkerStyle

      void setMarkerStyle(MarkerStyle value)
      Sets the marker style for a point or series in a line chart, scatter chart, or radar chart.

      Use this method to change how data markers are displayed for the series.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {16}});
       IChart chart = worksheet.getShapes().addChart(ChartType.LineMarkers, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setMarkerStyle(MarkerStyle.Diamond);
       
      Parameters:
      value - The marker style to apply to the series.
    • getName

      String getName()
      Gets the name of the series.

      The series name is typically derived from the source data header or set explicitly by using setName(String).

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, false);
       ISeries series = chart.getSeriesCollection().get(0);
       String name = series.getName();
       
      Returns:
      The name of the series. Returns null if the series does not have a name.
    • setName

      void setName(String value)
      Sets the name of the series.
      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, false);
       ISeries series = chart.getSeriesCollection().get(0);
       series.setName("Sample");
       
      Parameters:
      value - The name of the series. Sets null if the series does not have a name.
    • getParent

      IChartGroup getParent()
      Gets the parent IChartGroup that contains this series.

      Use this method to access chart group settings shared by the series, such as group-level formatting and axis group options.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       IChartGroup chartGroup = series.getParent();
       
      Returns:
      The parent IChartGroup that contains this series.
    • getPictureType

      DrawingPictureType getPictureType()
      Gets the way pictures are displayed on a column or bar picture chart.

      Use this method to determine whether pictures in the series are stretched, stacked, or stacked according to a specified unit.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{10}, {20}, {30}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setPictureType(DrawingPictureType.StackScale);
       DrawingPictureType pictureType = series.getPictureType();
       
      Returns:
      The picture display type for the series.
    • setPictureType

      void setPictureType(DrawingPictureType value)
      Sets the way pictures are displayed on a column or bar picture chart.

      Use this method to control whether pictures in the series are stretched, stacked, or stacked according to a specified unit.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{10}, {20}, {30}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setPictureType(DrawingPictureType.StackScale);
       series.setPictureUnit(2.0);
       
      Parameters:
      value - The picture display type for the series.
    • getPictureUnit

      double getPictureUnit()
      Gets the unit for each picture in the series when the picture type is set to DrawingPictureType.StackScale.

      This property is used only when the series picture type is DrawingPictureType.StackScale.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setPictureType(DrawingPictureType.StackScale);
       series.setPictureUnit(2.0);
       double pictureUnit = series.getPictureUnit();
       
      Returns:
      The unit for each picture in the series.
    • setPictureUnit

      void setPictureUnit(double value)
      Sets the unit for each picture in the series when the picture type is set to DrawingPictureType.StackScale.

      This property is used only when the series picture type is DrawingPictureType.StackScale.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setPictureType(DrawingPictureType.StackScale);
       series.setPictureUnit(2.0);
       
      Parameters:
      value - The unit for each picture in the series.
    • getPlotOrder

      int getPlotOrder()
      Gets the plot order for the selected series within the chart group.

      The plot order determines the position of the series relative to other series in the same chart group.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       int plotOrder = series.getPlotOrder();
       
      Returns:
      An integer that indicates the plot order of the series within its chart group.
    • setPlotOrder

      void setPlotOrder(int value)
      Sets the plot order for the selected series within the chart group.

      The plot order determines the position of the series relative to other series in the same chart group.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       series.setPlotOrder(0);
       
      Parameters:
      value - An integer that indicates the plot order of the series within its chart group.
    • getSmooth

      boolean getSmooth()
      Gets whether curve smoothing is enabled for the series.

      Returns true if curve smoothing is turned on for a line chart or scatter chart series. Applies only to line and scatter charts.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setSmooth(true);
       boolean smooth = series.getSmooth();
       
      Returns:
      true if curve smoothing is enabled for the series; otherwise, false.
    • setSmooth

      void setSmooth(boolean value)
      Sets whether curve smoothing is enabled for the series.

      Set value to true to enable curve smoothing for a line chart or scatter chart series, or false to disable it. Applies only to line and scatter charts.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setSmooth(true);
       
      Parameters:
      value - true if curve smoothing is enabled for the series; otherwise, false.
    • getShowInnerPoints

      boolean getShowInnerPoints()
      Gets whether to show the data points that lie between the lower whisker line and the upper whisker line.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean showInnerPoints = series.getShowInnerPoints();
       
      Returns:
      true if the data points between the lower whisker line and the upper whisker line are shown; otherwise, false.
    • setShowInnerPoints

      void setShowInnerPoints(boolean value)
      Sets whether to show the data points that lie between the lower whisker line and the upper whisker line.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowInnerPoints(true);
       
      Parameters:
      value - true if the data points between the lower whisker line and the upper whisker line are shown; otherwise, false.
    • getShowOutlierPoints

      boolean getShowOutlierPoints()
      Gets whether to show the outlier points that lie either below the lower whisker line or above the upper whisker line.

      The default value is true. This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowOutlierPoints(false);
       boolean showOutlierPoints = series.getShowOutlierPoints();
       
      Returns:
      true if outlier points are shown; otherwise, false.
    • setShowOutlierPoints

      void setShowOutlierPoints(boolean value)
      Sets whether to show the outlier points that lie either below the lower whisker line or above the upper whisker line.

      The default value is true. This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowOutlierPoints(false);
       
      Parameters:
      value - true if outlier points are shown; otherwise, false.
    • getShowMeanMarkers

      boolean getShowMeanMarkers()
      Gets whether to show the mean marker of the selected series.

      The default value is true. This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean showMeanMarkers = series.getShowMeanMarkers();
       
      Returns:
      true if the mean marker is shown; otherwise, false.
    • setShowMeanMarkers

      void setShowMeanMarkers(boolean value)
      Sets whether to show the mean marker of the selected series.

      The default value is true. This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowMeanMarkers(true);
       
      Parameters:
      value - true if the mean marker is shown; otherwise, false.
    • getShowMeanLine

      boolean getShowMeanLine()
      Gets whether to show the line connecting the means of the boxes in the selected series.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean showMeanLine = series.getShowMeanLine();
       
      Returns:
      true if the line connecting the means of the boxes is shown; otherwise, false.
    • setShowMeanLine

      void setShowMeanLine(boolean value)
      Sets whether to show the line connecting the means of the boxes in the selected series.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowMeanLine(true);
       
      Parameters:
      value - true if the line connecting the means of the boxes is shown; otherwise, false.
    • getShowConnectorLines

      boolean getShowConnectorLines()
      Gets whether to show the connector lines that connect the end of each column to the beginning of the next column.

      The default value is true. This property is valid only for waterfall charts.

      
       worksheet.getRange("A1:B5").setValue(new Object[][] {
           {"Category", "Amount"},
           {"Sales", 1200},
           {"Returns", -200},
           {"Expenses", -300},
           {"Profit", 700}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.Waterfall, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("B2:B5"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean showConnectorLines = series.getShowConnectorLines();
       
      Returns:
      true if connector lines are shown; otherwise, false.
    • setShowConnectorLines

      void setShowConnectorLines(boolean value)
      Sets whether to show the connector lines that connect the end of each column to the beginning of the next column.

      The default value is true. This property is valid only for waterfall charts.

      
       worksheet.getRange("A1:B5").setValue(new Object[][] {
           {"Category", "Amount"},
           {"Sales", 1200},
           {"Sets", -200},
           {"Expenses", -300},
           {"Profit", 700}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.Waterfall, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("B2:B5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setShowConnectorLines(true);
       
      Parameters:
      value - true if connector lines are shown; otherwise, false.
    • getQuartileCalculationInclusiveMedian

      boolean getQuartileCalculationInclusiveMedian()
      Gets whether the median is included in the quartile calculation when the number of values in the data is odd.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       boolean inclusiveMedian = series.getQuartileCalculationInclusiveMedian();
       
      Returns:
      true if the median is included in the quartile calculation when the number of values is odd; otherwise, false.
    • setQuartileCalculationInclusiveMedian

      void setQuartileCalculationInclusiveMedian(boolean value)
      Sets whether the median is included in the quartile calculation when the number of values in the data is odd.

      This property is valid only for boxwhisker charts.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {12}, {13}, {14}, {40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.BoxWhisker, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:A5"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setQuartileCalculationInclusiveMedian(true);
       
      Parameters:
      value - true if the median is included in the quartile calculation when the number of values is odd; otherwise, false.
    • getValues

      Double[] getValues()
      Gets all values in the series.

      The values can come from a worksheet range or from an array of constant values, but not from a combination of both.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       Double[] values = series.getValues();
       
      Returns:
      An array that contains all values in the series, or null if the series has no values.
    • setValues

      void setValues(Double[] value)
      Sets all values in the series.

      The values can come from a worksheet range or from an array of constant values, but not from a combination of both.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setValues(100);
       
      Parameters:
      value - An array that contains all values in the series, or null if the series has no values.
    • getXValues

      Object[] getXValues()
      Gets the array of x values for the chart series.

      The x values can come from a worksheet range or from an array assigned by setXValues(Object[]), but not from a combination of both.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       Object[] xValues = series.getXValues();
       
      Returns:
      An array that contains the x values for the series. Returns an empty array if the series does not have valid x values.
    • setXValues

      void setXValues(Object[] value)
      Sets the array of x values for the chart series.
      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setXValues(100);
       
      Parameters:
      value - An array that contains the x values for the series. Sets an empty array if the series does not have valid x values.
    • getParentDataLabelOption

      ParentDataLabelOptions getParentDataLabelOption()
      Gets the parent data label option for the specified series within the chart group.

      This property indicates how parent data labels are displayed for a series that supports parent labels.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Group", "Value"}, {"North", 10}, {"South", 20}, {"East", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Treemap, 20, 20, 300, 200).getChart();
       chart.setSourceData(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setParentDataLabelOption(ParentDataLabelOptions.Banner);
       ParentDataLabelOptions option = series.getParentDataLabelOption();
       
      Returns:
      The parent data label option for the series.
    • setParentDataLabelOption

      void setParentDataLabelOption(ParentDataLabelOptions value)
      Sets the parent data label option for the specified series within the chart group.

      Use this method to control how parent data labels are displayed for series that support parent labels.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Group", "Value"}, {"North", 10}, {"South", 20}, {"East", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.Treemap, 20, 20, 300, 200).getChart();
       chart.setSourceData(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.setParentDataLabelOption(ParentDataLabelOptions.Banner);
       
      Parameters:
      value - The parent data label option to apply to the series.
    • getDataLabels

      IDataLabels getDataLabels()
      Gets the collection of data labels for the series.

      Use the returned IDataLabels object to access or configure the data labels that belong to the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IDataLabels dataLabels = series.getDataLabels();
       dataLabels.setShowValue(true);
       
      Returns:
      The IDataLabels collection for the series.
    • getPoints

      IPoints getPoints()
      Gets the collection of data points in the series.

      Use the returned IPoints object to access individual IPoint objects that belong to the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       IPoints points = series.getPoints();
       IPoint point = points.get(0);
       
      Returns:
      The IPoints collection that contains all IPoint objects in the series.
    • getTrendlines

      ITrendlines getTrendlines()
      Gets the collection of trendlines for the series.

      Use this method to access, add, or enumerate the ITrendline objects associated with the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       ITrendlines trendlines = series.getTrendlines();
       trendlines.add();
       
      Returns:
      The ITrendlines collection that contains all trendlines for the series.
    • clearFormats

      void clearFormats()
      Clears the formatting of this series.

      Use this method to remove custom formatting that has been applied to the series.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       ISeries series = chart.getSeriesCollection().get(0);
       series.getFormat().getFill().getColor().setRGB(Color.GetBlue());
       series.clearFormats();
       
    • delete

      void delete()
      Deletes this series from its chart.

      After this method is called, the current series is removed from the chart's series collection.

      
       worksheet.getRange("A1:C4").setValue(new Object[][] {{"Month", "Sales", "Target"}, {"Jan", 12, 30}, {"Feb", 18, 45}, {"Mar", 15, 40}});
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:C4"));
       ISeries series = chart.getSeriesCollection().get(1);
       series.delete();
       
      Throws:
      IllegalStateException - if the series belongs to a Pareto chart.