出来高 高値 安値 終値(VHLC)株価チャートを作成する
Contents
[
Hide
]
可能な使用シナリオ
私たちが見る3番目の株価チャートは、出来高高安終チャートです。再度、データを正しい順序で持っていることが重要であることを繰り返すことは重要です。データテーブルを再配置する必要がある場合は、チャートを設定する前に行う必要があります。 このチャートには、最初の(カテゴリ)列の直後に出来高の列が含まれており、チャートにはこの出来高を示す主軸の列チャートが含まれます。価格は副軸に移動します。
出来高-高値-安値-終値(VHLC)株価チャート
サンプルコード
サンプルExcelファイルを読み込み、出力Excelファイルを生成するサンプルコードは、以下の通りです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Workbook | |
Workbook workbook = new Workbook("Volume-High-Low-Close.xlsx"); | |
// Access the first worksheet. | |
Worksheet worksheet = workbook.Worksheets[0]; | |
//Create High-Low-Close-Stock Chart | |
int pieIdx = worksheet.Charts.Add(ChartType.StockVolumeHighLowClose, 5, 6, 20, 12); | |
// Retrieve the Chart object | |
Chart chart = worksheet.Charts[pieIdx]; | |
// Set the legend can be showed | |
chart.ShowLegend = true; | |
// Set the chart title name | |
chart.Title.Text = "Volume-High-Low-Close Stock"; | |
// Set the Legend at the bottom of the chart area | |
chart.Legend.Position = LegendPositionType.Bottom; | |
// Set data range | |
chart.SetChartDataRange("A1:E9", true); | |
// Set category data | |
chart.NSeries.CategoryData = "A2:A9"; | |
// Set Color for the first series(Volume) data | |
chart.NSeries[0].Area.ForegroundColor = Color.FromArgb(79, 129,189); | |
// Fill the PlotArea area with nothing | |
chart.PlotArea.Area.FillFormat.FillType = FillType.None; | |
// Save the Excel file | |
workbook.Save("out.xlsx"); |