C# 클래스 MSChartExtension, MSChartExtension

Extension class for MSChart
파일 보기 프로젝트 열기: Code-Artist/MSChartExtension

공개 메소드들

메소드 설명
AddText ( this sender, string text, double x, double y, Drawing, textColor, string name = "", TextStyle, textStyle = TextStyle.Default, ChartArea chartArea = null ) : Annotation,

Add text annotation to chart.

ClearPoints ( this sender ) : void

Speed up MSChart data points clear operations.

Cursor1 ( this sender ) : ChartCursor

Return Cursor 1 Object

Cursor2 ( this sender ) : ChartCursor

Return Cursor 2 Object

CursorsDiff ( this sender ) : PointF

Calculate different between Cursor2 and Cursor1 where result = Cursor2 - Cursor1. Return 0 if either cursor is not valid.

DisableZoomAndPanControls ( this sender ) : void

Disable Zoom and Pan Controls

DrawHorizontalLine ( this sender, double y, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation

Draw a horizontal line on chart.

DrawLine ( this sender, double x0, double x1, double y0, double y1, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation

Draw a line on chart.

DrawRectangle ( this sender, double x, double y, double width, double height, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation

Draw a rectangle on chart.

DrawVerticalLine ( this sender, double x, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation

Draw a vertical line on chart.

EnableZoomAndPanControls ( this sender ) : void

Enable Zoom and Pan Controls.

EnableZoomAndPanControls ( this sender, CursorPositionChanged selectionChanged, CursorPositionChanged cursorMoved, ZoomChanged zoomChanged = null, ChartOption option = null ) : void

Enable Zoom and Pan Controls.

Callback are optional (pass in null to ignore).

WARNING: Add or Remove Chart Area or Chart Series after enabled zoom and pan controls may cause unexpected behavior.

Recommended to enable the zoom and pan controls after configure the ChartArea and Series.

GetChartAreaBoundary ( this sender, bool primaryAxis = true ) : RectangleF

Return the entire chart boundary

GetChartToolState ( this sender ) : MSChartExtensionToolState

Get current control state.

GetChartVisibleAreaBoundary ( this sender, bool primaryAxis = true ) : RectangleF

Return chart boundary for visible area.

비공개 메소드들

메소드 설명
ChartAreaHitTest ( object sender, Point, cursorPos ) : ChartArea
ChartContext_ItemClicked ( object sender, ToolStripItemClickedEventArgs, e ) : void
ChartContext_Opening ( object sender, CancelEventArgs, e ) : void
ChartControl_MouseDown ( object sender, MouseEventArgs, e ) : void
ChartControl_MouseMove ( object sender, MouseEventArgs, e ) : void
ChartControl_MouseUp ( object sender, MouseEventArgs, e ) : void
ChartControl_MouseWheel ( object sender, MouseEventArgs e ) : void
GetChartAreaBoundary ( ChartArea sender, bool primaryAxis, bool visibleAreaOnly ) : RectangleF
ScaleViewScroll ( Axis ptrAxis, int delta ) : void
ScaleViewZoom ( Axis ptrAxis, int delta ) : void
SetChartControlState ( Chart sender, MSChartExtensionToolState state ) : void
UpdateChartControlState ( Chart sender ) : void

메소드 상세

AddText() 공개 정적인 메소드

Add text annotation to chart.
public static AddText ( this sender, string text, double x, double y, Drawing, textColor, string name = "", TextStyle, textStyle = TextStyle.Default, ChartArea chartArea = null ) : Annotation,
sender this Source Chart.
text string Text to display.
x double Text box upper left X Coordinate.
y double Text box upper left Y coordinate.
textColor Drawing, Text color.
name string Annotation name.
textStyle TextStyle, Style of text.
chartArea ChartArea Target ChartArea where annotation should be displayed. Default to first ChartArea if not defined.
리턴 Annotation,

ClearPoints() 공개 정적인 메소드

Speed up MSChart data points clear operations.
public static ClearPoints ( this sender ) : void
sender this
리턴 void

Cursor1() 공개 정적인 메소드

Return Cursor 1 Object
public static Cursor1 ( this sender ) : ChartCursor
sender this
리턴 ChartCursor

Cursor2() 공개 정적인 메소드

Return Cursor 2 Object
public static Cursor2 ( this sender ) : ChartCursor
sender this
리턴 ChartCursor

CursorsDiff() 공개 정적인 메소드

Calculate different between Cursor2 and Cursor1 where result = Cursor2 - Cursor1. Return 0 if either cursor is not valid.
public static CursorsDiff ( this sender ) : PointF
sender this
리턴 PointF

DisableZoomAndPanControls() 공개 정적인 메소드

Disable Zoom and Pan Controls
public static DisableZoomAndPanControls ( this sender ) : void
sender this
리턴 void

DrawHorizontalLine() 공개 정적인 메소드

Draw a horizontal line on chart.
public static DrawHorizontalLine ( this sender, double y, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation
sender this Source Chart.
y double YAxis value.
lineColor Drawing Line color.
name string Annotation name.
lineWidth int Line width
lineStyle ChartDashStyle Line style
chartArea ChartArea Target ChartArea where annotation should be displayed. Default to first ChartArea if not defined.
리턴 Annotation

DrawLine() 공개 정적인 메소드

Draw a line on chart.
public static DrawLine ( this sender, double x0, double x1, double y0, double y1, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation
sender this Source Chart.
x0 double First point on XAxis.
x1 double Second piont on XAxis.
y0 double First point on YAxis.
y1 double Second point on YAxis.
lineColor Drawing Outline color.
name string Annotation name.
lineWidth int Line width
lineStyle ChartDashStyle Line style
chartArea ChartArea Target ChartArea where annotation should be displayed. Default to first ChartArea if not defined.
리턴 Annotation

DrawRectangle() 공개 정적인 메소드

Draw a rectangle on chart.
public static DrawRectangle ( this sender, double x, double y, double width, double height, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation
sender this Source Chart.
x double XAxis value
y double YAxis value
width double rectangle width using XAis value.
height double rectangle height using YAis value.
lineColor Drawing Outline color.
name string Annotation name.
lineWidth int Line width
lineStyle ChartDashStyle Line style
chartArea ChartArea Target ChartArea where annotation should be displayed. Default to first ChartArea if not defined.
리턴 Annotation

DrawVerticalLine() 공개 정적인 메소드

Draw a vertical line on chart.
public static DrawVerticalLine ( this sender, double x, Drawing lineColor, string name = "", int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid, ChartArea chartArea = null ) : Annotation
sender this Source Chart.
x double XAxis value.
lineColor Drawing Line color.
name string Annotation name.
lineWidth int Line width
lineStyle ChartDashStyle Line style
chartArea ChartArea Target ChartArea where annotation should be displayed. Default to first ChartArea if not defined.
리턴 Annotation

EnableZoomAndPanControls() 공개 정적인 메소드

Enable Zoom and Pan Controls.
public static EnableZoomAndPanControls ( this sender ) : void
sender this
리턴 void

EnableZoomAndPanControls() 공개 정적인 메소드

Enable Zoom and Pan Controls.

Callback are optional (pass in null to ignore).

WARNING: Add or Remove Chart Area or Chart Series after enabled zoom and pan controls may cause unexpected behavior.

Recommended to enable the zoom and pan controls after configure the ChartArea and Series.

public static EnableZoomAndPanControls ( this sender, CursorPositionChanged selectionChanged, CursorPositionChanged cursorMoved, ZoomChanged zoomChanged = null, ChartOption option = null ) : void
sender this The sender.
selectionChanged CursorPositionChanged Selection changed callabck. Triggered when user select a point with selec tool.
cursorMoved CursorPositionChanged Cursor moved callabck. Triggered when user move the mouse in chart area.
zoomChanged ZoomChanged Callback triggered when chart has /// zoomed in or out (and on first painting of the chart).
option ChartOption Additional user options
리턴 void

GetChartAreaBoundary() 공개 정적인 메소드

Return the entire chart boundary
public static GetChartAreaBoundary ( this sender, bool primaryAxis = true ) : RectangleF
sender this
primaryAxis bool
리턴 RectangleF

GetChartToolState() 공개 정적인 메소드

Get current control state.
public static GetChartToolState ( this sender ) : MSChartExtensionToolState
sender this
리턴 MSChartExtensionToolState

GetChartVisibleAreaBoundary() 공개 정적인 메소드

Return chart boundary for visible area.
public static GetChartVisibleAreaBoundary ( this sender, bool primaryAxis = true ) : RectangleF
sender this
primaryAxis bool
리턴 RectangleF