Support Board
Date/Time: Wed, 07 Jan 2026 02:09:19 +0000
[Programming Help] - Z-Index
View Count: 173
| [2025-11-21 16:37:52] |
| User213910 - Posts: 26 |
|
Hi Sierra Chart team, I have two studies that use the sc.UseTool function to draw something. One draws a large text and uses: Tool.DrawingType = DRAWING_STATIONARY_TEXT; The other uses: Tool.DrawingType = DRAWING_LINE; Both set Tool.DrawUnderneathMainGraph = true; The problem: The line is always drawn underneath the text, regardless of the order of the studies, and the option in the Study window "Draw Study Underneath Main Price Graph" makes no difference. How can I change the "Z-Index" so that the line is drawn above the text? |
| [2025-11-24 17:26:29] |
| Sierra_Chart Engineering - Posts: 22211 |
|
We need to see the complete code. Are these set to be user drawn drawings? How is the Date-Time for these set.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
| [2025-11-29 17:22:56] |
| User213910 - Posts: 26 |
|
I figured it out. I had to set both studies to the same PREC_LEVEL value. SCSF Export scsf_DrawTEST1(SCStudyInterfaceRef sc) { // Section 1 - Set the configuration variables and defaults if (sc.SetDefaults) { sc.GraphName = "Draw TEST1"; sc.GraphRegion = 0; sc.DrawStudyUnderneathMainPriceGraph = 1; sc.ScaleRangeType = SCALE_SAMEASREGION; sc.CalculationPrecedence = VERY_LOW_PREC_LEVEL; sc.AutoLoop = 0; return; } // Section 2 - Do data processing here s_UseTool ChartText; ChartText.ChartNumber = sc.ChartNumber; ChartText.LineNumber = 2; ChartText.DrawingType = DRAWING_STATIONARY_TEXT; ChartText.UseRelativeVerticalValues = true; ChartText.BeginDateTime = 75; ChartText.BeginValue = 50; ChartText.DrawUnderneathMainGraph = true; ChartText.FontBold = true; ChartText.FontSize = 100; ChartText.TextAlignment = DT_CENTER | DT_VCENTER; ChartText.Color = RGB(128,128,128); ChartText.Text = "TEST"; sc.UseTool(ChartText); } SCSFExport scsf_DrawTEST2(SCStudyInterfaceRef sc) { // Section 1 - Set the configuration variables and defaults if (sc.SetDefaults) { sc.GraphName = "Draw TEST2"; sc.GraphRegion = 0; sc.DrawStudyUnderneathMainPriceGraph = 1; sc.ScaleRangeType = SCALE_SAMEASREGION; //sc.CalculationPrecedence = VERY_LOW_PREC_LEVEL; sc.AutoLoop = 0; return; } // Section 2 - Do data processing here s_UseTool Line; Line.ChartNumber = sc.ChartNumber; Line.LineNumber = 1; Line.DrawingType = DRAWING_LINE; Line.BeginIndex = sc.IndexOfFirstVisibleBar; Line.BeginValue = sc.Open[sc.IndexOfFirstVisibleBar]; Line.EndIndex = sc.IndexOfLastVisibleBar; Line.EndValue = sc.Close[sc.IndexOfLastVisibleBar]; Line.DrawUnderneathMainGraph = true; Line.LineStyle = LINESTYLE_SOLID; Line.LineWidth = 10; Line.Color = RGB(255,0,0); sc.UseTool(Line); } |
To post a message in this thread, you need to log in with your Sierra Chart account:
