تغيير حجم شكل تسمية البيانات للمخطط لاحتواء النص
Contents
[
Hide
]
يوفر تطبيق Excel ملفتغيير حجم الشكل لاحتواء النص خيار لـ DataLabels في المخطط من أجل زيادة حجم الشكل بحيث يتلاءم النص داخله.
تغيير حجم شكل تسمية البيانات للمخطط لملاءمة النص في Microsoft Excel
يمكن الوصول إلى هذا الخيار على واجهة Excel عن طريق تحديد أي من تسميات البيانات على الرسم البياني. انقر بزر الماوس الأيمن وحدد ملفتنسيق DataLabels قائمة. تشغيلالحجم والخصائص علامة التبويب ، قم بتوسيعالتوافق للكشف عن الخصائص ذات الصلة بما في ذلكتغيير حجم الشكل لإصلاح النص اختيار.
تغيير حجم شكل تسمية البيانات للمخطط لاحتواء النص
لتقليد ميزة Excel في تغيير حجم أشكال ملصقات البيانات لتناسب النص ، كشفت واجهات برمجة التطبيقات Aspose.Cells النوع المنطقيDataLabels.SResizeShapeToFitTextخاصية. يوضح الجزء التالي من التعليمات البرمجية سيناريو الاستخدام البسيط لـDataLabels.SResizeShapeToFitTextخاصية.
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create an instance of Workbook containing the Chart | |
var book = new Workbook(dataDir + "source.xlsx"); | |
// Access the Worksheet that contains the Chart | |
var sheet = book.Worksheets[0]; | |
foreach (Chart chart in sheet.Charts) | |
{ | |
for (int index = 0; index < chart.NSeries.Count; index++) | |
{ | |
// Access the DataLabels of indexed NSeries | |
var labels = chart.NSeries[index].DataLabels; | |
// Set ResizeShapeToFitText property to true | |
labels.IsResizeShapeToFitText = true; | |
} | |
// Calculate Chart | |
chart.Calculate(); | |
} | |
// Save the result | |
book.Save(dataDir + "output_out.xlsx"); |