You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func setChart(_ xValues: [String], yValuesLineChart: [Double], yValuesBarChart: [Double] , combinedChartView:CombinedChartView) {
combinedChartView.noDataText = "Please provide data for the chart."
var yVals1 : [ChartDataEntry] = [ChartDataEntry]()
var yVals2 : [BarChartDataEntry] = [BarChartDataEntry]()
for i in 0..<xValues.count {
yVals1.append(ChartDataEntry(value: yValuesLineChart[i], xIndex: i))
yVals2.append(BarChartDataEntry(value: yValuesBarChart[i] , xIndex: i))
}
let lineChartSet = LineChartDataSet(yVals: yVals1, label: "Line Data")
let barChartSet: BarChartDataSet = BarChartDataSet(yVals: yVals2, label: "Bar Data")
let data: CombinedChartData = CombinedChartData(xVals: xValues)
data.barData = BarChartData(xVals: xValues, dataSets: [barChartSet])
if yValuesLineChart.contains(0) == false {
data.lineData = LineChartData(xVals: xValues, dataSets: [lineChartSet])
}
combinedChartView.data = data
}
The text was updated successfully, but these errors were encountered:
goel232
changed the title
How to access the labels on x axis of Combined Line and Bar chart on swift(3.0.1)
How to access the Position of labels on x axis of Combined Line and Bar chart on swift(3.0.1)
Feb 2, 2017
I have done the same thing in swift2 like this
The text was updated successfully, but these errors were encountered: