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