عرض المخطط
تقديم المخططات
تدعم واجهات برمجة تطبيقات Aspose.Cells تحويل مخططات Excel إلى صور وتنسيقات PDF دون الحاجة إلى أي أدوات أو تطبيقات إضافية. من أجل تقديم الدعم ، فإنجدول لقد كشفت الطبقةToImage & ToPdfطرق مع حقيقة من الأحمال الزائدة لتناسب متطلبات التطبيق على أفضل وجه.
تقديم المخططات للصور
الالرسم البياني & ToPdf يحتوي الأسلوب على حقيقة من الأحمال الزائدة لدعم التقديم البسيط والمتقدم. إذا كانت متطلبات التطبيق هي عرض المخطط بأبعاده الافتراضية ، فنحن نقترح عليك استخدام ملفالرسم البيانيالطريقة على النحو التالي.
// 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); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(); | |
// Adding a new worksheet to the Workbook | |
int sheetIndex = workbook.Worksheets.Add(); | |
// Obtaining the reference of the newly added worksheet by passing its index to WorksheetCollection | |
Worksheet worksheet = workbook.Worksheets[sheetIndex]; | |
// Adding sample values to cells | |
worksheet.Cells["A1"].PutValue(50); | |
worksheet.Cells["A2"].PutValue(100); | |
worksheet.Cells["A3"].PutValue(150); | |
worksheet.Cells["B1"].PutValue(4); | |
worksheet.Cells["B2"].PutValue(20); | |
worksheet.Cells["B3"].PutValue(50); | |
// Adding a chart to the worksheet | |
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column, 5, 0, 15, 5); | |
// Accessing the instance of the newly added chart | |
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex]; | |
// Adding Series Collection (chart data source) to the chart ranging from "A1" cell to "B3" | |
chart.NSeries.Add("A1:B3", true); | |
// Converting chart to image | |
chart.ToImage(dataDir + "chartEMF_out.emf", ImageType.Emf); | |
// Converting chart to Bitmap | |
System.Drawing.Bitmap bitmap = chart.ToImage(); | |
bitmap.Save(dataDir + "chartBMP_out.bmp", System.Drawing.Imaging.ImageFormat.Bmp); |
من الممكن أيضًا عرض المخططات على الصور باستخدام الإعدادات المتقدمة. كشفت واجهات برمجة التطبيقات Aspose.Cells عن إصدار التحميل الزائد منالرسم البياني الطريقة التي يمكن أن تقبل مثيلخيارات ImageOrPrintOptions، مع السماح بتحديد معلمات مثل الدقة ووضع التنعيم وتنسيق الصورة وما إلى ذلك.
// 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); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(); | |
// Adding a new worksheet to the Workbook | |
int sheetIndex = workbook.Worksheets.Add(); | |
// Obtaining the reference of the newly added worksheet by passing its index to WorksheetCollection | |
Worksheet worksheet = workbook.Worksheets[sheetIndex]; | |
// Adding sample values to cells | |
worksheet.Cells["A1"].PutValue(50); | |
worksheet.Cells["A2"].PutValue(100); | |
worksheet.Cells["A3"].PutValue(150); | |
worksheet.Cells["B1"].PutValue(4); | |
worksheet.Cells["B2"].PutValue(20); | |
worksheet.Cells["B3"].PutValue(50); | |
// Adding a chart to the worksheet | |
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column, 5, 0, 15, 5); | |
// Accessing the instance of the newly added chart | |
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex]; | |
// Adding Series Collection (chart data source) to the chart ranging from "A1" cell to "B3" | |
chart.NSeries.Add("A1:B3", true); | |
// Create an instance of ImageOrPrintOptions and set a few properties | |
ImageOrPrintOptions options = new ImageOrPrintOptions() | |
{ | |
VerticalResolution = 300, | |
HorizontalResolution = 300, | |
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias | |
}; | |
// Convert chart to image with additional settings | |
chart.ToImage(dataDir + "chartPNG_out.png", options); |
تقديم مخطط إلى PDF
من أجل تقديم المخطط إلى تنسيق PDF ، كشفت واجهات برمجة التطبيقات Aspose.Cells تنسيقرسم بيانيمع القدرة على تخزين الناتج PDF على مسار القرص أو الدفق.
// 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); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(); | |
// Adding a new worksheet to the Workbook | |
int sheetIndex = workbook.Worksheets.Add(); | |
// Obtaining the reference of the newly added worksheet by passing its index to WorksheetCollection | |
Worksheet worksheet = workbook.Worksheets[sheetIndex]; | |
// Adding sample values to cells | |
worksheet.Cells["A1"].PutValue(50); | |
worksheet.Cells["A2"].PutValue(100); | |
worksheet.Cells["A3"].PutValue(150); | |
worksheet.Cells["B1"].PutValue(4); | |
worksheet.Cells["B2"].PutValue(20); | |
worksheet.Cells["B3"].PutValue(50); | |
// Adding a chart to the worksheet | |
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column, 5, 0, 15, 5); | |
// Accessing the instance of the newly added chart | |
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex]; | |
// Adding Series Collection (chart data source) to the chart ranging from "A1" cell to "B3" | |
chart.NSeries.Add("A1:B3", true); | |
// Converting chart to PDF | |
chart.ToPdf(dataDir + "chartPDF_out.pdf"); |
أنواع الرسوم البيانية المدعومة للتقديم
هناك عدد قليل من أنواع المخططات التي لا يتم دعمها حاليًا للعرض. تحتوي هذه الأنواع من المخططات على ملفات** N ** في**عمود ** المدعوم من الجدول أدناه.
نوع التخطيط | النوع الفرعي للمخطط | أيد |
---|---|---|
عمود | عمود | ** نعم ** |
العمود مكدسة | ** نعم ** | |
عمود 100 نسبة مكدسة | ** نعم ** | |
Column3D العنقودية | ** نعم ** | |
العمود 3D مكدسة | ** نعم ** | |
عمود 3 D100Percent مكدسة | ** نعم ** | |
العمود 3 د | ** نعم ** | |
شريط | شريط | ** نعم ** |
بار مكدسة | ** نعم ** | |
شريط 100٪ مكدسة | ** نعم ** | |
شريط ثلاثي الأبعاد متفاوت | ** نعم ** | |
Bar3D مكدسة | ** نعم ** | |
شريط ثلاثي الأبعاد 100٪ مكدس | ** نعم ** | |
خط | خط | ** نعم ** |
LineStacked | ** نعم ** | |
Line100Percent مكدس | ** نعم ** | |
LineWithDataMarkers | ** نعم ** | |
LineStackedWithDataMarkers | ** نعم ** | |
Line100PercentStackedWithDataMarkers | ** نعم ** | |
Line3D | ** نعم ** | |
فطيرة | فطيرة | ** نعم ** |
Pie3D | ** نعم ** | |
فطيرة فطيرة | ** نعم ** | |
انفجرت الفطيرة | ** نعم ** | |
انفجرت Pie3D | ** نعم ** | |
بي بار | ** نعم ** | |
مبعثر | مبعثر | ** نعم ** |
ScatterConnectedByCurvesWithDataMarker | ** نعم ** | |
ScatterConnectedByCurvesWithoutDataMarker | ** نعم ** | |
ScatterConnectedByLinesWithDataMarker | ** نعم ** | |
ScatterConnectedByLinesWithoutDataMarker | ** نعم ** | |
منطقة | منطقة | ** نعم ** |
المنطقة مكدسة | ** نعم ** | |
مساحة 100٪ مكدسة | ** نعم ** | |
Area3D | ** نعم ** | |
Area3D مكدس | ** نعم ** | |
Area3D100Percent مكدس | ** نعم ** | |
الدونات | الدونات | ** نعم ** |
انفجرت العجين | ** نعم ** | |
رادار | رادار | ** نعم ** |
RadarWithDataMarkers | ** نعم ** | |
الرادار | ** نعم ** | |
سطح - المظهر الخارجي | Surface3D | ن |
SurfaceWireframe3D | ن | |
SurfaceContour | ن | |
SurfaceContourWireframe | ن | |
فقاعة | فقاعة | ** نعم ** |
فقاعة ثلاثية الأبعاد | ن | |
مخزون | StockHighLowClose | ** نعم ** |
مخزون OpenHighLowClose | ** نعم ** | |
حجم المخزن HighLowClose | ** نعم ** | |
حجم المخزون OpenHighLowClose | ** نعم ** | |
اسطوانة | اسطوانة | ** نعم ** |
اسطوانة مكدسة | ** نعم ** | |
اسطوانة 100٪ مكدسة | ** نعم ** | |
أسطواني بار | ** نعم ** | |
أسطواني بار مكدس | ** نعم ** | |
شريط أسطواني 100٪ مكدس | ** نعم ** | |
عمود أسطواني ثلاثي الأبعاد | ** نعم ** | |
مخروط | مخروط | ** نعم ** |
مخروط | ** نعم ** | |
مخروط 100٪ مكدسة | ** نعم ** | |
مخروطي الشكل | ** نعم ** | |
مخروطي الشكل مكدس | ** نعم ** | |
مخروطي الشكل 100٪ مكدس | ** نعم ** | |
عمود مخروطي ثلاثي الأبعاد | ** نعم ** | |
هرم | هرم | ** نعم ** |
الهرم مكدسة | ** نعم ** | |
الهرم 100٪ مكدسة | ** نعم ** | |
هرم بار | ** نعم ** | |
PyramidBar مكدس | ** نعم ** | |
PyramidBar100Percent مكدسة | ** نعم ** | |
الهرم عمود 3 د | ** نعم ** | |
BoxWhisker | BoxWhisker | ص |
قمع | قمع | ** نعم ** |
باريتولين | باريتولين | ** نعم ** |
أمة الله | أمة الله | ** نعم ** |
مخطط Treemap | مخطط Treemap | ** نعم ** |
شلال | شلال | ** نعم ** |
الرسم البياني | الرسم البياني | ص |
خريطة | خريطة | ن |