Skip to content

Commit

Permalink
Merge branch 'liuxuan30-lineCap'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Mar 17, 2016
2 parents a76242e + 34f8892 commit 6a683d0
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 @@ -131,6 +131,9 @@ public class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet
/// [1, 3, 4, 2] will paint [- ---- - ---- ]
public var lineDashLengths: [CGFloat]?

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

/// formatter for customizing the position of the fill-line
private var _fillFormatter: ChartFillFormatter = ChartDefaultFillFormatter()

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 @@ -77,6 +77,9 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet
/// [1, 3, 4, 2] will paint [- ---- - ---- ]
var lineDashLengths: [CGFloat]? { get set }

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

/// Sets a custom FillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic.
var fillFormatter: ChartFillFormatter? { get set }
}
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 @@ -121,6 +121,9 @@ public class RealmLineDataSet: RealmLineRadarDataSet, ILineChartDataSet
/// [1, 3, 4, 2] will paint [- ---- - ---- ]
public var lineDashLengths: [CGFloat]?

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

/// formatter for customizing the position of the fill-line
private var _fillFormatter: ChartFillFormatter = ChartDefaultFillFormatter()

Expand Down

0 comments on commit 6a683d0

Please sign in to comment.