-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
Migrate to 3.8.0
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Foundation | ||
|
||
protocol CandlestickSeriesData : OhlcData { | ||
var color: ChartColor? { get } | ||
var borderColor: ChartColor? { get } | ||
var wickColor: ChartColor? { get } | ||
} | ||
|
||
// MARK: - | ||
public struct CandlestickData : CandlestickSeriesData { | ||
public var time: Time | ||
public var open: Double? | ||
public var high: Double? | ||
public var low: Double? | ||
public var close: Double? | ||
public var color: ChartColor? | ||
public var borderColor: ChartColor? | ||
public var wickColor: ChartColor? | ||
|
||
public init(time: Time, | ||
open: Double?, | ||
high: Double?, | ||
low: Double?, | ||
close: Double?, | ||
color: ChartColor? = nil, | ||
borderColor: ChartColor? = nil, | ||
wickColor: ChartColor? = nil) { | ||
self.time = time | ||
self.open = open | ||
self.high = high | ||
self.low = low | ||
self.close = close | ||
self.color = color | ||
self.borderColor = borderColor | ||
self.wickColor = wickColor | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Foundation | ||
|
||
/** | ||
Represents a bar with a Time and open, high, low, and close prices. | ||
*/ | ||
public protocol OhlcData : SeriesData { | ||
|
||
/** | ||
The bar time | ||
*/ | ||
var time: Time { get } | ||
|
||
/** | ||
The open price | ||
*/ | ||
var open: Double? { get } | ||
|
||
/** | ||
The high price | ||
*/ | ||
var high: Double? { get } | ||
|
||
/** | ||
The low price | ||
*/ | ||
var low: Double? { get } | ||
|
||
/** | ||
The close price | ||
*/ | ||
var close: Double? { get } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ import Foundation | |
|
||
public protocol SeriesData: Codable { | ||
|
||
/** | ||
The time of the data | ||
*/ | ||
var time: Time { get } | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Foundation | ||
|
||
/** | ||
A base interface for a data point of single-value series | ||
*/ | ||
public protocol SingleValueSeriesData : SeriesData { | ||
|
||
/** | ||
* Price value of data item | ||
*/ | ||
var value: Double? { get } | ||
} | ||
|
||
|
||
public struct SingleValueData : SingleValueSeriesData { | ||
public var time: Time | ||
public var value: Double? | ||
|
||
public init(time: Time, value: Double?) { | ||
self.time = time | ||
self.value = value | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Foundation | ||
|
||
/** | ||
* Represent options for the tracking mode's behavior. | ||
*/ | ||
public struct TrackingModeOptions: Codable { | ||
public var exitMode: TrackingModeExitMode? | ||
|
||
public init(exitMode: TrackingModeExitMode? = nil) { | ||
self.exitMode = exitMode | ||
} | ||
} | ||
|
||
/** | ||
* Determine how to exit the tracking mode. | ||
* | ||
* By default, mobile users will long press to deactivate the scroll and have the ability to check values and dates. | ||
* Another press is required to activate the scroll, be able to move left/right, zoom, etc. | ||
*/ | ||
public enum TrackingModeExitMode: Int, Codable { | ||
/** | ||
* Tracking Mode will be deactivated on touch end event. | ||
*/ | ||
case onTouchEnd | ||
/** | ||
* Tracking Mode will be deactivated on the next tap event. | ||
*/ | ||
case onNextTap | ||
} |