Skip to main content

Settings

The Chart.Settings model is used to configure chart settings.

public struct Settings: Codable, Equatable {
static let `default` = Settings()
// General
public var chartType: ChartType
public var highAndLow: Bool
public var verticalGrid: Bool
public var horizontalGrid: Bool
public var candleWicks: Bool
public var watermark: Bool
/// The time zone mode determines how timestamps are interpreted and displayed on the chart.
/// If the current aggregation interval is **greater than or equal to 24 hours**, the chart will forcibly display data in UTC mode.
///
/// - Note: For aggregations of 24 hours or longer, the chart will use the selected mode and use UTC to ensure consistency in data representation.
public var timezone: Chart.TimeZoneMode
// Colors
public var selectedTheme: ThemeType
public var chartThemeDark: Chart.Theme?
public var chartThemeLight: Chart.Theme?
// Trading
public var tradingFromChart: Bool
public var showActiveOrders: Bool
public var showOpenPositions: Bool
// Scale
public var autoscalePriceAxis: Bool
public var fitStudies: Bool
public var fitOrders: Bool
public var fitPositions: Bool
public var invertScale: Bool
public var lockScale: Bool
public var scaleType: ScaleType
// Data
public var sessionBreaks: Bool
public var extendedHours: Bool
public var alignDataWithSessionStart: Bool
public var priceType: PriceType
public var volume: Bool
// Events
public var eventsOnChart: Bool
public var dividends: Bool
public var splitsAndConsolidations: Bool
public var earningsAndEstimates: Bool
public var conferenceCalls: Bool
public var news: Bool
}

SettingsManager is responsible for managing settings in DXсharts. You can either provide your own SettingsManager or use the default implementation, DXCSettingsManager by DXсharts.

To set custom values, provide a custom instance of the Chart.Settings models through the SettingsManager instance.

Default settings

SettingDefault value
chartType.candle
highAndLowfalse
verticalGridtrue
horizontalGridfalse
candleWickstrue
watermarkfalse
tradingFromChartfalse
showActiveOrdersfalse
showOpenPositionsfalse
autoscalePriceAxistrue
fitStudiestrue
fitOrdersfalse
fitPositionsfalse
invertScalefalse
lockScalefalse
scaleType.regular
sessionBreaksfalse
extendedHoursfalse
alignDataWithSessionStartfalse
priceType.last
volumetrue
eventsOnChartfalse
dividendsfalse
splitsAndConsolidationsfalse
earningsAndEstimatesfalse
conferenceCallsfalse
newsfalse

Available settings:

  • chartType: candle, bar, line, area, scatterPlot, hollowCandle, histogram, baseline, trend, heikinAshi, equivolume.
  • scaleType: regular, percent, logarithmic.
  • priceType: last, market, bid, ask.