出来高 オープン 高値 安値 終値(VOHLC)株価チャートを作成する
Contents
[
Hide
]
可能な使用シナリオ
私たちが見る4番目の株価チャートは、出来高オープン高安終チャートです。再度、データを正しい順序で持っていることが重要であることを繰り返すことは重要です。データテーブルを再配置する必要がある場合は、チャートを設定する前に行う必要があります。 このチャートには、最初の(カテゴリ)列の直後に出来高の列が含まれており、チャートにはこの出来高を示す主軸の列チャートが含まれます。価格は副軸に移動します。
出来高-オープン-高値-安値-終値(VOHLC)株価チャート
サンプルコード
サンプルExcelファイルを読み込み、出力Excelファイルを生成するサンプルコードは、以下の通りです。
This file contains hidden or 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
from aspose.cells import Workbook | |
from aspose.cells.charts import ChartType, LegendPositionType | |
from aspose.cells.drawing import FillType | |
from aspose.pydrawing import Color | |
# Create an instance of Workbook | |
workbook = Workbook("Volume-Open-High-Low-Close.xlsx") | |
# Access the first worksheet. | |
worksheet = workbook.worksheets[0] | |
# Create High-Low-Close-Stock Chart | |
pieIdx = worksheet.charts.add(ChartType.STOCK_VOLUME_OPEN_HIGH_LOW_CLOSE, 5, 6, 20, 12) | |
# Retrieve the Chart object | |
chart = worksheet.charts[pieIdx] | |
# Set the legend can be showed | |
chart.show_legend = True | |
# Set the chart title name | |
chart.title.text = "Volume-Open-High-Low-Close Stock" | |
# Set the Legend at the bottom of the chart area | |
chart.legend.position = LegendPositionType.BOTTOM | |
# Set data range | |
chart.set_chart_data_range("A1:F9", True) | |
# Set category data | |
chart.n_series.category_data = "A2:A9" | |
# Set Color for the first series(Volume) data | |
chart.n_series[0].area.foreground_color = Color.from_argb(79, 129, 189) | |
# Fill the PlotArea area with nothing | |
chart.plot_area.area.fill_format.fill_type = FillType.NONE | |
# Save the Excel file | |
workbook.save("out.xlsx") |