设置MS Chart Control for .net饼图图例的文本

KeywordReplaced BySupports Multiple Y Values Supports Formatting String
#VALXX value of the data point.NoYes
#VALYY value of the data pointYesYes
#SERIESNAMESeries nameNoNo
#LABELData point labelNoNo
#AXISLABELData point axis labelNoNo
#INDEXData point index in the seriesNoYes
#PERCENTPercent of the data point Y valueYesYes
#LEGENDTEXTSeries or data point legend textNoNo
#CUSTOMPROPERTY(XXX)Series or data point XXX custom property value, where XXX is the name of the custom property.NoNo
#TOTALTotal of all Y values in the seriesYesYes
#AVGAverage of all Y values in the seriesYesYes
#MINMinimum of all Y values in the seriesYesYes
#MAXMaximum of all Y values in the seriesYesYes
#FIRSTY value of the first point in the seriesYesYes
#LASTY value of the last point in the seriesYesYes

 

利用keyword设置饼图上标签显示的格式,如:

chart1.Series[0].Label = "#VALY[#PERCENT]";

这时,标签显示为Y轴值的大小,并且在后面的中括号中会显示其占百分比。

在实际应用中我发现,在不做这个格式化的情况下,图例中默认显示的是X轴的相应名称,然而,一旦做了这个设置,图例显示的竟然和刚才这个标签的值一样了,这显然不是我想要的结果。但是,在legend的属性里却找不到有text,只有Title和name,title是用来设置图例的标题的,name则是用来指定其名称。

后来,在Series下找到一个LegendText属性,可以满足要求,设置如下:

chart1.Series[0].LegendText = "#VALX";

也利用了一个keyword,即设置其为x轴的对应值。


                                                       出处:http://blog.csdn.net/gaofeng2000/archive/2009/03/10/3975097.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值