Skip to content

Commit

Permalink
refactor lineCapType to latest architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxuan30 committed Feb 24, 2016
1 parent 901d390 commit 2d8782c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet
}
}

/// Line cap type, default is CGLineCap.Butt
public var lineCapType = CGLineCap.Butt

/// If true, cubic lines are drawn instead of linear
public var drawCubicEnabled = false

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 @@ -25,6 +25,9 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet
/// **default**: 0.2
var cubicIntensity: CGFloat { get set }

/// Line cap type, default is CGLineCap.Butt
var lineCapType: CGLineCap { get set }

/// If true, cubic lines are drawn instead of linear
var drawCubicEnabled: Bool { get set }

Expand Down
3 changes: 1 addition & 2 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ public class LineChartRenderer: LineRadarChartRenderer
animator = animator
else { return }

let lineCap = dataProvider?.lineCap ?? CGLineCap.Butt
let valueToPixelMatrix = trans.valueToPixelMatrix

let entryCount = dataSet.entryCount
Expand All @@ -255,7 +254,7 @@ public class LineChartRenderer: LineRadarChartRenderer

CGContextSaveGState(context)

CGContextSetLineCap(context, lineCap)
CGContextSetLineCap(context, dataSet.lineCapType)

// more than 1 color
if (dataSet.colors.count > 1)
Expand Down
3 changes: 3 additions & 0 deletions ChartsRealm/Classes/Data/RealmLineDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public class RealmLineDataSet: RealmLineRadarDataSet, ILineChartDataSet
}
}

/// Line cap type, default is CGLineCap.Butt
public var lineCapType = CGLineCap.Butt

/// If true, cubic lines are drawn instead of linear
public var drawCubicEnabled = false

Expand Down

0 comments on commit 2d8782c

Please sign in to comment.