Greetings,
I have an application that draws 2 lines of text above certain bars. The first line can be drawn a tick or two above the high, bottom-aligned, that is, the bottom of the text is aligned with the tick value that is 2 ticks above the high. The problem is to figure out the y value of where to draw the 2nd line of text which should reside just on top of the first line of text. If the pixel height of the first line of text, was, say, 15 pixels, then I would want to draw the text perhaps 5 pixels above the top of the first line of text. But drawtext functions don't work with pixel relative values for y coordinates; rather they work with y values which are a function of the symbol on the chart. This application needs to work with any arbitrary symbol. The problem is further complicated because the user can 'scrunch' the y axis of the chart, compressing the two lines of text such that they overlap.
I have developed a scaling algorithm that seems to work ok, but is far from a foolproof method. Am I missing the boat here? Is there an easy way to do this that I have overlooked?
Tx,
Scott
I have an application that draws 2 lines of text above certain bars. The first line can be drawn a tick or two above the high, bottom-aligned, that is, the bottom of the text is aligned with the tick value that is 2 ticks above the high. The problem is to figure out the y value of where to draw the 2nd line of text which should reside just on top of the first line of text. If the pixel height of the first line of text, was, say, 15 pixels, then I would want to draw the text perhaps 5 pixels above the top of the first line of text. But drawtext functions don't work with pixel relative values for y coordinates; rather they work with y values which are a function of the symbol on the chart. This application needs to work with any arbitrary symbol. The problem is further complicated because the user can 'scrunch' the y axis of the chart, compressing the two lines of text such that they overlap.
I have developed a scaling algorithm that seems to work ok, but is far from a foolproof method. Am I missing the boat here? Is there an easy way to do this that I have overlooked?
Tx,
Scott
Comment