Grafik Noktasının Zengin Metin Özel Veri Etiketi

Grafiğin Noktasının Zengin Metin Özel Veri Etiketi

Aşağıdaki kod, ilk serinin ilk grafik noktasına erişir, metnini ayarlar ve ardından ilk 10 karakterin rengini kırmızıya ve kalınlığını true olarak ayarlayarak metnin yazı tipini ayarlar.

from aspose.cells import Workbook
from aspose.pydrawing import Color
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Create a workbook from source Excel file
workbook = Workbook(dataDir + "sample.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Access the first chart inside the sheet
chart = worksheet.charts[0]
# Access the data label of first series first point
dlbls = chart.n_series[0].points[0].data_labels
# Set data label text
dlbls.text = "Rich Text Label"
# Set the font setting of the first 10 characters
fntSetting = dlbls.characters(0, 10)
fntSetting.font.color = Color.red
fntSetting.font.is_bold = True
# Save the workbook
workbook.save(dataDir + "output_out.xlsx")