Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property circleHoleRadius added to ILineChartDataSet protocol. #934

Merged
merged 2 commits into from
May 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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 @@ -41,6 +41,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 @@ -585,8 +585,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 @@ -69,6 +69,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