رسم بياني للأسطورة
Contents
[
Hide
]
موضع الأسطورة
كي تحدد خصائص الأسطورة. يرجى اتباع الخطوات أدناه:
- أنشئ مثيلًا من Presentation الفئة.
- احصل على مرجع الشريحة.
- إضافة رسم بياني على الشريحة.
- تعيين خصائص الأسطورة.
- اكتب العرض التقديمي كملف PPTX.
في المثال الموضح أدناه، قمنا بتعيين الموضع والحجم لأسطورة الرسم البياني.
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-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = L"../out/legendCustomOptions_out.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
//Access first slide | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add chart with default data | |
SharedPtr<IChart> chart = slide->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::ClusteredColumn, 0, 0, 500, 500); | |
// Set Legend Properties | |
chart->get_Legend()->set_X ( 50 / chart->get_Width()); | |
chart->get_Legend()->set_Y ( 50 / chart->get_Height()); | |
chart->get_Legend()->set_Width ( 100 / chart->get_Width()); | |
chart->get_Legend()->set_Height ( 100 / chart->get_Height()); | |
// Write the presentation file to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |
تعيين حجم خط الأسطورة
تسمح Aspose.Slides لـ C++ للمطورين بتعيين حجم خط الأسطورة. يرجى اتباع الخطوات أدناه:
- أنشئ مثيلًا من Presentation الفئة.
- إنشاء الرسم البياني الافتراضي.
- تعيين حجم الخط.
- تعيين القيمة الدنيا للمحور.
- تعيين القيمة القصوى للمحور.
- اكتب العرض التقديمي على القرص.
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-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = u"../out/SettingFontSizeOfLegend_out.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
//Access first slide | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add chart with default data | |
SharedPtr<IChart> chart = slide->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::ClusteredColumn, 0, 0, 500, 500); | |
//Setting legend properties | |
chart->get_Legend()->get_TextFormat()->get_PortionFormat()->set_FontHeight (20); | |
chart->get_Axes()->get_VerticalAxis()->set_IsAutomaticMinValue (false); | |
chart->get_Axes()->get_VerticalAxis()->set_MinValue (-5); | |
chart->get_Axes()->get_VerticalAxis()->set_IsAutomaticMaxValue (false); | |
chart->get_Axes()->get_VerticalAxis()->set_MaxValue ( 10); | |
// Write the presentation file to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |
تعيين حجم خط الأسطورة الفردية
تسمح Aspose.Slides لـ C++ للمطورين بتعيين حجم خط مدخلات الأسطورة الفردية. يرجى اتباع الخطوات أدناه:
- أنشئ مثيلًا من Presentation الفئة.
- إنشاء الرسم البياني الافتراضي.
- الوصول إلى مدخل الأسطورة.
- تعيين حجم الخط.
- تعيين القيمة الدنيا للمحور.
- تعيين القيمة القصوى للمحور.
- اكتب العرض التقديمي على القرص.
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-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = u"../out/SettingFontSizeOfIndividualLegend_out.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
//Access first slide | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add chart with default data | |
SharedPtr<IChart> chart = slide->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::ClusteredColumn, 0, 0, 500, 500); | |
//Setting legend properties | |
SharedPtr<IChartTextFormat> tf = chart->get_Legend()->get_Entries()->idx_get(1)->get_TextFormat(); | |
tf->get_PortionFormat()->set_FontBold (NullableBool::True); | |
tf->get_PortionFormat()->set_FontHeight(20); | |
tf->get_PortionFormat()->set_FontItalic(NullableBool::True); | |
tf->get_PortionFormat()->get_FillFormat()->set_FillType(FillType::Solid) ; | |
tf->get_PortionFormat()->get_FillFormat()->get_SolidFillColor()->set_Color(System::Drawing::Color::get_Blue()); | |
// Write the presentation file to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |