Skip to content

Commit

Permalink
Merge branch 'lineCap' of https://github.com/liuxuan30/ios-charts int…
Browse files Browse the repository at this point in the history
…o liuxuan30-lineCap
  • Loading branch information
danielgindi committed Mar 17, 2016
2 parents a76242e + 6e9f64b commit b072d6b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 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 @@ -26,6 +26,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
2 changes: 2 additions & 0 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ public class LineChartRenderer: LineRadarChartRenderer
let maxx = min(max(minx + 2, dataSet.entryIndex(entry: entryTo) + 1), entryCount)

CGContextSaveGState(context)

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 b072d6b

Please sign in to comment.