Skip to content

Commit

Permalink
Merge pull request #3286 from danielgindi/3146
Browse files Browse the repository at this point in the history
for #3146. add a warning message if pie chart has more than one data set
  • Loading branch information
liuxuan30 authored Mar 20, 2018
2 parents 3e36632 + ed8cf20 commit f7a648c
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 f7a648c

Please sign in to comment.