Aspose.Words使用教程之如何使用ChartDataLabel

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

立即下载Aspose.Words最新版http://www.evget.com/product/564

C#

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;

Visual Basic

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

结果如下:

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值