C# Класс MSChartExtension, MSChartExtension

Extension class for MSChart
Показать файл Открыть проект

Открытые методы

Метод Описание
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