转 mschart 自定义属性

 

转自 http://blog.csdn.net/gaofeng2000/archive/2009/03/12/3985741.aspx

 

 

在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 OutsideInColumn.

CollectedColor

Gets or sets the color of the collected pie or doughnut slice.

Pie, Doughnut

Series

Any named Color, ARGB or RGB value.

Color.Empty

2D, 3D

This custom attribute only applies when a CollectedThreshold value is set.

CollectedLabel

Gets or sets the label of the collected pie slice.

Pie, Doughnut

Series

  

2D, 3D

This custom attribute only applies when CollectedThreshold is set.

CollectedLegendText

Gets or sets the legend text of the collected pie slice.

Pie, Doughnut

Series

  

2D, 3D

This custom attribute only applies when CollectedThreshold is set.

CollectedSliceExploded

Gets or sets a Boolean value that indicates whether the collected pie slice will be shown as exploded.

Pie, Doughnut

Series

True, False

True

2D, 3D

This custom attribute only applies when CollectedThreshold is set.

CollectedThreshold

Gets or sets the threshold value for collecting small pie slices.

Pie, Doughnut

Series

Any double between 0 to 100 if CollectedThresholdUsePercent is true, otherwise any double > 0

0

2D, 3D

This custom attribute can be set as a percentage of the total series values or as a simple value, based on the CollectedThresholdUsePercent attribute.

Note:
There must be at least two points below the threshold value in order for the chart to collect pie slices.

CollectedThresholdUsePercent

Gets or sets a Boolean value that indicates whether to use the collected threshold value as percentage.

Pie, Doughnut

Series

True, False

True

2D, 3D

If set to True, data points will be collected based on values in percent below CollectedThreshold. If set to False, data points will be collected based on the actual values below CollectedThreshold.

CollectedToolTip

Gets or sets the tooltip of the collected pie slice.

Pie, Doughnut

Series

  

2D, 3D

This custom attribute only applies when CollectedThreshold is set.

DoughnutRadius

Gets or sets the radius of the Doughnut chart.

Doughnut

Series

0 – 100

60

2D, 3D

The value of this attribute indicates the percentage of the overall radius of the chart that will be used for the Doughnut center hole. For example, if DoughnutRadius is set to 100, the doughnut hole will not exist, therefore, the chart will look like a Pie chart. The larger the value of DoughnutRadius, the smaller the doughnut hole of the chart. 

DrawingStyle

Gets or sets the data point drawing style (shape) of one or more data points.

Bar, Column, Stacked Bar, 100% Stacked Bar, Stacked Column, 100% Stacked Column, Gantt, RangeColumn

Series, DataPoint

Cylinder, Emboss, LightToDark, Wedge, Default

Default

2D, 3D

 

EmptyPointValue

Gets or sets the value to be used for empty points.

Point, Bubble, Line, Spline, StepLine, Column, RangeColumn, Gantt, Radar, Range, SplineRange, Polar, Area, SplineArea, Bar

Series, DataPoint

Average, Zero

Average

2D, 3D

This property determines how an empty point is treated when the chart is drawn. If a value of Average is used, the chart is drawn as though a point exists, and has a value of the average of the two adjacent points. If Zero is used, the chart is drawn as though a point exists with a zero value.

ErrorBarCenterMarkerStyle

Gets or sets the appearance of the marker at the center value of the error bar.

Error Bar

Series, DataPoint

None, Line, Square, Circle, Diamond, Triangle, Cross, Star4, Star5, Star6, Star10

None

2D, 3D

 

ErrorBarSeries

Gets or sets the name of the series to be used as the data source for the Error Bar chart calculations.

Error Bar

Series

Name of any existing series.

 

2D, 3D

The named series must exist otherwise an exception will be thrown. 

ErrorBarStyle

Gets or sets the visibility of the Upper and Lower Error values.

Error Bar

Series, DataPoint

Both, UpperError, LowerError

Both

2D, 3D

 

ErrorBarType

