Settings
The Chart.Settings model is used to configure chart settings.
public struct Settings: Codable, Equatable {static let `default` = Settings()// Generalpublic var chartType: ChartTypepublic var highAndLow: Boolpublic var verticalGrid: Boolpublic var horizontalGrid: Boolpublic var candleWicks: Boolpublic 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// Colorspublic var selectedTheme: ThemeTypepublic var chartThemeDark: Chart.Theme?public var chartThemeLight: Chart.Theme?// Tradingpublic var tradingFromChart: Boolpublic var showActiveOrders: Boolpublic var showOpenPositions: Bool// Scalepublic var autoscalePriceAxis: Boolpublic var fitStudies: Boolpublic var fitOrders: Boolpublic var fitPositions: Boolpublic var invertScale: Boolpublic var lockScale: Boolpublic var scaleType: ScaleType// Datapublic var sessionBreaks: Boolpublic var extendedHours: Boolpublic var alignDataWithSessionStart: Boolpublic var priceType: PriceTypepublic var volume: Bool// Eventspublic var eventsOnChart: Boolpublic var dividends: Boolpublic var splitsAndConsolidations: Boolpublic var earningsAndEstimates: Boolpublic var conferenceCalls: Boolpublic 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
Setting | Default value |
---|---|
chartType | .candle |
highAndLow | false |
verticalGrid | true |
horizontalGrid | false |
candleWicks | true |
watermark | false |
tradingFromChart | false |
showActiveOrders | false |
showOpenPositions | false |
autoscalePriceAxis | true |
fitStudies | true |
fitOrders | false |
fitPositions | false |
invertScale | false |
lockScale | false |
scaleType | .regular |
sessionBreaks | false |
extendedHours | false |
alignDataWithSessionStart | false |
priceType | .last |
volume | true |
eventsOnChart | false |
dividends | false |
splitsAndConsolidations | false |
earningsAndEstimates | false |
conferenceCalls | false |
news | false |
Available settings:
- chartType: candle, bar, line, area, scatterPlot, hollowCandle, histogram, baseline, trend, heikinAshi, equivolume.
- scaleType: regular, percent, logarithmic.
- priceType: last, market, bid, ask.