Dundas Chart for Windows Forms
Add(FinancialMarkerType,Int32,Int32,Int32,Int32,Color,Int32,Color,Font) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > FinancialMarkersCollection Class > Add Method : Add(FinancialMarkerType,Int32,Int32,Int32,Int32,Color,Int32,Color,Font) Method


markerName
The type of financial marker to be displayed.

The type of financial marker to be displayed.


Name of the Financial marker
firstPointIndex

The index (zero-based) of the data point that represents the first price used for the financial marker.


The index (zero-based) of the first data point to be used for a financial marker.
secondPointIndex

The index (zero-based) of the data point that represents the second price used for the financial marker.


The index (zero-based) of the second data point to be used for a financial marker.
firstYIndex

The Y-value index used for the first data point (zero-based). For example, to use the first Y-value specify a value of zero.


The index (zero-based) of the Y value to be used for a financial marker's first data point.
secondYIndex

The Y-value index used for the second data point (zero-based). For example, to use the first Y-value specify a value of zero.


The index (zero-based) of the Y value to be used for a financial marker's second data point.
lineColor

The color of the financial marker lines.


The color used to draw the lines of a financial marker.
lineWidth

The width of the financial marker lines. Measured in pixels.


The width of a financial marker's lines. Measured in pixels.
textColor

The text color of the financial marker labels.


The text color for a financial marker's associated labels.
textFont

The font used for the financial marker labels. When setting this property at run-time a new Font object must be created and assigned to this property.


The font for a financial marker's associated labels.
Enterprise Edition Only Feature. Call this method to display a financial marker for a series. Line properties, text properties and the Y-values used are specified using this definition.
Add Financial Marker item to the collection

Syntax

Visual Basic (Declaration)  
Public Overloads Function Add( _
   ByVal markerName As FinancialMarkerType, _
   ByVal firstPointIndex As Integer, _
   ByVal secondPointIndex As Integer, _
   ByVal firstYIndex As Integer, _
   ByVal secondYIndex As Integer, _
   ByVal lineColor As Color, _
   ByVal lineWidth As Integer, _
   ByVal textColor As Color, _
   ByVal textFont As Font _
) As Integer
Visual Basic (Usage) Copy Code
Dim instance As FinancialMarkersCollection
Dim markerName As FinancialMarkerType
Dim firstPointIndex As Integer
Dim secondPointIndex As Integer
Dim firstYIndex As Integer
Dim secondYIndex As Integer
Dim lineColor As Color
Dim lineWidth As Integer
Dim textColor As Color
Dim textFont As Font
Dim value As Integer
 
value = instance.Add(markerName, firstPointIndex, secondPointIndex, firstYIndex, secondYIndex, lineColor, lineWidth, textColor, textFont)
C#  
public int Add( 
   FinancialMarkerType markerName,
   int firstPointIndex,
   int secondPointIndex,
   int firstYIndex,
   int secondYIndex,
   Color lineColor,
   int lineWidth,
   Color textColor,
   Font textFont
)

Parameters

markerName
The type of financial marker to be displayed.

The type of financial marker to be displayed.


Name of the Financial marker
firstPointIndex

The index (zero-based) of the data point that represents the first price used for the financial marker.


The index (zero-based) of the first data point to be used for a financial marker.
secondPointIndex

The index (zero-based) of the data point that represents the second price used for the financial marker.


The index (zero-based) of the second data point to be used for a financial marker.
firstYIndex

The Y-value index used for the first data point (zero-based). For example, to use the first Y-value specify a value of zero.


The index (zero-based) of the Y value to be used for a financial marker's first data point.
secondYIndex

The Y-value index used for the second data point (zero-based). For example, to use the first Y-value specify a value of zero.


The index (zero-based) of the Y value to be used for a financial marker's second data point.
lineColor

The color of the financial marker lines.


The color used to draw the lines of a financial marker.
lineWidth

The width of the financial marker lines. Measured in pixels.


The width of a financial marker's lines. Measured in pixels.
textColor

The text color of the financial marker labels.


The text color for a financial marker's associated labels.
textFont

The font used for the financial marker labels. When setting this property at run-time a new Font object must be created and assigned to this property.


The font for a financial marker's associated labels.

Return Value

Position in the collection.

Example

This sample code demonstrates how to add Fibonacci Arcs to the chart.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

    ' the 15th point for P1
    Dim firstPointIndex As Integer = 15

    ' the 140th point for P2
    Dim secondPointIndex As Integer = 140

    ' which Y value of P1 to use -- if stock chart, the high
    Dim firstYindex As Integer = 0

    ' which Y value of P2 to use -- if stock chart, the high
    Dim secondYindex As Integer = 0

    ' the line color to use
    Dim lineColor As System.Drawing.Color = Color.Yellow

    ' line width
    Dim lineWidth As Integer = 1

    ' the label color to use
    Dim labelColor As System.Drawing.Color = Color.Black

    ' the label font
    Dim myFont As Font = New Font("Arial",10)

    ' Add the financial marker to the collection
    chart1.Series("Input").FinancialMarkers.Add(FinancialMarkerType.FibonacciArcs, firstPointIndex, secondPointIndex,
        firstYindex, secondYindex, lineColor, lineWidth, labelColor, myFont)

...
C# Copy Code
using Dundas.Charting.WinControl;
...

   
// the 15th point for P1
   
int firstPointIndex = 15;
   
   
// the 140th point for P2
   
int secondPointIndex = 140;
   
   
// which Y value of P1 to use -- if stock chart, the high
   
int firstYindex = 0;
   
   
// which Y value of P2 to use -- if stock chart, the high
   
int secondYindex = 0;
   
   
// the line color to use
   
System.Drawing.Color lineColor = Color.Yellow;
   
   
// line width
   
int lineWidth = 1;
   
   
// the label color to use
   
System.Drawing.Color labelColor = Color.Black;
   
   
// the label font
   
Font myFont = new Font("Arial", 10);
   
   
// Add the financial marker to the collection
   
chart1.Series["Input"].FinancialMarkers.Add(FinancialMarkerType.FibonacciArcs, firstPointIndex, secondPointIndex,
       firstYindex, secondYindex, lineColor, lineWidth, labelColor, myFont);

...

Remarks

Call this method to display a financial marker (a FinancialMarker object is appended at the end of the financial markers collection). Note that the Insert method can also be used (the order in which these objects are stored only determines the order in which they are drawn).

A financial marker graphically compares two prices, which are represented by two data points in a series.

The marker that is displayed is determined by the markerType parameter.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.