Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 09:39:17 +0000



[Programming Help] - How to draw different text on chart by Subgraph function?

View Count: 1419

[2018-08-07 21:15:24]
User517260 - Posts: 97
Dear Sir, I need to draw on chart different text, like waves numbers 1-2-3-4-5, but if I use Subgraph function and use DRAWSTYLE_TEXT_WITH_BACKGROUND or DRAWSTYLE_TEXT - as soon as I change text by .TextDrawStyleText feature text is changing on every place on subgraph and I see 2-2-2-2-2 instead of 1-2-3-4-5. I don't like to use 'Tool' to draw text marks on chart because it seems for me too slow and get more resources. Could you help me - how can I use Subgraph to draw different text marks on chart? Thanks. Alex.
[2018-08-07 21:54:27]
Sierra Chart Engineering - Posts: 104368
You need to use this particular Draw Style:
Chart Studies: Custom Value At Y (ACSIL: DRAWSTYLE_CUSTOM_VALUE_AT_Y)
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-08-08 10:57:52]
User517260 - Posts: 97
Thanks, it works ok. Could you tell me how I can set background color for text? I used:

    CustomText_Sub.Name = "Custom Text";
    CustomText_Sub.DrawStyle = DRAWSTYLE_CUSTOM_VALUE_AT_Y;
    CustomText_Sub.TextDrawStyleText = "1";
    CustomText_Sub.PrimaryColor = RGB(200,0,100);
    CustomText_Sub.SecondaryColor = RGB(100,255,200);
    CustomText_Sub.SecondaryColorUsed = 1;
    CustomText_Sub.LineWidth = 5;
    CustomText_Sub.DrawZeros = false;


  CustomText_Sub[1] = 1; // Text to draw on chart
  CustomText_Sub[3] = 2; // Text to draw on chart
  CustomText_Sub[5] = 3; // Text to draw on chart
  CustomText_Sub[7] = 4; // Text to draw on chart
  CustomText_Sub[9] = 5; // Text to draw on chart
  CustomText_Sub[11] = 1; // Text to draw on chart
  CustomText_Sub[13] = 2; // Text to draw on chart
  CustomText_Sub[15] = 3; // Text to draw on chart
  CustomText_Sub[17] = 4; // Text to draw on chart
  CustomText_Sub[19] = 5; // Text to draw on chart
  
  CustomText_Sub.Arrays[0][1] = 0.5; // Y position of text
  CustomText_Sub.Arrays[0][3] = 0.3; // Y position of text
  CustomText_Sub.Arrays[0][5] = 0.9; // Y position of text
  CustomText_Sub.Arrays[0][7] = 0.6; // Y position of text
  CustomText_Sub.Arrays[0][9] = 1.5; // Y position of text
  CustomText_Sub.Arrays[0][11] = -0.5; // Y position of text
  CustomText_Sub.Arrays[0][13] = -0.3; // Y position of text
  CustomText_Sub.Arrays[0][15] = -0.9; // Y position of text
  CustomText_Sub.Arrays[0][17] = -0.6; // Y position of text
  CustomText_Sub.Arrays[0][19] = -1.5; // Y position of text

Text color is ok, but background color is black.

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

Login

Login Page - Create Account