MS Chart Control的自定义属性(custom attributes)

本文介绍了MS Chart Control中的自定义属性,这些属性在VS2008编辑器中不可见,但对图表的精确控制至关重要。例如,设置柱形图宽度需要使用PixelPointWidth属性,如chart1.Series[0].PixelPointWidth = "20"; 通过查阅MS提供的图表帮助文档,可以找到更多隐藏的自定义属性,以满足特定需求。
摘要由CSDN通过智能技术生成

在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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

极客行天下

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值