Login Page - Create Account

Support Board


Date/Time: Tue, 16 Sep 2025 04:00:45 +0000



[Programming Help] - Text Won't Display

View Count: 766

[2021-12-03 17:18:05]
maxpi - Posts: 188
The log indicates that the code runs to place text on the chart but it never appears.

sc.AddMessageToLog("=============GETS HERE=============", 0);
    
//TEXT VALUE ON CHART
s_UseTool Tool;
Tool.Clear();
Tool.Region     =0;
Tool.ChartNumber   = sc.ChartNumber;
Tool.DrawingType  = DRAWING_STATIONARY_TEXT;
Tool.LineNumber   = 12348;
Tool.BeginDateTime   = 38;
Tool.BeginValue   = 80;
Tool.Color     = COLOR_YELLOW;
Tool.Text     ="HELLO W... ";
Tool.FontSize     = 40;
Tool.AddMethod     = UTAM_ADD_OR_ADJUST;
sc.UseTool(Tool);
[2021-12-03 18:24:19]
JohnR - User831573 - Posts: 333
One possibility is the Tool.BeginValue. Is 80, within the screen range? Or, did you intend for it to be a 0 - 100 range percentage.? If the percentage, then you also need this line of code.

If UseRelativeVerticalValues is set to 1 or a nonzero value, then BeginValue is a value relative to the Chart Region itself completely independent of the scale used for the graphs in the Chart Region. It is a percentage. Where 1 = 1%. The entire height of the Chart Region is 100%. 0 = The bottom of the Chart Region. 100 = The top of the Chart Region. These values apply to the Chart Region and not the entire height of the chart window unless there is only a single Chart Region displayed.

JohnR
[2021-12-03 19:26:06]
maxpi - Posts: 188
I thought that the drawing type DRAWING_STATIONARY_TEXT didn't need the statement UseRelativeVerticalValues... It seems to be working that way elsewhere...
[2021-12-03 19:31:29]
maxpi - Posts: 188
That did fix it, thanks

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account