ceTe Software Help Library for Java August - 2020
DynamicPDF Generator for Java / Programming with Generator for Java / Charts / Chart Elements / Stacked Series Elements
In This Topic
    Stacked Series Elements
    In This Topic

    A Stacked Series Element is a collection of values that will be added to a stacked series to be plotted as a stacked chart. There are four different groups of Stacked Series Elements corresponding to the four different types of stacked charts (stacked area, stacked bar, stacked column and stacked line).  Each stacked series element group will have both an indexed and a date-time type.

    Stacked Area Series Elements
    Stacked Line Series Elements
    Stacked Bar Series Elements
    Stacked Column Series Elements

    Stacked Area Series Elements

    A StackedAreaSeries has two types of elements:

    • DateTimeStackedAreaSeriesElement

    This is a collection of DateTimeStackedArea values. It uses the Calendar class for setting the time portion of the values in the series.

    The below code shows how to create and add values to a DateTimeStackedAreaSeriesElement.

    [Java]
         DateTimeStackedAreaSeriesElement areaSeries = new DateTimeStackedAreaSeriesElement("Website A");
         Calendar p0=Calendar.getInstance();
         p0.set(2004,0,1);
         Calendar p1=Calendar.getInstance();
         p1.set(2004,1,1);
         Calendar p2=Calendar.getInstance();
         p2.set(2004,2,1);
         Calendar p3=Calendar.getInstance();
         p3.set(2004,3,1);
         areaSeries.getValues().add(521, p0);
         areaSeries.getValues().add(969, p1);
         areaSeries.getValues().add(452, p2);
         areaSeries.getValues().add(347, p3);
    
    • IndexedStackedAreaSeriesElement
    This is a collection of IndexedStackedArea values.
    The below code shows how to create and add values to an IndexedStackedAreaSeriesElement.
    [Java]
          IndexedStackedAreaSeriesElement areaSeries = new IndexedStackedAreaSeriesElement("Website A");      
          areaSeries.getValues().add(521, 0);
          areaSeries.getValues().add(969, 1);
          areaSeries.getValues().add(451, 2);
          areaSeries.getValues().add(347, 3);  
    

    Stacked Line Series Elements

    A StackedLineSeries has two types of elements:

    • DateTimeStackedLineSeriesElement
    This is a collection of DateTimeStackedLine values. It uses the Calendar class for setting the time portion of the values in the series.

    The below code shows how to create and add values to a DateTimeStackedLineSeriesElement.

    [Java]  
          DateTimeStackedLineSeriesElement lineSeries = new DateTimeStackedLineSeriesElement("Website A");
          Calendar p0=Calendar.getInstance();
          p0.set(2004,0,1);
          Calendar p1=Calendar.getInstance();
          p1.set(2004,1,1);
          Calendar p2=Calendar.getInstance();
          p2.set(2004,2,1);
          Calendar p3=Calendar.getInstance();
          p3.set(2004,3,1);
          lineSeries.getValues().add(521, p0);
          lineSeries.getValues().add(969, p1);
          lineSeries.getValues().add(452, p2);
          lineSeries.getValues().add(347, p3);
    
    • IndexedStackedLineSeriesElement

    This is a collection of IndexedStackedLine values.

    The below code shows how to create and add values to an IndexedStackedLineSeriesElement.

    [Java]     
          IndexedStackedLineSeriesElement lineSeries = new IndexedStackedLineSeriesElement("Website A");      
          lineSeries.getValues().add(521, 0);
          lineSeries.getValues().add(969, 1);
          lineSeries.getValues().add(451, 2);
          lineSeries.getValues().add(347, 3);   
    

    Stacked Bar Series Elements

    A StackedBarSeries has two types of elements:

    • DateTimeStackedBarSeriesElement
    This is a collection of DateTimeStackedBar values. It uses the Calendar class for setting the time portion of the values in the series.

    The below code shows how to create and add values to a DateTimeStackedBarSeriesElement.

    [Java]  
          DateTimeStackedBarSeriesElement barSeries = new DateTimeStackedBarSeriesElement("Website A");
          Calendar p0=Calendar.getInstance();
          p0.set(2004,0,1);
          Calendar p1=Calendar.getInstance();
          p1.set(2004,1,1);
          Calendar p2=Calendar.getInstance();
          p2.set(2004,2,1);
          Calendar p3=Calendar.getInstance();
          p3.set(2004,3,1);
          barSeries.getValues().add(521, p0);
          barSeries.getValues().add(969, p1);
          barSeries.getValues().add(452, p2);
          barSeries.getValues().add(347, p3);
    
    • IndexedStackedBarSeriesElement

    This is a collection of IndexedStackedBar values.

    The below code shows how to create and add values to an IndexedStackedBarSeriesElement.

    [Java]     
         IndexedStackedBarSeriesElement barSeries = new IndexedStackedBarSeriesElement("Website A");      
         barSeries.getValues().add(521, 0);
         barSeries.getValues().add(969, 1);
         barSeries.getValues().add(451, 2);
         barSeries.getValues().add(347, 3);   
    

    Stacked Column Series Elements

    A StackedColumnSeries has two types of elements:

    • DateTimeStackedColumnSeriesElement
    This is a collection of DateTimeStackedColumn values. It uses the Calendar class for setting the time portion of the values in the series.

    The below code shows how to create and add values to a DateTimeStackedColumnSeriesElement.

    [Java]  
          DateTimeStackedColumnSeriesElement columnSeries = new DateTimeStackedColumnSeriesElement("Website A");
          Calendar p0=Calendar.getInstance();
          p0.set(2004,0,1);
          Calendar p1=Calendar.getInstance();
          p1.set(2004,1,1);
          Calendar p2=Calendar.getInstance();
          p2.set(2004,2,1);
          Calendar p3=Calendar.getInstance();
          p3.set(2004,3,1);
          columnSeries.getValues().add(521, p0);
          columnSeries.getValues().add(969, p1);
          columnSeries.getValues().add(452, p2);
          columnSeries.getValues().add(347, p3);
    
    • IndexedStackedColumnSeriesElement

    This is a collection of IndexedStackedColumn values.

    The below code shows how to create and add values to an IndexedStackedColumnSeriesElement.

    [Java]     
          IndexedStackedColumnSeriesElement columnSeries = new IndexedStackedColumnSeriesElement("Website A");      
          columnSeries.getValues().add(521, 0);
          columnSeries.getValues().add(969, 1);
          columnSeries.getValues().add(451, 2);
          columnSeries.getValues().add(347, 3);   
    
    See Also