Gets or sets a value that defines how the Upper and Lower Error values are calculated for the center values of the ErrorBarSeries.

Error Bar

Series

FixedValue, Percentage, StandardDeviation, StandardError

 

2D, 3D

This attribute accepts a formula name with and optional parameter enclosed in parentheses.

FixedValue - The error value is a fixed value defined by a required parameter (for example, FixedValue(15)).Percentage - Errors are calculated as a percentage of the data point center value with an optional parameter. If a parameter is not specified, a 10% error will be used for upper and lower errors (For example, Percentage(10)).StandardDeviation - The error values are determined by applying a standard deviation calculation on the center values in the error bar series with an optional parameter. A supplied parameter (1,2,3, … n) defines the number of standard deviations to use. By default, if a parameter is not provided, a standard deviation of 1 is used. (for example, StandardDeviation(3)).StandardError - Error values are found by applying standard error calculations on the center values in the error bar series with an optional parameter. The supplied parameter (1,2,3, … n) defines the number of standard errors to use. If none is provided, the default value of 1 is used (for example, StandardError(2)).

Exploded

Gets or sets a textual Boolean value that indicates whether the Pie or Doughnut data point is exploded. 

Pie, Doughnut

DataPoint

True, False

False

2D, 3D

 

Funnel3DDrawingStyle

Gets or sets the Funnel chart 3D drawing style.

Funnel

Series

CircularBase, SquareBase

SquareBase

3D

This attribute only applies when the ChartArea.Area3DStyle.Enable3D property must is set to true.

Funnel3DRotationAngle

Gets or sets the Funnel chart 3D rotation angle.

Funnel

Series

-10 – 10

5

3D

This attribute only applies when the ChartArea.Area3DStyle.Enable3D property must is set to true.

FunnelInsideLabelAlignment

Gets or sets the Funnel chart data point label placement when the FunnelLabelStyle is set to Inside.

Funnel

Series, DataPoint

Center, Top, Bottom

Center

2D, 3D

This attribute only applies when the FunnelLabelStyle is set to Inside.

FunnelLabelStyle

Gets or sets the Funnel chart data point label style.

Funnel

Series, DataPoint

Inside, Outside, OutsideInColumn, Disabled

OutsideInColumn

2D, 3D

If the label is not set to Disabled, the attributes FunnelInsideLabelAlignment and FunnelOutsideLabelPlacement are used to specify additional positioning rules.

FunnelMinPointHeight

Gets or sets minimum height of a Funnel chart data point measured in relative coordinates.

Funnel

Series

0 – 100

0

2D, 3D

Any point that would typically be drawn smaller than the amount specified by this attribute is drawn using this value instead. This feature eliminates the occurrence of very thin slices, which may be difficult or impossible to see when displayed in your chart.

FunnelNeckHeight

Gets or sets the Funnel chart neck height.

Funnel

Series

0 – 100

5

2D, 3D

This attribute only applies when the FunnelStyle attribute is set to YIsHeight.

FunnelNeckWidth

Gets or sets the Funnel chart neck width.

Funnel

Series

0 – 100

5

2D, 3D

This attribute only applies when the FunnelStyle attribute is set to YIsWidth.

FunnelOutsideLabelPlacement

Gets or sets the Funnel chart data point label placement when the FunnelLabelStyle is set to Outside or OutsideInColumn.

Funnel

Series, DataPoint

Right, Left

Right

2D, 3D

This attribute only applies when the FunnelLabelStyle is set to Outside or OutsideInColumn.

FunnelPointGap

Gets or sets the gap size between the points of a Funnel chart measured in relative coordinates.

Funnel

Series

0 – 100

0

2D, 3D

The maximum gap size is limited by the number of points.

FunnelStyle

Gets or sets the Funnel chart style.

Funnel

Series

YIsWidth, YIsHeight

YIsHeight

2D, 3D

 

InnerRadius

Gets or sets the radius of the circular gap in the center of the chart.

Rose, Stacked Rose

Series

0 – 20

