CopyDataValues()

View as Markdown

Definition

Copies the ChartAnchor time and price values from one anchor to another. This includes the BarsAgo, SlotIndex, Time, Price, and DrawnOnBar values. This method is useful for updating a chart anchor to a recent data point when the user interacts with the drawing chart anchor.

Method Return Value

This method does not return a value.

Syntax

\<chartanchor\>.CopyDataValues(ChartAnchor toAnchor)

Method Parameters

ParameterDescription
toAnchorThe ChartAnchor to copy

Examples

1public override void OnMouseMove(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
2{
3 // if the user is moving the draw object, copy the most recent dataPoint to MyAnchor
4 if (DrawingState == DrawingState.Moving)
5 dataPoint.CopyDataValues(Anchor);