StripLine 类

定义

表示图表上的带状线。Represents the strip lines on a chart.

public ref class StripLine : System::Windows::Forms::DataVisualization::Charting::ChartElement
public class StripLine : System.Windows.Forms.DataVisualization.Charting.ChartElement
type StripLine = class
    inherit ChartElement
Public Class StripLine
Inherits ChartElement
继承
StripLine

注解

条带线 (或条带) 是水平或垂直的范围, 用常规或自定义间隔对图表的背景进行着色。Strip lines, or strips, are horizontal or vertical ranges that shade the background of a chart in regular or custom intervals. 您可以使用条带线执行以下操作:You can use strip lines to:

  • 提高在图表上查找各个值时的可读性。Improve readability for looking up individual values on the chart.

  • 读取图表时单独的数据点。Separate data points when reading the chart.

  • 突出显示定期出现的日期, 例如, 用于标识周末数据点。Highlight dates that occur at regular intervals, for example, to identify weekend data points.

  • 突出显示特定键范围内的数据。Highlight a specific key range of data.

  • 在特定常量值处添加阈值行。Add a threshold line at a specific constant value.

对于给定StripLine的时间间隔, 可以一次或多次绘制单个对象。A single StripLine object can either be drawn once, or repeatedly, for a given interval. 此操作由Interval属性控制。This action is controlled by the Interval property. 如果将零值分配给该Interval属性, 则将绘制一个条带线。When a value of zero is assigned to the Interval property, one strip line will be drawn. 如果为Interval属性分配非零值, 则会在每个给定的时间间隔重复绘制条带线。When a non-zero value is assigned to the Interval property, a strip line will be drawn repeatedly at each given interval. 条带线的绘制位置也受条带线的IntervalOffsetIntervalOffsetType属性的影响。The location where a strip line is drawn is also affected by the IntervalOffset and IntervalOffsetType properties of the strip line.

条带线始终与Axis对象相关联。Strip lines are always associated with an Axis object. 可以在设计时和运行时添加它们。They can be added at both design time and run time.

若要添加水平或垂直线条以显示阈值, 请将StripWidth属性设置为值0.0。To add a horizontal or vertical line to display a threshold, set the StripWidth property to a value of 0.0. 这将导致绘制线条。This will result in a line being drawn. 对于线条的颜色BorderColorBorderDashStyle宽度BorderWidth和样式, 可以使用、和属性。You can use the BorderColor, BorderDashStyle and BorderWidth properties for the color, width and style of the line. 当属性设置为 0.0Back*时, 不使用任何图表背景属性 ()。 StripWidthNo chart background properties (Back*) are used when the StripWidth property is set to 0.0.

使用条Text带线的属性将文本与条带线关联。Use the Text property of the strip line to associate text with a strip line. 此文本的位置和方向可以通过TextAlignment属性进行控制。The placement and orientation of this text can be controlled by the TextAlignment property.

为同一轴定义多条带线时, 条带线可能会重叠。When multiple strip lines are defined for the same axis, it is possible that the strip lines will overlap. StripLine对象的 Z 顺序由其StripLinesCollection在对象中的出现顺序确定。The Z-order of StripLine objects is determined by their order of occurrence in the StripLinesCollection object. 这意味着首先绘制第一个匹配项;第二次出现第二个, 依此类推。This means that the first occurrence is drawn first; the second occurrence is drawn second, and so on.

以下图表类型不支持条带线:饼图、圆环图、漏斗图、棱锥图、卡吉、ThreeLineBreak、点数、极坐标和雷达图。Strip lines are not supported for the following chart types: Pie, Doughnut, Funnel, Pyramid, Kagi, ThreeLineBreak, PointAndFigure, Polar and Radar.

构造函数

StripLine()

初始化 StripLine 类的新实例。Initializes a new instance of the StripLine class.

属性

BackColor

获取或设置带状线的背景色。Gets or sets the background color of the strip line.

BackGradientStyle

获取或设置带状线的渐变样式。Gets or sets the gradient style of the strip line.

BackHatchStyle

获取或设置带状线的阴影样式。Gets or sets the hatching style of the strip line.

BackImage

获取或设置带状线的背景图像。Gets or sets the background image of the strip line.

BackImageAlignment

获取或设置背景图像对齐方式。Gets or sets the background image alignment.

BackImageTransparentColor

获取或设置在绘制背景图像时,将替换为透明色的颜色。Gets or sets a color which will be replaced with a transparent color when the background image is drawn.

BackImageWrapMode

获取或设置带状线的背景图像的绘制模式。Gets or sets the drawing mode of the background image of the strip line.

BackSecondaryColor

获取或设置带状线背景的辅助颜色。Gets or sets the secondary color of the strip line background.

BorderColor

获取或设置带状线的边框颜色。Gets or sets the border color of a strip line.

BorderDashStyle

获取或设置带状线的边框样式。Gets or sets the border style of the strip line.

BorderWidth

获取或设置带状线的边框宽度。Gets or sets the border width of the strip line.

Font

获取或设置用于带状线文本的字体。Gets or sets the font used for the strip line text.

ForeColor

获取或设置带状线文本的颜色。Gets or sets the color of the strip line text.

Interval

获取或设置带状线的间隔,并确定带状线是绘制一次还是重复绘制。Gets or sets the interval for a strip line, and determines if the strip line is drawn once or repeatedly.

IntervalOffset

获取或设置网格线、刻度线、带状线和轴标签的偏移量。Gets or sets the offset of grid lines, tick marks, strip lines and axis labels.

IntervalOffsetType

获取或设置带状线的间隔偏移量类型。Gets or sets the interval offset type of the strip line.

IntervalType

获取或设置 StripLine 对象的间隔类型。Gets or sets the interval type of a StripLine object.

Name

获取带状线的名称。Gets the name of the strip line.

StripWidth

获取或设置带状线的宽度。Gets or sets the width of a strip line.

StripWidthType

获取或设置 StripWidth 属性的度量单位。Gets or sets the unit of measurement for the StripWidth property.

Tag

获取或设置与此图表元素关联的对象。Gets or sets an object associated with this chart element.

(继承自 ChartElement)
Text

获取或设置带状线的文本。Gets or sets the text of the strip line.

TextAlignment

获取或设置带状线的文本对齐方式。Gets or sets the text alignment of the strip line.

TextLineAlignment

获取或设置带状线的文本行对齐方式。Gets or sets the text line alignment of the strip line.

TextOrientation

获取或设置文本方向。Gets or sets the text orientation.

ToolTip

获取或设置带状线的工具提示。Gets or sets the tooltip of a strip line.

方法

Dispose()

释放由 ChartElement 占用的资源。Releases the resources used by the ChartElement.

(继承自 ChartElement)
Dispose(Boolean)

释放由 StripLine 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the StripLine and optionally releases the managed resources.

Equals(Object)

确定指定的 Object 是否等同于当前的 ChartElementDetermines whether the specified Object is equal to the current ChartElement.

(继承自 ChartElement)
GetHashCode()

返回特定类型的哈希算法。Returns a hash function for a particular type.

(继承自 ChartElement)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前 Object 的字符串。Returns a string that represents the current Object.

(继承自 ChartElement)

适用于