Keyword | Replaced By | Supports Multiple Y Values | Supports Formatting String |
#VALX | X value of the data point. | No | Yes |
#VALY | Y value of the data point | Yes | Yes |
#SERIESNAME | Series name | No | No |
#LABEL | Data point label | No | No |
#AXISLABEL | Data point axis label | No | No |
#INDEX | Data point index in the series | No | Yes |
#PERCENT | Percent of the data point Y value | Yes | Yes |
#LEGENDTEXT | Series or data point legend text | No | No |
#CUSTOMPROPERTY(XXX) | Series or data point XXX custom property value, where XXX is the name of the custom property. | No | No |
#TOTAL | Total of all Y values in the series | Yes | Yes |
#AVG | Average of all Y values in the series | Yes | Yes |
#MIN | Minimum of all Y values in the series | Yes | Yes |
#MAX | Maximum of all Y values in the series | Yes | Yes |
#FIRST | Y value of the first point in the series | Yes | Yes |
#LAST | Y value of the last point in the series | Yes | Yes |
利用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