气泡图
Contents
[
Hide
]
气泡图大小缩放
Aspose.Slides for PHP via Java 提供对气泡图大小缩放的支持。在 Aspose.Slides for PHP via Java 中添加了 IChartSeries.getBubbleSizeScale、IChartSeriesGroup.getBubbleSizeScale 和 IChartSeriesGroup.setBubbleSizeScale 方法。以下示例代码给出。
$pres = new Presentation();
try {
$chart = $pres->getSlides()->get_Item(0)->getShapes()->addChart(ChartType::Bubble, 100, 100, 400, 300);
$chart->getChartData()->getSeriesGroups()->get_Item(0)->setBubbleSizeScale(150);
$pres->save("Result.pptx", SaveFormat::Pptx);
} finally {
if (!java_is_null($pres)) {
$pres->dispose();
}
}
将数据表示为气泡图大小
方法 setBubbleSizeRepresentation 和 getBubbleSizeRepresentation 已添加到 IChartSeries、IChartSeriesGroup 接口及相关类中。BubbleSizeRepresentation 指定气泡大小值在气泡图中的表示方式。可能的值有:BubbleSizeRepresentationType::Area 和 BubbleSizeRepresentationType::Width。因此,已添加 BubbleSizeRepresentationType 枚举以指定将数据表示为气泡图大小的可能方式。示例代码如下。
$pres = new Presentation();
try {
$chart = $pres->getSlides()->get_Item(0)->getShapes()->addChart(ChartType::Bubble, 50, 50, 600, 400, true);
$chart->getChartData()->getSeriesGroups()->get_Item(0)->setBubbleSizeRepresentation(BubbleSizeRepresentationType::Width);
$pres->save("Presentation_BubbleSizeRepresentation.pptx", SaveFormat::Pptx);
} finally {
if (!java_is_null($pres)) {
$pres->dispose();
}
}