AnnotateBar for ChartPane other than PricePane?
Author: mkbryan
Creation Date: 4/10/2016 2:08 AM
profile picture

mkbryan

#1
Gents,

AnnotateBar does a good job of adjusting the text position when aboveBar is true when annotating bars on the PricePane. However, AnnotateChart only has a level parameter, which when set to the High of a bar, results in text being draw starting at the high and then down. It seems that the upper left corner of the text is effectively at (bar,level).

Is there a code snippet that can adjust the AnnotateChart level parameter such that the bottom of the text appears as if AnnotateBar was used on the AnnotateChart pane parameter. Imagine there's a function AnnotateBar(ChartPane pane, string text, int bar, bool aboveBar, System.Drawing.Color color). It would provide the desired behavior.

Thanks.

~Marc
profile picture

Eugene

#2
Marc,

Here is AnnotateBar2 with the PricePane parameter (using undocumented and unsupported code) for you:

CODE:
Please log in to see this code.


Note that a DataSeries must be plotted in the pane you're annotating or the annotation won't be visible.
profile picture

mkbryan

#3
Much appreciated. I'll give it shot. Thanks.
profile picture

mkbryan

#4
It works well. Thanks.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).