تعيين نص إدخال أسطورة الرسم البياني ليكون لا شيئ باستخدام Aspose.Cells لبایتون via .NET
Contents
[
Hide
]
إذا كنت ترغب في تعيين نص إدخال تسمية المخطط إلى لا شيء حتى لا يظهر داخل تسمية المخطط، فعليك تعيين LegendEntry.is_text_no_fill إلى true.
يقوم الكود العينة التالي بتعيين نص إدخال تسمية المخطط الثاني إلى لا شيء. يرجى تنزيل ملف Excel عينة المستخدم في هذا الكود وملف 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 SaveFormat, Workbook | |
# 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(".") | |
# Open the template file. | |
workbook = Workbook(dataDir + "Sample.xlsx") | |
# Access the first worksheet | |
sheet = workbook.worksheets[0] | |
# Access the first chart inside the sheet | |
chart = sheet.charts[0] | |
# Set text of second legend entry fill to none | |
chart.legend.legend_entries[1].is_text_no_fill = True | |
# Save the workbook in xlsx format | |
workbook.save(dataDir + "ChartLegendEntry_out.xlsx", SaveFormat.XLSX) |