0

2D, 3D

The value of this attribute indicates the percentage of the overall chart image that will be used to set the radius of a hole, called a gap, that will appear at the center of the chart. For example, if InnerRadius is set to 5, the radius of the center gap will represent 5% of the total width and height of the chart image. The larger the value of InnerRadius, the larger the radius of the gap in the center of the chart.

LabelsHorizontalLineSize

Gets or sets the size of the horizontal segment of the callout line.

Pie, Doughnut

Series, DataPoint

0 – 100

1

2D

This attribute only applies when the PieLabelStyle is set to Outside.

For 3D charts, see 3DLabelLineSize.

LabelsRadialLineSize

Gets or sets the size of the radial segment of the callout line.

Pie, Doughnut

Series, DataPoint

0 – 100

1

2D

This attribute only applies when the PieLabelStyle is set to Outside.

For 3D charts, see 3DLabelLineSize.

LabelStyle

Gets or sets the label position of the data point.

Point, Column, Bubble, Line, Spline, StepLine, Area, SplineArea, Range, SplineRange, Radar, Polar

Series, DataPoint

Auto, Top, Bottom, Right, Left, TopLeft, TopRight, BottomLeft, BottomRight, Center

Auto

2D, 3D

 

LabelValueType

Gets or sets the Y value to use as the data point label.

Stock, CandleStick

Series, DataPoint

High, Low, Open, Close

Close

2D, 3D

 

LineTension

Gets or sets the line tension for the drawing of curves.

Spline, SplineArea, SplineRange

Series

0 – 2

0.8

2D, 3D

A curve with LineTension set to zero (0) will have the appearance of a Line chart.

MaxPixelPointWidth

Gets or sets the maximum width of the data point in pixels.

Bar, CandleStick, Column, StackedBar, StackedBar100, StackedColumn, StackedColumn100, Stock, BoxPlot, ErrorBar, Gantt, RangeColumn

Series

Any integer > 0

0

2D, 3D

 

MinimumRelativePieSize

Gets or sets the minimum Pie or Doughnut sizel.

Pie, Doughnut

Series

10 – 70

30

2D, 3D

When used with outside labeling (see PieLabelStyle), this attribute controls the minimum acceptable pie size as a percentage the chart area size. This will prevent the pie from becoming too small due to labels dominating the chart area.

MinPixelPointWidth

Gets or sets the minimum data point width in pixels.

Bar, CandleStick, Column, StackedBar, StackedBar100, StackedColumn, StackedColumn100, Stock, BoxPlot, ErrorBar, Gantt, RangeColumn

Series

Any integer > 0

0

2D, 3D

This attribute causes data points to be more visible. This is especially useful when plotting a large data set, which makes data points indistinguishable.

NumberOfLinesInBreak

Gets or sets the number of lines to use in a Three Line Break chart.

Three Line Break

Series

Any integer > 0

3

2D, 3D

 

OpenCloseStyle

Gets or sets the marker style for open and close values.

Stock, Candlestick

Series, DataPoint

Triangle, Line, Candlestick

Line

2D, 3D

 

PieDrawingStyle

Gets or sets the data point drawing style (shape) of one or more data points.

Pie, Doughnut

Series

Default, SoftEdge, Concave

 

2D

 

PieLabelOffset

Gets or sets the offset for labels.

Pie, Doughnut

Series, DataPoint

X:Y, where both X and Y are integers > 0.

 

2D, 3D

This attribute value is set using a string that contains relative X and Y coordinates separated by a colon (:), and can be set for a series as well as individual data points.

PieLabelStyle

Gets or sets the data point label position.

Pie, Doughnut

Series, DataPoint

Disabled, Inside, Outside, Ellipse

Inside

2D, 3D

If a label is displayed outside the pie, the color of the connecting line is set by the BorderColor property by default, but it can also be controlled the PieLineColor custom attribute.

PieLineColor

Gets or sets the color of the radial and horizontal segments of the callout lines.

Pie, Doughnut

