Skip to content

Commit

Permalink
put assert into getter (+1 squashed commit)
Browse files Browse the repository at this point in the history
Squashed commits:
[db7f9dd] use assert instead of warning if pie chart data set > 1
for #3146. add a warning message if pie chart has more than one data set
  • Loading branch information
liuxuan30 committed Mar 20, 2018
1 parent 3e36632 commit 6ce557d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/Charts/Data/Implementations/Standard/PieChartData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ open class PieChartData: ChartData
super.init(dataSets: dataSets)
}

/// - returns: All DataSet objects this ChartData object holds.
@objc open override var dataSets: [IChartDataSet]
{
get
{
assert(super.dataSets.count > 1, "Found multiple data sets while pie chart only allows one")
return super.dataSets
}
set
{
super.dataSets = newValue
}
}

@objc var dataSet: IPieChartDataSet?
{
get
Expand Down

0 comments on commit 6ce557d

Please sign in to comment.