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 1 commit
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 @@ -40,6 +40,7 @@ public class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet
// MARK: - Styling functions and accessors

private var _cubicIntensity = CGFloat(0.2)
private var _circleHoleRadius = CGFloat(4.0)

/// Intensity for cubic lines (min = 0.05, max = 1)
///
Expand Down Expand Up @@ -79,6 +80,18 @@ public class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet
/// The radius of the drawn circles.
public var circleRadius = CGFloat(8.0)

/// The radius of the drawn circles.
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
13 changes: 13 additions & 0 deletions ChartsRealm/Classes/Data/RealmLineDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class RealmLineDataSet: RealmLineRadarDataSet, ILineChartDataSet
// MARK: - Styling functions and accessors

private var _cubicIntensity = CGFloat(0.2)
private var _circleHoleRadius = CGFloat(4.0)

/// Intensity for cubic lines (min = 0.05, max = 1)
///
Expand Down Expand Up @@ -69,6 +70,18 @@ public class RealmLineDataSet: RealmLineRadarDataSet, ILineChartDataSet
/// The radius of the drawn circles.
public var circleRadius = CGFloat(8.0)

/// The radius of the drawn circles.
public var circleHoleRadius : CGFloat {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code styling...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly should be changed?

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