Series, DataPoint

Any named Color, ARGB or RGB value.

Color.Black

2D, 3D

This attribute only applies when PieLabelStyle is set to Outside.

PieStartAngle

Defines the location of the first pie or doughnut slice (for example, data point).

Pie, Doughnut

Series

0 – 360

90

2D, 3D

 

PixelPointDepth

Gets or sets the 3D Series depth in pixels.

Area, Bar, Bubble, CandleStick, Column, Line, Point, Spline, SplineArea, StackedArea, StackedArea100, StackedBar, StackedBar100, StackedColumn, StackedColumn100, StepLine, Stock, ThreeLineBreak, BoxPlot, ErrorBar, Gantt, Kagi, PointAndFigure, Range, RangeColumn, Renko, SplineRange, FastLine™

Series

Any integer > 0

0

3D

 

PixelPointGapDepth

Gets or sets the 3D gap depth in pixels.

Area, Bar, Bubble, CandleStick, Column, Line, Point, Spline, SplineArea, StackedArea, StackedArea100, StackedBar, StackedBar100, StackedColumn, StackedColumn100, StepLine, Stock, ThreeLineBreak, BoxPlot, ErrorBar, Gantt, Kagi, PointAndFigure, Range, RangeColumn, Renko, SplineRange, FastLine™

Series

Any integer > 0

0

3D

In 3D charts, the gap depth defines the amount of space between each plotted series.

PixelPointWidth

Gets or sets the data point width in pixels.

Bar, CandleStick, Column, StackedBar, StackedBar100, StackedColumn, StackedColumn100, Stock, BoxPlot, ErrorBar, Gantt, RangeColumn

Series

Any integer > 0

0

2D, 3D

 

PointWidth

Gets or sets the relative data point width.

Bar, CandleStick, Column, StackedBar, StackedBar100, StackedColumn, StackedColumn100, Stock, BoxPlot, ErrorBar, Gantt, RangeColumn

Series

0 – 2

0.8

2D, 3D

 

PolarDrawingStyle

Gets or sets the Polar chart drawing style.

Polar

Series

Line, Marker

Line

2D, 3D

 

PriceDownColor

Gets or sets the data point color to use to indicate a decreasing trend.

Candlestick

Series, DataPoint

Any named Color, ARGB or RGB value. 

Color.Empty

2D, 3D

A price is considered decreasing when the Close value is less than its Open value.

PriceUpColor

Gets or sets the data point color to use to indicate an increasing trend.

Candlestick, Point and Figure, Renko, Kagi, Three Line Break

Series, DataPoint for CandleStick charts. Otherwise only Series objects.

Any named Color, ARGB or RGB value. 

Color.Empty

2D, 3D

A price is considered increasing when the Close value is greater than its Open value.

ProportionalSymbols

Gets or sets a value that indicates that the Point and Figure chart should attempt to draw the X and O values proportionally.

Point and Figure

Series

True, False

True

2D, 3D

 

Pyramid3DDrawingStyle

Gets or sets the 3D drawing style of the Pyramid chart.

Pyramid

Series

CircularBase, SquareBase

SquareBase

3D

This custom attribute only applies when the property ChartArea.Area3DStyle.Enable3D is set to true.

Pyramid3DRotationAngle

Gets or sets the 3D rotation angle of the Pyramid chart.

Pyramid

Series

-10 – 10

5

3D

This custom attribute only applies when the property ChartArea.Area3DStyle.Enable3D is set to true.

PyramidInsideLabelAlignment

Gets or sets the Pyramid chart data point label placement when the PyramidLabelStyle is set to Inside.

Pyramid

Series, DataPoint

Center, Top, Bottom

Center

2D, 3D

This attribute is applicable only when the PyramidLabelStyle is set to Inside.

PyramidLabelStyle

Gets or sets the Pyramid chart data point label style.

Pyramid

Series, DataPoint

Inside, Outside, OutsideInColumn, Disabled

OutsideInColumn

2D, 3D

 

