mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
Fix chart line rendering
This commit is contained in:
parent
43d889a1ba
commit
fce2702c50
@ -89,7 +89,6 @@ public class TwoAxisStepBarsChartController: BaseLinesChartController {
|
||||
} else {
|
||||
controller.mainBarsRenderer.bars = BarChartRenderer.BarsData(barWidth: 0.0, locations: [], components: [])
|
||||
controller.previewBarsRenderer.bars = BarChartRenderer.BarsData(barWidth: 0.0, locations: [], components: [])
|
||||
controller.verticalScalesRenderer.setHorizontalLinesVisible(false, animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ class LinesChartRenderer: BaseChartRenderer {
|
||||
context.setAlpha(alpha)
|
||||
context.setStrokeColor(toLine.color.cgColor)
|
||||
context.setLineWidth(lineWidth)
|
||||
context.setLineCap(.round)
|
||||
|
||||
if linesShapeAnimator.isAnimating {
|
||||
let animationOffset = linesShapeAnimator.current
|
||||
@ -314,8 +315,9 @@ class LinesChartRenderer: BaseChartRenderer {
|
||||
lines.removeLast()
|
||||
}
|
||||
|
||||
context.setLineCap(.round)
|
||||
context.beginTransparencyLayer(auxiliaryInfo: nil)
|
||||
context.strokeLineSegments(between: lines)
|
||||
context.endTransparencyLayer()
|
||||
} else {
|
||||
if var index = toLine.points.firstIndex(where: { $0.x >= range.lowerBound }) {
|
||||
var lines: [CGPoint] = []
|
||||
@ -431,7 +433,6 @@ class LinesChartRenderer: BaseChartRenderer {
|
||||
lines.removeLast()
|
||||
}
|
||||
|
||||
context.setLineCap(.round)
|
||||
context.strokeLineSegments(between: lines)
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ class PieChartRenderer: BaseChartRenderer {
|
||||
let maximumFontSize: CGFloat = radius / 7
|
||||
let minimumFontSize: CGFloat = 4
|
||||
let centerOffsetStartAngle = CGFloat.pi / 4
|
||||
let minimumValueToDraw: CGFloat = 0.01
|
||||
let minimumValueToDraw: CGFloat = 1.01
|
||||
let diagramRadius = radius - animationSelectionOffset
|
||||
|
||||
let numberOfVisibleItems = currentlyVisibleData.filter { $0.value > 0 }.count
|
||||
|
Loading…
x
Reference in New Issue
Block a user