Column Chart with HyJavaStock

the java api for highcharts stock

Below is the Java code needed to create the Highcharts Stock Column demo chart from their website.

This example chart is also viewable in the HyJavaStock demo web application available on the demo page.

public class Column {
	
	public Highstock configure() {
		Highstock highStock = new Highstock();
		ChartOptions chartOptions = highStock.getChartOptions();
		
		chartOptions.getStockTools().getGui().setEnabled(false);
		
		chartOptions.getChart().setAlignTicks(false);
		chartOptions.getRangeSelector().setSelected(1);
	    
		chartOptions.getTitle().setText("AAPL Stock Volume");
		
		SeriesColumn seriesColumn = new SeriesColumn();
		seriesColumn.setType(SeriesType.COLUMN).setName("AAPL");

		seriesColumn.getDataGrouping().getUnits().add(new Unit("week", new ArrayList(Arrays.asList(1))));
		seriesColumn.getDataGrouping().getUnits().add(new Unit("month", new ArrayList(Arrays.asList(1, 2, 3, 4, 6))));
		
		seriesColumn.getDataAsJsValue().setJsValue(new AAPLVolumeData().get());
		chartOptions.getSeries().add(seriesColumn);
		
		return highStock;
	}
	
}

The Java API’s fully support all chart types and chart options in Highcharts v5.x, v6.x, v7.x, v8.x, v9.x;  Highcharts Stock v8.x, v9.x and ApexCharts v3.x.


Current versions supported are:

HyJavaCharts

HyJavaStock

HyJavaApex

Start the HyJavaCharts demo Java web application


Start the HyJavaStock demo Java web application


Start the HyJavaApex demo Java web application


Start the HyJavaImages demo Java web application