OHLC/HLC Bar series

An OHLC/HLC bar series is a sequence of vertical bars, each bar connected to two horizontal dashes displayed on opposite sides. This type of series is intended to be used in the stock market, displaying prices progression against time. The top and bottom of the vertical bars correspond to the 'high' and 'low' values, whereas the left and right horizontal dashes correspond to the 'open' and 'close' values, respectively. The class used to generate an OHLC/HLC bar series is com.jinsight.jetchart.OHLCBarSerie.

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);
        
	OHLCBarSerie obs=new OHLCBarSerie();
        obs.setTitle("OHLCBar series");
        obs.setColor(Color.red);
	
	double[][] values={{185.00,178.00,179.00,182.50},
	                   {196.00,183.50,183.95,192.90},
			   {196.95,189.20,194.00,190.00},
			   {195.50,186.55,191.00,187.25},
			   {195.60,190.00,192.00,192.00},
			   {207.35,190.10,191.10,207.35},
			   {214.00,193.10,211.25,196.15},
			   {202.80,189.50,196.00,196.45},
			   {206.35,194.30,197.00,199.00},
			   {208.00,197.00,204.00,198.10}};
			   
	// The method setValues(double[] values) is not
	// used with OHLC series.
        obs.setMultipleValues(values);

        graph.addSerie(obs);

	// Enables tooltips display. Move mouse cursor over
	// a data point to see all the OHLC values.
	graph.getToolTip().setEnabled(true);

        
        setSize(400,300);

        setVisible(true);


  }

  public static void main(String[] args) {
        new Main();
  }

}