PyramidMinPointHeight

Gets or sets minimum height of a data point measured in relative coordinates.

Pyramid

Series

0 – 100

0

2D, 3D

The Pyramid chart uses this attribute's value as the displayed height of any data point with a value less than it. This eliminates very thin slices.

PyramidOutsideLabelPlacement

Gets or sets the data point label placement when the PyramidLabelStyle is set to Outside or OutsideInColumn.

Pyramid

Series, DataPoint

Right, Left

Right

2D, 3D

This attribute only applies when the PyramidLabelStyle is set to Outside or OutsideInColumn.

PyramidPointGap

Gets or sets the gap size between the points of a Pyramid chart measured in relative coordinates.

Pyramid

Series

0 – 100

0

2D, 3D

 

PyramidValueType

Gets or sets a value that determines whether the data point value represents a linear height or the surface of the segment.

Pyramid

Series

Linear, Surface

Linear

2D, 3D

 

RadarDrawingStyle

Gets or sets the Radar chart drawing style.

Radar, Rose

Series

Area, Line, Marker

Area

2D, 3D

 

ReversalAmount

Gets or sets the reversal amount for the chart.

Point and Figure, Kagi

Series

A positive number or percentage (eg. 1.2 or 4%) 

3%

2D, 3D

When used with the Kagi chart, this custom attribute defines when a new Kagi line should be drawn.

This value may be a percentage or fixed amount. When used with the Point and Figure chart, ReversalAmount defines a custom reversal amount for the chart in box sizes.

RoseDrawingStyle

Gets or sets the Rose chart drawing style.

Rose

Series, DataPoint

Area, Line

Area

2D, 3D

 

RoseSectorAngle

Sets the sector angle of the rose chart in integer degrees.

Rose

Series

0 – 360

Calculated by dividing 360 by the number of datapoints.

2D, 3D

 

ShowMarkerLines

Gets or sets a Boolean value that indicates whether marker lines are displayed when rendered in 3D.

Line, Spline, StepLine, Area, SplineArea, Range, SplineRange

Series, DataPoint

True, False

False

3D

 

ShowOpenClose

Gets or sets a Boolean value that indicates whether markers for open can close prices are displayed.

Stock

Series, DataPoint

Both, Open, Close

Both

2D, 3D

 

StackedGroupName

Gets or sets the stacked group name.

StackedBar, StackedBar100, StackedColumn, and StackedColumn100.

Series

  

2D, 3D

To place multiple series in the same stacked group, assign the same name to them.

To show multiple stacks, assign different names to multiple series.

UsedYValue

Gets or sets the zero based index of the Y value to use to plot the Kagi, Renko, or Three Line Break chart.

Kagi, Renko, Three Line Break

Series

0, 1, 2, 3, n

0

2D, 3D

0  - The First DataPoint Y Value.

1  - The Second DataPoint Y Value.

2  - The Third DataPoint Y Value.

3  - The Fourth DataPoint Y Value.

n  - The nth DataPoint Y Value.

UsedYValueHigh

Gets or sets the zero-based index of the high Y value to use plot the Point and Figure chart.

Point and Figure

Series

0, 1, 2, 3, n

0

2D, 3D

0  - The First DataPoint Y Value.

1  - The Second DataPoint Y Value.

2  - The Third DataPoint Y Value.

3  - The Fourth DataPoint Y Value.

n  - The nth DataPoint Y Value.

UsedYValueLow

Gets or sets the zero-based index of the low Y value to use plot the Point and Figure chart.

Point and Figure

Series

0, 1, 2, 3, n

0

2D, 3D

0  - The First DataPoint Y Value.

1  - The Second DataPoint Y Value.

2  - The Third DataPoint Y Value.

3  - The Fourth DataPoint Y Value.

n  - The nth DataPoint Y Value.

TooltipOffset

Specifies whether to display the data point, as well as its related tooltip, at index 0.

Spline, Area, SplineArea

Series

Auto, True, False

Auto

2D

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值