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;
}
}