إنشاء مخطط الأسهم لحجم فتح عالي منخفض إغلاق (VOHLC)
سيناريوهات الاستخدام المحتملة
المخطط الرابع للأسهم الذي سننظر فيه هو مخطط حجم الفتح العالي المنخفض إغلاق. من جديد، من المهم أن نكرر أنه يجب أن تكون البيانات في الترتيب الصحيح. إذا كنت بحاجة إلى إعادة ترتيب جدول بياناتك، يجب عليك فعل ذلك قبل إعداد المخطط الخاص بك. تتضمن هذه الرسم البياني عمودًا لحجم التداول مباشرة بعد العمود الأول (الفئة)، وتتضمن الرسوم البيانية رسماً عمودياً على المحور الأساسي يظهر هذا الحجم، بينما يتم نقل الأسعار إلى المحور الثانوي.
مخطط الأسهم لحجم فتح عالي منخفض إغلاق (VHLC)
الكود المثالي
الكود العينة التالي يقوم بتحميل ملف Excel عينة وإنشاء ملف Excel الخرج.
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") |