欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Aspose.Words使用教程之如何使用ChartDataLabel 博客分类: 文档管理,控件,使用教程 Aspose.Words使用教程ChartDataLabel 

程序员文章站 2024-03-25 10:02:04
...

       Aspose.Words是一款先进的文档处理控件,在不使用Microsoft Words的情况下,它可以使用户在各个应用程序中执行各种文档处理任务,其中包括文档的生成、修改、渲染、打印,文档格式转换和邮件合并等文档处理。此外,Aspose.Words支持DOC,OOXML,RTF,HTML,OpenDocument, PDF, XPS, EPUB和其他格式。

       使用ChartDataLabel你可以规定单个图表系列的数据标签的格式,像显现/隐藏图例、种类名字、SeriesName、值等等。

ChartDataLabelCollection dataLabelCollection = series0.DataLabels;
// Add data label to the first and second point of the first series.
ChartDataLabel chartDataLabel00 = dataLabelCollection.Add(0);
ChartDataLabel chartDataLabel01 = dataLabelCollection.Add(1);
// Set properties.
chartDataLabel00.ShowLegendKey = true;
// By default, when you add data labels to the data points in a pie chart, leader lines are displayed for data labels that are
// positioned far outside the end of data points. Leader lines create a visual connection between a data label and its 
// corresponding data point.
chartDataLabel00.ShowLeaderLines = true;
chartDataLabel00.ShowCategoryName = false;
chartDataLabel00.ShowPercentage = false;
chartDataLabel00.ShowSeriesName = true;
chartDataLabel00.ShowValue = true;
chartDataLabel00.Separator = "/";
chartDataLabel01.ShowValue = true;

 

 

Dim dataLabelCollection As ChartDataLabelCollection = series0.DataLabels
' Add data label to the first and second point of the first series.
Dim chartDataLabel00 As ChartDataLabel = dataLabelCollection.Add(0)
Dim chartDataLabel01 As ChartDataLabel = dataLabelCollection.Add(1)
' Set properties.
chartDataLabel00.ShowLegendKey = True
' By default, when you add data labels to the data points in a pie chart, leader lines are displayed for data labels that are
' positioned far outside the end of data points. Leader lines create a visual connection between a data label and its 
' corresponding data point.
chartDataLabel00.ShowLeaderLines = True
chartDataLabel00.ShowCategoryName = False
chartDataLabel00.ShowPercentage = False
chartDataLabel00.ShowSeriesName = True
chartDataLabel00.ShowValue = True
chartDataLabel00.Separator = "/"
chartDataLabel01.ShowValue = True

 

结果如下:

Aspose.Words使用教程之如何使用ChartDataLabel
            
    
    博客分类: 文档管理,控件,使用教程 Aspose.Words使用教程ChartDataLabel