Login Page - Create Account

Support Board


Date/Time: Tue, 13 May 2025 17:17:32 +0000



Post From: Programming Help: Tick Size and Scale Range Type

[2024-08-29 19:20:46]
User688525 - Posts: 284
Hello emmanuel ,
Thanks for your help.

When I build and run the study, no errors appear, however, neither the scale or ticksize change?

Update: the following code changes the tick size but not the scale range:

#include "sierrachart.h"
SCDLLName("Ticks Range")

SCSFExport scsf_TicksRange(SCStudyInterfaceRef sc)
{
int& IsTickSizeSet = sc.GetPersistentInt(0); // track if tick size has been set

// Set chart properties
if(sc.SetDefaults) {
sc.ScaleRangeType = SCALE_CONSTANT_RANGE; // set scale range type to constant range
sc.ScaleConstRange = 30; // set constant range value to 30
sc.GraphRegion = 0; // set study Graph Name

return;
}

// Check and set tick size
if(sc.Index == 0) { // check tick size
if(sc.TickSize != 0.5) { // if tick size is not 0.5
sc.TickSize = 0.5; // set tick size to 0.5
IsTickSizeSet = 1; // mark that tick size has been set
sc.FlagToReloadChartData = 1; // reload chart
}
}
}

Date Time Of Last Edit: 2024-08-29 19:33:30