Support Board
Date/Time: Sun, 01 Mar 2026 22:15:35 +0000
[Programming Help] - [ACSIL Help] - Removing 'sticky' labels when using Subgraphs_Name_and_Value_Labels_Only
View Count: 11
| [2026-03-01 15:24:34] |
| GrowingTomatoes - Posts: 3 |
|
Hi Team, I've been digging through docs and support boards and have not found a solution, so I am posting here. I'm looking for a way to display a Subgraph Name Label ONLY on the lastVisibleIndex and remove old 'sticky' labels that remain visible next to the most recent index that drew the label. This is similar in functionality to the ColorBar Based on Alert Condition study when using DRAWSTYLE_SUBGRAPH_NAME_AND_VALUE_LABELS_ONLY. I've been able to workaround it once before using the following logic, but this doesn't seem the most efficient way to achieve the result. if (sc.Index == sc.ArraySize - 1) { if (sg_Score[sc.IndexOfLastVisibleBar] != 0) { sg_Tag.DrawStyle = DRAWSTYLE_SUBGRAPH_NAME_AND_VALUE_LABELS_ONLY; } else { sg_Tag.DrawStyle = DRAWSTYLE_IGNORE; } } New to ACSIL, so I recognize that the persistence may be a feature not a bug and inherent in the way I'm writing the code, so I've included the block below that populates the subgraph array: // Calculations logic... sg_Score[sc.Index] = CurrentScore; if (sc.HideStudy) return; // Stop here if hidden. if (CurrentScore != 0) { sg_Tag[sc.Index] = NISS_Array[sc.Index]; // Place Name Label at defined array value sg_Tag.DataColor[sc.Index] = (CurrentScore > 0) ? sg_Tag.PrimaryColor : sg_Tag.SecondaryColor; // Color Name Label } else { sg_Tag[sc.Index] = 0; } I've attached a couple screenshots for reference of what the 'sticky' label looks like. I can confirm I have sc.DrawZeros = 0 and have tried this with STD, LOW, and VERY_LOW precedence with no difference. Of course, this is trivial and I can opt to use a different drawstyle, but I've grown to like the visual effect of using DRAWSTYLE_SUBGRAPH_NAME_AND_VALUE_LABELS_ONLY with the ColorBar Alert study and only seeing the tag at the LastVisibleIndex when the condition returns TRUE. Any help is greatly appreciated. Gratefully, Jacob |
| Attachment Deleted. |
To post a message in this thread, you need to log in with your Sierra Chart account:
