A stacked bar series is a subclass of com.jinsight.jetchart.BarSerie,
therefore it inherits the properties of bar series. Nevertheless, if two or more stacked
bar series are added to the same chart context, the series are sequentially
stacked one above the other, rather than disposed side by side, as it happens
with bar series.
The class used to generate a stacked bar series is
com.jinsight.jetchart.StackBarSerie.
import javax.swing.*; import java.awt.*; import com.jinsight.jetchart.*; public class Main extends JFrame { public Main() { Graph graph=new Graph(); Container ct=getContentPane(); ct.add("Center",graph); StackBarSerie sb1=new StackBarSerie(); sb1.setTitle("Stacked bar series 1"); sb1.setColor(Color.red); double[] values1={100,80,90,110}; sb1.setValues(values1); StackBarSerie sb2=new StackBarSerie(); sb2.setTitle("Stacked bar series 2"); sb2.setColor(Color.green); double[] values2={40,70,50,30}; sb2.setValues(values2); graph.addSerie(sb1); graph.addSerie(sb2); setSize(400,300); setVisible(true); } public static void main(String[] args) { new Main(); } }