Skip to content

Commit

Permalink
Improvements regarding #72
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Jul 9, 2015
1 parent 253cf61 commit a7e30dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -908,13 +908,21 @@ public class BarLineChartViewBase: ChartViewBase, UIGestureRecognizerDelegate
{
var matrix = _viewPortHandler.zoomIn(x: self.bounds.size.width / 2.0, y: -(self.bounds.size.height / 2.0))
_viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true)

// Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets.
calculateOffsets()
setNeedsDisplay()
}

/// Zooms out by 0.7, from the charts center. center.
public func zoomOut()
{
var matrix = _viewPortHandler.zoomOut(x: self.bounds.size.width / 2.0, y: -(self.bounds.size.height / 2.0))
_viewPortHandler.refresh(newMatrix: matrix, chart: self, invalidate: true)

// Range might have changed, which means that Y-axis labels could have changed in size, affecting Y-axis size. So we need to recalculate offsets.
calculateOffsets()
setNeedsDisplay()
}

/// Zooms in or out by the given scale factor. x and y are the coordinates
Expand Down

0 comments on commit a7e30dd

Please sign in to comment.