---
title: "在C++中使用图表"
---

在[DocumentBuilder](https://reference.aspose.com/words/cpp/aspose.words/documentbuilder/)类中添加了新的[InsertChart](https://reference.aspose.com/words/cpp/aspose.words/documentbuilder/insertchart/)方法。 所以，让我们看看如何使用[InsertChart](https://reference.aspose.com/words/cpp/aspose.words/documentbuilder/insertchart/)方法将简单的柱形图插入到文档中。

## 如何插入图表

在本节中，我们将学习如何将图表插入到文档中。

### 插入柱形图

下面的示例演示如何插入柱形图:

![create-column-chart-aspose-words-cpp](working-with-charts-1.png)

Series Add方法有四种不同的重载，它公开以涵盖所有图表类型的数据源的所有可能变体:

![create-column-chart-from-datasource-aspose-words-cpp](working-with-charts-2.png)

### 插入散点图

下面的示例演示如何插入散点图:

![scatter-chart-aspose-words-cpp](working-with-charts-3.png)

### 插入面积图

下面的示例演示如何插入面积图:

![area-chart-aspose-words-cpp](working-with-charts-4.png)

### 插入气泡图

下面的示例演示如何插入气泡图:

![bubble-chart-aspose-words-cpp](working-with-charts-5.png)

## 请参阅

有关更多信息，请参阅子文章。
