Support Board
Date/Time: Tue, 26 Nov 2024 03:59:23 +0000
Pixels per sc.BaseGraphScaleIncrement
View Count: 1450
[2014-03-31 12:28:34] |
QnReally - Posts: 181 |
I have an ACSIL study that prints some text labels on multiple lines. When I change the scale of the main graph to a bigger number, the labels become squished because I use label offsets based on the TICK_SIZE (I tried Relative positioning also but it gets into some issues). Is there a way to determine how many pixels are in the chart from top of the scale to the bottom? In other words, I would like to know how many pixels are being used vertically for each sc.BaseGraphScaleIncrement value in the chart. I am using CONSTRANGE for the main graph and my study is set to Automatic scaling and it is drawn in the same region as the main graph. This post may be a duplicate because I messed up my previous request. Thanks. |
[2014-03-31 17:15:05] |
Sierra Chart Engineering - Posts: 104368 |
You can use the following as long as the study is set to sc.GraphRegion= 0: https://www.sierrachart.com/index.php?l=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scStudyRegionTopCoordinate 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 |
[2014-03-31 17:33:25] |
QnReally - Posts: 181 |
I am running v1109 and here is the code I have for the study: sc.GraphRegion = 0; Buffer.Format("TC = %d, BC = %d", sc.StudyRegionTopCoordinate, sc.StudyRegionTopCoordinate); sc.AddMessageToLog(Buffer, 0); And it prints the following in the Message Log: Chart: @NQ#C/NQM4 [R] 300 Volume #26 | Study: Test | TC = 0, BC = 0 | 2014-03-31 13:27:08 My price scale is set to Constant Range (http://screencast.com/t/KskYcIWAd). I am not sure what I am doing wrong. Thanks. |
[2014-03-31 17:41:50] |
Sierra Chart Engineering - Posts: 104368 |
Is this line of code outside of the sc.SetDefaults code block: Buffer.Format("TC = %d, BC = %d", sc.StudyRegionTopCoordinate, sc.StudyRegionTopCoordinate); sc.AddMessageToLog(Buffer, 0); Also you could gets zeros for the first call into the study function when first opening the Chartbook and the study is already on the chart. 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 |
[2014-03-31 18:30:23] |
QnReally - Posts: 181 |
It is outside the sc.SetDefaults block. Message Log shows a new message each time I press the Insert key on the keyboard which I think is reloading the chart. Here is the skeleton of the code: if(sc.SetDefaults)
{ sc.GraphName="Test"; sc.StudyDescription="Test"; //Manual looping sc.AutoLoop = 0; sc.GraphRegion = 0; return; } SCString Buffer; if (sc.UpdateStartIndex == 0) { sc.GraphRegion = 0; Buffer.Format("TC = %d, BC = %d", sc.StudyRegionTopCoordinate, sc.StudyRegionTopCoordinate); sc.AddMessageToLog(Buffer, 0); } |
[2014-03-31 18:48:49] |
Sierra Chart Engineering - Posts: 104368 |
It makes sense the top coordinate would be 0. However, notice your code, you are outputting the top coordinate twice. Not the bottom coordinate.
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 |
[2014-03-31 19:20:26] |
QnReally - Posts: 181 |
Well, that was totally silly of me. Thanks for debugging my code. Have a great day!
|
To post a message in this thread, you need to log in with your Sierra Chart account: