出来高 高値 安値 終値(VHLC)株価チャートを作成する

可能な使用シナリオ

私たちが見る3番目の株価チャートは、出来高高安終チャートです。再度、データを正しい順序で持っていることが重要であることを繰り返すことは重要です。データテーブルを再配置する必要がある場合は、チャートを設定する前に行う必要があります。 このチャートには、最初の(カテゴリ)列の直後に出来高の列が含まれており、チャートにはこの出来高を示す主軸の列チャートが含まれます。価格は副軸に移動します。

todo:image_alt_text

出来高-高値-安値-終値(VHLC)株価チャート

todo:image_alt_text

サンプルコード

サンプルExcelファイルを読み込み、出力Excelファイルを生成するサンプルコードは、以下の通りです。

// Create an instance of Workbook
Workbook workbook = new Workbook("Volume-High-Low-Close.xlsx");
// Access the first worksheet.
Worksheet worksheet = workbook.getWorksheets().get(0);
//Create High-Low-Close-Stock Chart
int pieIdx = worksheet.getCharts().add(ChartType.STOCK_VOLUME_HIGH_LOW_CLOSE, 5, 6, 20, 12);
// Retrieve the Chart object
Chart chart = worksheet.getCharts().get(pieIdx);
// Set the legend can be showed
chart.setShowLegend(true);
// Set the chart title name
chart.getTitle().setText("Volume-High-Low-Close Stock");
// Set the Legend at the bottom of the chart area
chart.getLegend().setPosition(LegendPositionType.BOTTOM);
// Set data range
chart.setChartDataRange("A1:E9", true);
// Set category data
chart.getNSeries().setCategoryData("A2:A9");
// Set Color for the first series(Volume) data
chart.getNSeries().get(0).getArea().setForegroundColor(Color.fromArgb(79, 129,189));
// Fill the PlotArea area with nothing
chart.getPlotArea().getArea().getFillFormat().setFillType(FillType.NONE);
// Save the Excel file
workbook.save("out.xlsx");