Support Board
Date/Time: Fri, 14 Nov 2025 02:04:06 +0000
[User Discussion] - Help drawing text in a Chart Region
View Count: 92
| [2025-10-30 18:31:30] |
| User48838 - Posts: 128 |
|
i thought this would be easy but this code isnt drawing text, if you could help i would appreciate it, ty #include "sierrachart.h" SCDLLName("Print Simple Text Demo") SCSFExport scsf_PrintSimpleText(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.GraphName = "Print Simple Text Demo"; sc.GraphRegion = 1; sc.AutoLoop = 0; return; } s_UseTool Tool; Tool.Clear(); Tool.ChartNumber = sc.ChartNumber; Tool.DrawingType = DRAWING_TEXT; Tool.AddMethod = UTAM_ADD_OR_ADJUST; Tool.LineNumber = 1; Tool.Region = 1; Tool.BeginIndex = sc.IndexOfFirstVisibleBar + 3; // Adjust as needed Tool.UseRelativeVerticalValues = 1; Tool.BeginValue = 60; // % from bottom of chart (0 = bottom, 100 = top) Tool.FontSize = 16; Tool.FontBold = true; Tool.Color = RGB(0,255,255); // Cyan SCString label; label = "x=5"; Tool.Text = label; sc.UseTool(Tool); } |
| [2025-10-30 19:05:54] |
| User719512 - Posts: 331 |
|
I might start from the sample scsf_UseToolExampleDrawingText30BarsBack in studies.cpp. Then make changes for your specific use case. Additionally, start with any of the other samples that have Tool.DrawingType = DRAWING_TEXT; in them.
|
To post a message in this thread, you need to log in with your Sierra Chart account:
