ChartArea.IsAutoScaleEnabled
property · ChartArea · cAlgo.API Since 5.10
DesktopCLICloud
Gets or sets the value indicating whether the auto scale is enabled for the chart area. When enabled, the Y-axis range is fitted automatically to the visible bars and outputs while the chart scrolls. Setting the Y-axis range with SetYRange, or dragging the price axis, disables the auto scale. On the main chart area the auto scale is always enabled while the price scale mode is Percent or IndexedTo100, and is always disabled while the price to bar ratio is locked; setting it to a conflicting value in these states is ignored. In the silent backtesting, the CLI and the cloud the value is only stored and has no visual effect.
Definition
bool IsAutoScaleEnabled {get; set;}
chartArea.IsAutoScaleEnabled: bool
Returns bool
Examples
Chart.SetYRange(Chart.BottomY, Chart.TopY);
Print("Auto scale after SetYRange: {0}", Chart.IsAutoScaleEnabled);
Chart.IsAutoScaleEnabled = true;
Print("Auto scale: {0}", Chart.IsAutoScaleEnabled);
api.Chart.SetYRange(api.Chart.BottomY, api.Chart.TopY)
print(f"Auto scale after SetYRange: {api.Chart.IsAutoScaleEnabled}")
api.Chart.IsAutoScaleEnabled = True
print(f"Auto scale: {api.Chart.IsAutoScaleEnabled}")