Chart fixes

This commit is contained in:
Ilya Laktyushin 2020-03-23 23:17:03 +04:00
parent 8f06ccb9ec
commit 0453d6f933
2 changed files with 4 additions and 2 deletions

View File

@ -164,7 +164,7 @@ public class TwoAxisStepBarsChartController: BaseLinesChartController {
super.chartInteractionDidBegin(point: point) super.chartInteractionDidBegin(point: point)
var barOffset: CGFloat = 0.0 var barOffset: CGFloat = 0.0
for graphController in graphControllers { for (index, graphController) in graphControllers.enumerated() {
var bullets: [LineBulletsRenderer.Bullet] = [] var bullets: [LineBulletsRenderer.Bullet] = []
if let component = graphController.chartBars.components.first { if let component = graphController.chartBars.components.first {
let location = graphController.chartBars.locations[minIndex] let location = graphController.chartBars.locations[minIndex]
@ -175,8 +175,10 @@ public class TwoAxisStepBarsChartController: BaseLinesChartController {
bullets.append(LineBulletsRenderer.Bullet(coordinate: CGPoint(x: location, y: value), offset: CGPoint(x: offset, y: 0.0), color: component.color)) bullets.append(LineBulletsRenderer.Bullet(coordinate: CGPoint(x: location, y: value), offset: CGPoint(x: offset, y: 0.0), color: component.color))
} }
let isVisible = chartVisibility[index]
graphController.lineBulletsRenderer.bullets = bullets graphController.lineBulletsRenderer.bullets = bullets
graphController.lineBulletsRenderer.isEnabled = true graphController.lineBulletsRenderer.isEnabled = true
graphController.lineBulletsRenderer.setLineVisible(isVisible, at: 0, animated: false)
} }
let chartValue: CGFloat = CGFloat(closestDate.timeIntervalSince1970) let chartValue: CGFloat = CGFloat(closestDate.timeIntervalSince1970)

View File

@ -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 = 1.01 let minimumValueToDraw: CGFloat = 0.015
let diagramRadius = radius - animationSelectionOffset let diagramRadius = radius - animationSelectionOffset
let numberOfVisibleItems = currentlyVisibleData.filter { $0.value > 0 }.count let numberOfVisibleItems = currentlyVisibleData.filter { $0.value > 0 }.count