Skip to content

Commit

Permalink
Merge pull request #934 from olbartek/master
Browse files Browse the repository at this point in the history
Property circleHoleRadius added to ILineChartDataSet protocol.
  • Loading branch information
danielgindi committed May 22, 2016
2 parents 0549e99 + d42c59b commit 82ab54b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ public class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet
/// The radius of the drawn circles.
public var circleRadius = CGFloat(8.0)

private var _circleHoleRadius = CGFloat(4.0)

/// The hole radius of the drawn circles (new value is set only if it is less than circleRadius value)
public var circleHoleRadius : CGFloat
{
get
{
return _circleHoleRadius;
}
set
{
if newValue < self.circleRadius
{
_circleHoleRadius = newValue
}
}
}

public var circleColors = [NSUIColor]()

/// - returns: the color at the given index of the DataSet's circle-color array.
Expand Down
3 changes: 3 additions & 0 deletions Charts/Classes/Data/Interfaces/ILineChartDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet
/// The radius of the drawn circles.
var circleRadius: CGFloat { get set }

/// The hole radius of the drawn circles.
var circleHoleRadius: CGFloat { get set }

var circleColors: [NSUIColor] { get set }

/// - returns: the color at the given index of the DataSet's circle-color array.
Expand Down
4 changes: 2 additions & 2 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ public class LineChartRenderer: LineRadarChartRenderer

let circleRadius = dataSet.circleRadius
let circleDiameter = circleRadius * 2.0
let circleHoleDiameter = circleRadius
let circleHoleRadius = circleHoleDiameter / 2.0
let circleHoleRadius = dataSet.circleHoleRadius
let circleHoleDiameter = circleHoleRadius * 2.0
let isDrawCircleHoleEnabled = dataSet.isDrawCircleHoleEnabled

guard let
Expand Down
18 changes: 18 additions & 0 deletions ChartsRealm/Classes/Data/RealmLineDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ public class RealmLineDataSet: RealmLineRadarDataSet, ILineChartDataSet
/// The radius of the drawn circles.
public var circleRadius = CGFloat(8.0)

private var _circleHoleRadius = CGFloat(4.0)

/// The hole radius of the drawn circles (new value is set only if it is less than circleRadius value)
public var circleHoleRadius : CGFloat
{
get
{
return _circleHoleRadius;
}
set
{
if newValue < self.circleRadius
{
_circleHoleRadius = newValue
}
}
}

public var circleColors = [NSUIColor]()

/// - returns: the color at the given index of the DataSet's circle-color array.
Expand Down

0 comments on commit 82ab54b

Please sign in to comment.