Grafik Noktasının Zengin Metin Özel Veri Etiketi
Contents
[
Hide
]
Aspose.Cells for Python via .NET kullanarak, grafik noktalarının zengin metin özel veri etiketlerini oluşturabilirsiniz. Aspose.Cells for Python via .NET, metnin renkleri, kalınlığı gibi yazı tipi özelliklerini ayarlamak için kullanılabilen DataLabels.characters() metodunu sağlar, böylece etiketlerin görünümünü özelleştirebilirsiniz.
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.
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.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") |