mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various fixes
This commit is contained in:
parent
e789170a1a
commit
b711016755
9 changed files with 89 additions and 38 deletions
|
|
@ -45,6 +45,9 @@ public class TwoAxisStepBarsChartController: BaseLinesChartController {
|
|||
|
||||
private var prevoiusHorizontalStrideInterval: Int = 1
|
||||
|
||||
public var hourly: Bool = false
|
||||
public var min5: Bool = false
|
||||
|
||||
override public init(chartsCollection: ChartsCollection) {
|
||||
self.initialChartCollection = chartsCollection
|
||||
graphControllers = chartsCollection.chartValues.map { _ in GraphController() }
|
||||
|
|
@ -252,8 +255,19 @@ public class TwoAxisStepBarsChartController: BaseLinesChartController {
|
|||
}
|
||||
|
||||
func updateHorizontalLimits(horizontalRange: ClosedRange<CGFloat>, animated: Bool) {
|
||||
var scaleType: ChartScaleType = .day
|
||||
if isZoomed {
|
||||
scaleType = .minutes5
|
||||
} else {
|
||||
if self.hourly {
|
||||
scaleType = .hour
|
||||
} else if self.min5 {
|
||||
scaleType = .minutes5
|
||||
}
|
||||
}
|
||||
|
||||
if let (stride, labels) = horizontalLimitsLabels(horizontalRange: horizontalRange,
|
||||
scaleType: isZoomed ? .minutes5 : .day,
|
||||
scaleType: scaleType,
|
||||
prevoiusHorizontalStrideInterval: prevoiusHorizontalStrideInterval) {
|
||||
self.horizontalScalesRenderer.setup(labels: labels, animated: animated)
|
||||
self.prevoiusHorizontalStrideInterval = stride
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue