A bubble series is another type of scatter series, like an XY series.
Data points are represented by bubbles spread across the chart area with respect to
pairs of xy values whose coordinates are calculated against a horizontal
and a vertical scales. In addition to the xy values, a third value(z) is aggregated to
the bubble series in order to calculate bubbles' diameters.
The z value is commonly used to measure importance, in terms of the diameter of
each bubble displayed.
The class used to generate a bubble series is com.jinsight.jetchart.BubbleSerie.
import javax.swing.*; import java.awt.*; import com.jinsight.jetchart.*; public class Main extends JFrame { public Main() { ScatterGraph graph=new ScatterGraph(); Container ct=getContentPane(); ct.add("Center",graph); BubbleSerie bubble=new BubbleSerie(); bubble.setTitle("Bubble series"); bubble.setColor(Color.green); bubble.setBorderEnabled(true); double[][] values={{100,80,30},{50,-120,40},{30,-40,90},{70,-100,60},{40,-50,50},{-40,30,50}, {-30,-80,40},{-60,-90,50},{-20,-60,70}}; // The method setValues(double[] values) is not // used with XY line series. bubble.setMultipleValues(values); graph.addSerie(bubble); // Enables tooltips display. Move mouse cursor over // a data point to see the xy values. graph.getToolTip().setEnabled(true); setSize(400,300); setVisible(true); } public static void main(String[] args) { new Main(); } }