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.getChart().setAlignTicks(false);
		chartOptions.getRangeSelector().setSelected(1);
	    
		chartOptions.getTitle().setText("AAPL Stock Volume");
		
		SeriesColumn seriesColumn = new SeriesColumn();
		seriesColumn.setType(SeriesType.COLUMN).setName("AAPL Stock Volume");

		seriesColumn.getDataGrouping().getUnits().add(new Unit("week", Arrays.asList(1)));
		seriesColumn.getDataGrouping().getUnits().add(new Unit("month", Arrays.asList(1, 2, 3, 4, 6)));
		
		seriesColumn.getDataAsJsValue().setJsValue(DemoChartData.getResource("demo-live-data-aapl-v.json"));
		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

Explore a demo Java web application using the HyJavaCharts v12.x library


Explore a demo Java web application using the HyJavaStock v12.x library


Explore a demo Java web application using the HyJavaApex v4.x library


Explore a demo Java web application using the HyJavaImages v2.x library