---
title: "在C++中使用图表数据标签"
---


Aspose.Words允许用户以各种方式使用ChartDataLabel。

## 如何格式化图表数据标签的数量

使用[NumberFormat](https://reference.aspose.com/words/cpp/aspose.words.drawing.charts/chartdatalabel/get_numberformat/)可以指定图表的单个数据标签的数字格式。

下面的代码示例演示如何格式化数据标签的数字:

{{< gist "aspose-words-gists" "d55d8631947d283b1f0da99afa06c492" "cpp-Programming-Documents-Charts-ChartNumberFormat-FormatNumberofDataLabel.cpp" >}}


## 如何使用图表数据标签

使用[ChartDataLabel](https://reference.aspose.com/words/cpp/aspose.words.drawing.charts/chartdatalabel/)，您可以指定图表系列的单个数据标签的格式，如显示/隐藏LegendKey, CategoryName, SeriesName, 价值等:

{{< gist "aspose-words-gists" "d55d8631947d283b1f0da99afa06c492" "cpp-Programming-Documents-Charts-WorkWithChartDataLabels-WorkWithChartDataLabel.cpp" >}}

请参阅下面的结果:

![work-with-chart-data-lable-aspose-words-cpp-1](working-with-chart-data-label-1.png)
