Class GraphPane
Class GraphPane encapsulates the graph pane, which is all display elements associated with an individual graph.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class GraphPane : PaneBase, ICloneable, ISerializable
Remarks
This class is the outside "wrapper" for the ZedGraph classes, and provides the interface to access the attributes of the graph. You can have multiple graphs in the same document or form, just instantiate multiple GraphPane's.
Constructors
| Improve this Doc View SourceGraphPane()
Default Constructor. Sets the Rect to (0, 0, 500, 375), and sets the Title and Title values to empty strings.
Declaration
public GraphPane()
GraphPane(RectangleF, String, String, String)
Constructor for the GraphPane object. This routine will initialize all member variables and classes, setting appropriate default values as defined in the GraphPane.Default class.
Declaration
public GraphPane(RectangleF rect, string title, string xTitle, string yTitle)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | A rectangular screen area where the graph is to be displayed. This area can be any size, and can be resize at any time using the Rect property. |
String | title | |
String | xTitle | |
String | yTitle |
GraphPane(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected GraphPane(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
GraphPane(GraphPane)
The Copy Constructor
Declaration
public GraphPane(GraphPane rhs)
Parameters
Type | Name | Description |
---|---|---|
GraphPane | rhs | The GraphPane object from which to copy |
Fields
| Improve this Doc View Sourceschema2
Current schema value that defines the version of the serialized file
Declaration
public const int schema2 = 11
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBarSettings
Gets the BarSettings instance for this GraphPane, which stores the global properties for bar type charts.
Declaration
public BarSettings BarSettings { get; }
Property Value
Type | Description |
---|---|
BarSettings |
Chart
Declaration
public Chart Chart { get; }
Property Value
Type | Description |
---|---|
Chart |
CurveList
Declaration
public CurveList CurveList { get; set; }
Property Value
Type | Description |
---|---|
CurveList | A reference to a CurveList collection object |
IsAlignGrids
Gets or sets a value that determines if ZedGraph should modify the scale ranges for the Y and Y2 axes such that the number of major steps, and therefore the major grid lines, line up.
Declaration
public bool IsAlignGrids { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This property affects the way that AxisChange() selects the scale
ranges for the Y and Y2 axes. It applies to the scale ranges of all Y and Y2 axes,
but only if the MaxAuto is set to true.
IsBoundedRanges
Gets or sets a boolean value that determines if the auto-scaled axis ranges will subset the data points based on any manually set scale range values.
Declaration
public bool IsBoundedRanges { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
The bounds provide a means to subset the data. For example, if all the axes are set to autoscale, then the full range of data are used. But, if the XAxis.Min and XAxis.Max values are manually set, then the Y data range will reflect the Y values within the bounds of XAxis.Min and XAxis.Max. Set to true to subset the data, or false to always include all data points when calculating scale ranges.
IsIgnoreInitial
Gets or sets a boolean value that affects the data range that is considered for the automatic scale ranging.
Declaration
[Bindable(true)]
[Browsable(true)]
public bool IsIgnoreInitial { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
If true, then initial data points where the Y value is zero are not included when automatically determining the scale Min, Max, and MajorStep size. All data after the first non-zero Y value are included.
See Also
| Improve this Doc View SourceIsIgnoreMissing
Gets or sets a value that determines whether or not initial Missing values will cause the line segments of a curve to be discontinuous.
Declaration
public bool IsIgnoreMissing { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
If this field is true, then the curves will be plotted as continuous lines as if the Missing values did not exist. Use the public property IsIgnoreMissing to access this value.
IsZoomed
Gets a value that indicates whether or not the ZoomStateStack for
this GraphPane is empty. Note that this value is only used for
the
Declaration
public bool IsZoomed { get; }
Property Value
Type | Description |
---|---|
Boolean |
LineType
Determines how the LineItem graphs will be displayed. See the LineType enum for the individual types available.
Declaration
public LineType LineType { get; set; }
Property Value
Type | Description |
---|---|
LineType |
See Also
| Improve this Doc View SourceX2Axis
Accesses the X2Axis for this graph
Declaration
public X2Axis X2Axis { get; }
Property Value
Type | Description |
---|---|
X2Axis | A reference to a X2Axis object |
XAxis
Accesses the XAxis for this graph
Declaration
public XAxis XAxis { get; }
Property Value
Type | Description |
---|---|
XAxis | A reference to a XAxis object |
Y2Axis
Accesses the primary Y2Axis for this graph
Declaration
public Y2Axis Y2Axis { get; }
Property Value
Type | Description |
---|---|
Y2Axis | A reference to a Y2Axis object |
See Also
| Improve this Doc View SourceY2AxisList
Gets the collection of Y2 axes that belong to this GraphPane.
Declaration
public Y2AxisList Y2AxisList { get; }
Property Value
Type | Description |
---|---|
Y2AxisList |
YAxis
Accesses the primary YAxis for this graph
Declaration
public YAxis YAxis { get; }
Property Value
Type | Description |
---|---|
YAxis | A reference to a YAxis object |
See Also
| Improve this Doc View SourceYAxisList
Gets the collection of Y axes that belong to this GraphPane.
Declaration
public YAxisList YAxisList { get; }
Property Value
Type | Description |
---|---|
YAxisList |
ZoomStack
Gets a reference to the ZoomStateStack for this GraphPane.
Declaration
public ZoomStateStack ZoomStack { get; }
Property Value
Type | Description |
---|---|
ZoomStateStack |
Methods
| Improve this Doc View SourceAddBar(String, Double[], Double[], Color)
Add a bar type curve (CurveItem object) to the plot with the given data points (double arrays) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public BarItem AddBar(string label, double[] x, double[] y, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Color | color | The color to used for the bars |
Returns
Type | Description |
---|---|
BarItem | A CurveItem class for the newly created bar curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddBar(String, Double[], Double[], Color) method. |
AddBar(String, IPointList, Color)
Add a bar type curve (CurveItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public BarItem AddBar(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used to fill the bars |
Returns
Type | Description |
---|---|
BarItem | A CurveItem class for the newly created bar curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddBar(String, IPointList, Color) method. |
AddCurve(String, Double[], Double[], Color)
Add a curve (CurveItem object) to the plot with the given data points (double arrays) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public LineItem AddCurve(string label, double[] x, double[] y, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
LineItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddCurve(String, Double[], Double[], Color) method. |
AddCurve(String, Double[], Double[], Color, SymbolType)
Add a curve (CurveItem object) to the plot with the given data points (double arrays) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public LineItem AddCurve(string label, double[] x, double[] y, Color color, SymbolType symbolType)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Color | color | The color to used for the curve line, symbols, etc. |
SymbolType | symbolType | A symbol type (SymbolType) that will be used for this curve. |
Returns
Type | Description |
---|---|
LineItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddCurve(String, Double[], Double[], Color, SymbolType) method. |
AddCurve(String, IPointList, Color)
Add a curve (CurveItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public LineItem AddCurve(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
LineItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddCurve(String, IPointList, Color) method. |
AddCurve(String, IPointList, Color, SymbolType)
Add a curve (CurveItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public LineItem AddCurve(string label, IPointList points, Color color, SymbolType symbolType)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used for the curve line, symbols, etc. |
SymbolType | symbolType | A symbol type (SymbolType) that will be used for this curve. |
Returns
Type | Description |
---|---|
LineItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddCurve(String, IPointList, Color, SymbolType) method. |
AddErrorBar(String, Double[], Double[], Double[], Color)
Add an error bar set (ErrorBarItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public ErrorBarItem AddErrorBar(string label, double[] x, double[] y, double[] baseValue, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Double[] | baseValue | An array of double precision values that define the base value (the bottom) of the bars for this curve. |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
ErrorBarItem | An ErrorBarItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddErrorBar(String, IPointList, Color) method. |
AddErrorBar(String, IPointList, Color)
Add an error bar set (ErrorBarItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public ErrorBarItem AddErrorBar(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
ErrorBarItem | An ErrorBarItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddErrorBar(String, IPointList, Color) method. |
AddHiLowBar(String, Double[], Double[], Double[], Color)
Add a "High-Low" bar type curve (HiLowBarItem object) to the plot with the given data points (double arrays) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public HiLowBarItem AddHiLowBar(string label, double[] x, double[] y, double[] baseVal, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Double[] | baseVal | An array of double precision values that define the base value (the bottom) of the bars for this curve. |
Color | color | The color to used for the bars |
Returns
Type | Description |
---|---|
HiLowBarItem | A HiLowBarItem class for the newly created bar curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddHiLowBar(String, Double[], Double[], Double[], Color) method. |
AddHiLowBar(String, IPointList, Color)
Add a hi-low bar type curve (CurveItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public HiLowBarItem AddHiLowBar(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value Trio's that define the X, Y, and lower dependent values for this curve |
Color | color | The color to used to fill the bars |
Returns
Type | Description |
---|---|
HiLowBarItem | A HiLowBarItem class for the newly created bar curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddHiLowBar(String, IPointList, Color) method. |
AddJapaneseCandleStick(String, IPointList)
Add a japanesecandlestick graph (JapaneseCandleStickItem object) to the plot with the given data points (IPointList) and properties.
Declaration
public JapaneseCandleStickItem AddJapaneseCandleStick(string label, IPointList points)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Returns
Type | Description |
---|---|
JapaneseCandleStickItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddJapaneseCandleStick(String, IPointList) method. |
Remarks
This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method. Note that the IPointList should contain StockPt objects instead of PointPair objects in order to contain all the data values required for this curve type.
AddOHLCBar(String, IPointList, Color)
Add a candlestick graph (OHLCBarItem object) to the plot with the given data points (IPointList) and properties.
Declaration
public OHLCBarItem AddOHLCBar(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
OHLCBarItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddOHLCBar(String, IPointList, Color) method. |
Remarks
This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method. Note that the IPointList should contain StockPt objects instead of PointPair objects in order to contain all the data values required for this curve type.
AddPieSlice(Double, Color, Double, String)
Add a PieItem to the display.
Declaration
public PieItem AddPieSlice(double value, Color color, double displacement, string label)
Parameters
Type | Name | Description |
---|---|---|
Double | value | The value associated with this PieItemitem. |
Color | color | The display color for this PieItemitem. |
Double | displacement | The amount this PieItemitem will be displaced from the center of the PieItem. |
String | label | Text label for this PieItem |
Returns
Type | Description |
---|---|
PieItem | a reference to the PieItem constructed |
AddPieSlice(Double, Color, Color, Single, Double, String)
Add a PieItem to the display, providing a gradient fill for the pie color.
Declaration
public PieItem AddPieSlice(double value, Color color1, Color color2, float fillAngle, double displacement, string label)
Parameters
Type | Name | Description |
---|---|---|
Double | value | The value associated with this PieItem instance. |
Color | color1 | The starting display color for the gradient Fill for this PieItem instance. |
Color | color2 | The ending display color for the gradient Fill for this PieItem instance. |
Single | fillAngle | The angle for the gradient Fill. |
Double | displacement | The amount this PieItem instance will be displaced from the center point. |
String | label | Text label for this PieItem instance. |
Returns
Type | Description |
---|---|
PieItem |
AddPieSlices(Double[], String[])
Creates all the PieItems for a single Pie Chart.
Declaration
public PieItem[] AddPieSlices(double[] values, string[] labels)
Parameters
Type | Name | Description |
---|---|---|
Double[] | values | double array containing all Values for a single PieChart. |
String[] | labels | string array containing all Labels for a single PieChart. |
Returns
Type | Description |
---|---|
PieItem[] | an array containing references to all PieItems comprising the Pie Chart. |
AddStick(String, Double[], Double[], Color)
Add a stick graph (StickItem object) to the plot with the given data points (double arrays) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public StickItem AddStick(string label, double[] x, double[] y, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
Double[] | x | An array of double precision X values (the independent values) that define the curve. |
Double[] | y | An array of double precision Y values (the dependent values) that define the curve. |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
StickItem | A StickItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddStick(String, Double[], Double[], Color) method. |
AddStick(String, IPointList, Color)
Add a stick graph (StickItem object) to the plot with the given data points (IPointList) and properties. This is simplified way to add curves without knowledge of the CurveList class. An alternative is to use the CurveList Add() method.
Declaration
public StickItem AddStick(string label, IPointList points, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | label | The text label (string) for the curve that will be used as a Legend entry. |
IPointList | points | A IPointList of double precision value pairs that define the X and Y values for this curve |
Color | color | The color to used for the curve line, symbols, etc. |
Returns
Type | Description |
---|---|
StickItem | A CurveItem class for the newly created curve. This can then be used to access all of the curve properties that are not defined as arguments to the AddStick(String, IPointList, Color) method. |
AddY2Axis(String)
Add a secondary Y2Axis (right side) to the list of axes in the Graph.
Declaration
public int AddY2Axis(string title)
Parameters
Type | Name | Description |
---|---|---|
String | title | The title for the Y2Axis. |
Returns
Type | Description |
---|---|
Int32 | the ordinal position (index) in the Y2AxisList. |
Remarks
Note that the primary Y2Axis is always included by default. This method turns off the MajorTic and MinorTic IsOpposite and IsInside properties by default.
AddYAxis(String)
Add a secondary YAxis (left side) to the list of axes in the Graph.
Declaration
public int AddYAxis(string title)
Parameters
Type | Name | Description |
---|---|---|
String | title | The title for the YAxis. |
Returns
Type | Description |
---|---|
Int32 | the ordinal position (index) in the YAxisList. |
Remarks
Note that the primary YAxis is always included by default. This method turns off the MajorTic and MinorTic IsOpposite and IsInside properties by default.
AxisChange()
AxisChange causes the axes scale ranges to be recalculated based on the current data range.
Declaration
public void AxisChange()
Remarks
There is no obligation to call AxisChange() for manually scaled axes. AxisChange() is only
intended to handle auto scaling operations. Call this function anytime you change, add, or
remove curve data to insure that the scale range of the axes are appropriate for the data range.
This method calculates
a scale minimum, maximum, and step size for each axis based on the current curve data.
Only the axis attributes (min, max, step) that are set to auto-range
(MinAuto, MaxAuto, MajorStepAuto)
will be modified. You must call
This overload of AxisChange just uses a throw-away bitmap as Graphics.
If you have a Graphics instance available from your Windows Form, you should use
the AxisChange(Graphics) overload instead.
AxisChange(Graphics)
AxisChange causes the axes scale ranges to be recalculated based on the current data range.
Declaration
public void AxisChange(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Remarks
There is no obligation to call AxisChange() for manually scaled axes. AxisChange() is only
intended to handle auto scaling operations. Call this function anytime you change, add, or
remove curve data to insure that the scale range of the axes are appropriate for the data range.
This method calculates
a scale minimum, maximum, and step size for each axis based on the current curve data.
Only the axis attributes (min, max, step) that are set to auto-range
(MinAuto, MaxAuto, MajorStepAuto)
will be modified. You must call
CalcChartRect(Graphics)
Declaration
public RectangleF CalcChartRect(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Returns
Type | Description |
---|---|
RectangleF | The calculated chart rect, in pixel coordinates. |
Remarks
The ChartRect is the plot area bounded by the axes, and the rect is the total area as specified by the client application.
CalcChartRect(Graphics, Single)
Declaration
public RectangleF CalcChartRect(Graphics g, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Single | scaleFactor | The scaling factor for the features of the graph based on the BaseDimension. This scaling factor is calculated by the CalcScaleFactor() method. The scale factor represents a linear multiple to be applied to font sizes, symbol sizes, etc. |
Returns
Type | Description |
---|---|
RectangleF | The calculated chart rect, in pixel coordinates. |
Remarks
The ChartRect is the plot area bounded by the axes, and the rect is the total area as specified by the client application.
Clone()
Typesafe, deep-copy clone method.
Declaration
public GraphPane Clone()
Returns
Type | Description |
---|---|
GraphPane | A new, independent copy of this class |
Draw(Graphics)
Draw all elements in the GraphPane to the specified graphics device.
Declaration
public override void Draw(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Overrides
Remarks
This method should be part of the Paint() update process. Calling this routine will redraw all features of the graph. No preparation is required other than an instantiated GraphPane object.
FindContainedObjects(RectangleF, Graphics, out CurveList)
Find any objects that exist within the specified (screen) rectangle. This method will search through all of the graph objects, such as Axis, Legend, Title, GraphObj, and CurveItem. and see if the objects' bounding boxes are within the specified (screen) rectangle This method returns true if any are found.
Declaration
public bool FindContainedObjects(RectangleF rectF, Graphics g, out CurveList containedObjs)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectF | |
Graphics | g | |
CurveList | containedObjs |
Returns
Type | Description |
---|---|
Boolean |
FindLinkableObject(PointF, Graphics, Single, out Object, out Link, out Int32)
Search through the GraphObjList and CurveList for items that contain active Link objects.
Declaration
public bool FindLinkableObject(PointF mousePt, Graphics g, float scaleFactor, out object source, out Link link, out int index)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The mouse location where the click occurred |
Graphics | g | An appropriate Graphics instance |
Single | scaleFactor | The current scaling factor for drawing operations. |
Object | source | The clickable object that was found. Typically a type of GraphObj or a type of CurveItem. |
Link | link | The Link instance that is contained within
the |
Int32 | index | An index value, indicating which point was clicked for CurveItem type objects. |
Returns
Type | Description |
---|---|
Boolean | returns true if a clickable link was found under the
|
FindNearestObject(PointF, Graphics, out Object, out Int32)
Find the object that lies closest to the specified mouse (screen) point.
Declaration
public bool FindNearestObject(PointF mousePt, Graphics g, out object nearestObj, out int index)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Object | nearestObj | A reference to the nearest object to the specified screen point. This can be any of Axis, Legend, Title, TextObj, ArrowObj, or CurveItem. Note: If the pane title is selected, then the GraphPane object will be returned. |
Int32 | index | The index number of the item within the selected object
(where applicable). For example, for a CurveItem object,
|
Returns
Type | Description |
---|---|
Boolean | true if an object was found, false otherwise. |
Remarks
This method will search through all of the graph objects, such as
Axis, Legend, Title,
GraphObj, and CurveItem.
If the mouse point is within the bounding box of the items (or in the case
of ArrowObj and CurveItem, within
NearestTol pixels), then the object will be returned.
You must check the type of the object to determine what object was
selected (for example, "if ( object is Legend ) ..."). The
See Also
| Improve this Doc View SourceFindNearestPoint(PointF, CurveItem, out CurveItem, out Int32)
Find the data point that lies closest to the specified mouse (screen) point for the specified curve.
Declaration
public bool FindNearestPoint(PointF mousePt, CurveItem targetCurve, out CurveItem nearestCurve, out int iNearest)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
CurveItem | targetCurve | A CurveItem object containing the data points to be searched. |
CurveItem | nearestCurve | A reference to the CurveItem instance that contains the closest point. nearestCurve will be null if no data points are available. |
Int32 | iNearest | The index number of the closest point. The actual data vpoint will then be Points . iNearest will be -1 if no data points are available. |
Returns
Type | Description |
---|---|
Boolean | true if a point was found and that point lies within NearestTol pixels of the screen point, false otherwise. |
Remarks
This method will search only through the points for the specified curve to determine which point is nearest the mouse point. It will only consider points that are within NearestTol pixels of the screen point.
FindNearestPoint(PointF, out CurveItem, out Int32)
Find the data point that lies closest to the specified mouse (screen) point.
Declaration
public bool FindNearestPoint(PointF mousePt, out CurveItem nearestCurve, out int iNearest)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
CurveItem | nearestCurve | A reference to the CurveItem instance that contains the closest point. nearestCurve will be null if no data points are available. |
Int32 | iNearest | The index number of the closest point. The actual data vpoint will then be Points . iNearest will be -1 if no data points are available. |
Returns
Type | Description |
---|---|
Boolean | true if a point was found and that point lies within NearestTol pixels of the screen point, false otherwise. |
Remarks
This method will search through all curves in CurveList to find which point is nearest. It will only consider points that are within NearestTol pixels of the screen point.
FindNearestPoint(PointF, CurveList, out CurveItem, out Int32)
Find the data point that lies closest to the specified mouse (screen) point.
Declaration
public bool FindNearestPoint(PointF mousePt, CurveList targetCurveList, out CurveItem nearestCurve, out int iNearest)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
CurveList | targetCurveList | A CurveList object containing a subset of CurveItem's to be searched. |
CurveItem | nearestCurve | A reference to the CurveItem instance that contains the closest point. nearestCurve will be null if no data points are available. |
Int32 | iNearest | The index number of the closest point. The actual data vpoint will then be Points . iNearest will be -1 if no data points are available. |
Returns
Type | Description |
---|---|
Boolean | true if a point was found and that point lies within NearestTol pixels of the screen point, false otherwise. |
Remarks
This method will search through the specified list of curves to find which point is
nearest. It will only consider points that are within
NearestTol pixels of the screen point, and it will
only consider CurveItem's that are in
targetCurveList
.
GeneralTransform(Double, Double, CoordType)
Transform a data point from the specified coordinate type (CoordType) to screen coordinates (pixels).
Declaration
public PointF GeneralTransform(double x, double y, CoordType coord)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The x coordinate that defines the location in user space |
Double | y | The y coordinate that defines the location in user space |
CoordType | coord | A CoordType type that defines the coordinate system in which the X,Y pair is defined. |
Returns
Type | Description |
---|---|
PointF | A point in screen coordinates that corresponds to the specified user point. |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto). Note that this method is more accurate than the GeneralTransform(PointF, CoordType) overload, since it uses double types. This would typically only be significant for Date coordinates.
GeneralTransform(PointF, CoordType)
Transform a data point from the specified coordinate type (CoordType) to screen coordinates (pixels).
Declaration
public PointF GeneralTransform(PointF ptF, CoordType coord)
Parameters
Type | Name | Description |
---|---|---|
PointF | ptF | The X,Y pair that defines the point in user coordinates. |
CoordType | coord | A CoordType type that defines the coordinate system in which the X,Y pair is defined. |
Returns
Type | Description |
---|---|
PointF | A point in screen coordinates that corresponds to the specified user point. |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto).
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo instance with the data needed to serialize the target object
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
Overrides
| Improve this Doc View SourceReverseTransform(PointF, Boolean, Boolean, Int32, out Double, out Double)
Return the user scale values that correspond to the specified screen coordinate position (pixels).
Declaration
public void ReverseTransform(PointF ptF, bool isX2Axis, bool isY2Axis, int yAxisIndex, out double x, out double y)
Parameters
Type | Name | Description |
---|---|---|
PointF | ptF | The X,Y pair that defines the screen coordinate point of interest |
Boolean | isX2Axis | true to return data that corresponds to an X2Axis, false for an XAxis. |
Boolean | isY2Axis | true to return data that corresponds to a Y2Axis, false for a YAxis. |
Int32 | yAxisIndex | The ordinal index of the Y or Y2 axis from which to return data (see YAxisList, Y2AxisList) |
Double | x | The resultant value in user coordinates from the XAxis |
Double | y | The resultant value in user coordinates from the primary YAxis |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto).
ReverseTransform(PointF, out Double, out Double)
Return the user scale values that correspond to the specified screen coordinate position (pixels). This overload assumes the default XAxis and YAxis.
Declaration
public void ReverseTransform(PointF ptF, out double x, out double y)
Parameters
Type | Name | Description |
---|---|---|
PointF | ptF | The X,Y pair that defines the screen coordinate point of interest |
Double | x | The resultant value in user coordinates from the XAxis |
Double | y | The resultant value in user coordinates from the primary YAxis |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto).
ReverseTransform(PointF, out Double, out Double, out Double, out Double)
Return the user scale values that correspond to the specified screen coordinate position (pixels).
Declaration
public void ReverseTransform(PointF ptF, out double x, out double x2, out double y, out double y2)
Parameters
Type | Name | Description |
---|---|---|
PointF | ptF | The X,Y pair that defines the screen coordinate point of interest |
Double | x | The resultant value in user coordinates from the XAxis |
Double | x2 | The resultant value in user coordinates from the X2Axis |
Double | y | The resultant value in user coordinates from the primary YAxis |
Double | y2 | The resultant value in user coordinates from the primary Y2Axis |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto).
ReverseTransform(PointF, out Double, out Double, out Double[], out Double[])
Return the user scale values that correspond to the specified screen coordinate position (pixels) for all y axes.
Declaration
public void ReverseTransform(PointF ptF, out double x, out double x2, out double[] y, out double[] y2)
Parameters
Type | Name | Description |
---|---|---|
PointF | ptF | The X,Y pair that defines the screen coordinate point of interest |
Double | x | The resultant value in user coordinates from the XAxis |
Double | x2 | The resultant value in user coordinates from the X2Axis |
Double[] | y | An array of resultant values in user coordinates from the list of YAxis instances. This method allocates the array for you, according to the number of YAxis objects in the list. |
Double[] | y2 | An array of resultant values in user coordinates from the list of Y2Axis instances. This method allocates the array for you, according to the number of Y2Axis objects in the list. |
Remarks
This method implicitly assumes that Rect has already been calculated via AxisChange() or Draw(Graphics) methods, or the Rect is set manually (see IsRectAuto).
SetMinSpaceBuffer(Graphics, Single, Boolean)
Declaration
public void SetMinSpaceBuffer(Graphics g, float bufferFraction, bool isGrowOnly)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Single | bufferFraction | The amount of space to allocate for the axis, expressed as a fraction of the currently required space. For example, a value of 1.2 would allow for 20% extra above the currently required space. |
Boolean | isGrowOnly | If true, then this method will only modify the MinSpace property if the calculated result is more than the current value. |
Remarks
The MinSpace is calculated using the currently required space multiplied by a fraction (). The currently required space is calculated using CalcSpace(Graphics, GraphPane, Single, out Single), and is based on current data ranges, font sizes, etc. The "space" is actually the amount of space required to fit the tic marks, scale labels, and axis title. The calculation is done by calling the SetMinSpaceBuffer(Graphics, GraphPane, Single, Boolean) method for each Axis.
Events
| Improve this Doc View SourceAxisChangeEvent
Subscribe to this event to be notified when AxisChange() is called.
Declaration
public event GraphPane.AxisChangeEventHandler AxisChangeEvent
Event Type
Type | Description |
---|---|
GraphPane.AxisChangeEventHandler |
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |