Bubble Chart
Contents
[
Hide
]
Bubble Chart Size Scaling
Aspose.Slides for C++ provides support for Bubble chart size scaling. In Aspose.Slides for C++ IChartSeries.BubbleSizeScale and IChartSeriesGroup.BubbleSizeScale properties have been added. Below sample example is given.
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
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/SettingBubbleChartScaling_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::Bubble, 0, 0, 500, 500); | |
chart->get_ChartData()->get_SeriesGroups()->idx_get(0)->set_BubbleSizeScale(150); | |
// Write the presentation file to disk | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |
Represent Data as Bubble Chart Sizes
New get_BubbleSizeRepresentation() method has been added to IChartSeries and ChartSeries classes. BubbleSizeRepresentation specifies how the bubble size values are represented in the bubble chart. Possible values are: BubbleSizeRepresentationType.Area and BubbleSizeRepresentationType.Width. Accordingly, BubbleSizeRepresentationType enum has been added to specify the possible ways to represent data as bubble chart sizes. Sample code is given below.
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
System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(); | |
System::SharedPtr<IChart> chart = pres->get_Slides()->idx_get(0)->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::Bubble, 50.0f, 50.0f, 600.0f, 400.0f, true); | |
chart->get_ChartData()->get_SeriesGroups()->idx_get(0)->set_BubbleSizeRepresentation(Aspose::Slides::Charts::BubbleSizeRepresentationType::Width); | |
pres->Save(u"../out/Presentation.pptx", Aspose::Slides::Export::SaveFormat::Pptx); | |