在MS Chart Control中,有一类属性并不能在VS2008编辑器中自动显示出来,这类属性就称作自定义属性,即custom attributes。有时候,这些属性显得很重要,只有靠它们才能达成目的。比如在前文中曾经提到设置柱形图的宽度,需要用到PixelPointWidth这个自定义属性,如下:
chart1.Series[0]"PixelPointWidth"] = "20";
否则,柱形图项目的宽度会自动适应,没办法控制其宽度。
这几天,一直在寻找这些隐藏起来的东西,终于在MS提供的图表帮助文档中找到了答案,先复制下来,以备不时之需:
Custom Attribute | Description | Chart Types | Chart Elements | Value Range | Default | 2D, 3D | Notes |
---|---|---|---|---|---|---|---|
3DLabelLineSize |
Gets or sets the 3D label line size as a percentage of the default size. |
Pie, Doughnut |
Series |
30 – 200 |
100 |
3D |
It represents the amount of space reserved for drawing the line that connects a slice to a label drawn outside of the chart (see PieLabelStyle custom attribute). |
AreaDrawingStyle |
Gets or sets the plotting area shape of Radar and Polar charts. |
Polar, Radar, Rose |
Series |
Circle, Polygon |
Circle |
2D, 3D |
|
ArrowSize |
Sets the relative size of the arrowhead used in line segments that join labels to their data points. |
Pie, Doughnut |
Series, DataPoint |
1.0 – 10.0 |
1.0 |
2D, 3D |
This custom attribute only applies when PieLabelStyle is set to Outside. |
ArrowsType |
Sets the type of arrowhead to use for line segments that join labels to their data points. |
Pie, Doughnut |
Series, DataPoint |
None, Triangle, Sharp Triangle, Lines |
None |
2D, 3D |
This custom attribute only applies when PieLabelStyle is set to Outside. |
BarLabelStyle |
Gets or sets the data point label placement. |
Bar, Gantt |
Series, DataPoint |
Outside, Left, Right, Center |
Outside |
2D, 3D |
|
BoxPlotPercentile |
Gets or sets the percentile value of the box of the Box chart. |
Box |
Series |
0 – 50 |
25 |
2D, 3D |
|
BoxPlotSeries |
Gets or sets the name of the series to be used as the data source for the Box chart. |
Box |
Series |
Name of any existing series |
|
2D, 3D |
The named series must exist. Otherwise, an exception will be thrown. More than one series can be specified by separating each series with the semicolon (;) character. This will create a single box plot data point for each series. |
BoxPlotShowAverage |
Gets or sets a textual Boolean value that indicates whether to display the average value for the Box chart. |
Box |
Series |
True, False |
True |
2D, 3D |
Specify True to display the average value. Otherwise, specify False. |
BoxPlotShowMedian |
Gets or sets a textual Boolean value that indicates whether to display the median value for the Box chart. |
Box |
Series |
True, False |
True |
2D, 3D |
Specify True to display the median value. Otherwise, specify False. |
BoxPlotShowUnusualValues |
Gets or sets a textual Boolean value that indicates whether the unusual values value for the Box chart will be shown. |
Box |
Series |
True, False |
True |
2D, 3D |
The attribute will only work if the BoxPlotSeries attribute is set. |
BoxPlotWhiskerPercentile |
Gets or sets the percentile value of the whiskers of the Box chart. |
Box |
Series |
0 – 50 |
10 |
2D, 3D |
|
BoxSize |
Gets or sets the Renko or Point and Figure box size as either a percentage or a fixed value. |
Renko, Point and Figure |
Series |
Any valid numeric or percentage value |
4% |
2D, 3D |
|
BubbleMaxSize |
Gets or sets the maximum size of the bubble radius as a percentage of the chart area size. |
Bubble |
Series |
0 – 100 |
15 |
2D, 3D |
|
BubbleMinSize |
Gets or sets the minimum size of the bubble radius as a percentage of the chart area size. |
Bubble |
Series |
0 – 100 |
3 |
2D, 3D |
|
BubbleScaleMax |
Gets or sets the bubble size that will be used as the maximum, which is a percentage of the chart area that is set by BubbleMaxSize. |
Bubble |
Series |
0 – 100 |
15 |
2D, 3D |
If set to Auto, the largest plotted bubble will be displayed using the maximum size. |
BubbleScaleMin |
Gets or sets the bubble size that will be used as the minimum, which is a percentage of the chart area that is set by BubbleMinSize. |
Bubble |
Series |
0 – 100 |
3 |
2D, 3D |
If set to Auto, the smallest plotted bubble will be displayed using the minimum size. |
BubbleUseSizeForLabel |
Gets or sets a Boolean value that indicates whether to use the bubble size as the data point label. |
Bubble |
Series |
True, False |
False |
2D, 3D |
Specify True to use the bubble size as the data point label. Otherwise, specify False. |
CalloutLineColor |
Gets or sets the CalloutLineColor for the data point labels of Funnel or Pyramid charts. |
Funnel, Pyramid |
Series, DataPoint |
Any named Color, ARGB or RGB value. |
Color.Empty |
2D, 3D |
This custom attribute only applies when the FunnelLabelStyle or PyramidLabelStyle is set to |