We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tried to populate a combinedChartView (bar and line).
Expected each y value to be plotted against one x value. Also expected the y values to be plotted against specific x values.
On some x values, two y values were plotted against it. Also the y values were not plotted against the correct x values.
**Charts version/Branch/Commit Number:3.0 **Xcode version:9.3 **Swift version:4.2 **Platform(s) running Charts:iOS **macOS version running Xcode:10.13.6
func updateTotalChart(xValues: [Int], yValuesBarChart: [Int], yValuesLineChart: [Int]) { var yValuesLine = [ChartDataEntry]() var yValuesBar = [BarChartDataEntry]() for i in 0..<graphRounds.count { let yValueBar = BarChartDataEntry(x: Double(rounds[i]), y: Double(perRoundThrownArray[i])) yValuesBar.append(yValueBar) let yValueLine = ChartDataEntry(x: Double(rounds[i]), y: Double(perRoundLandedArray[i])) yValuesLine.append(yValueLine) } let lineChartSet = LineChartDataSet(values: yValuesLine, label: "Total Punches Landed") let barChartSet = BarChartDataSet(values: yValuesBar, label: "Total Punches Thrown") lineChartSet.colors = [UIColor.black] barChartSet.colors = [UIColor.green] lineChartSet.circleRadius = 1 lineChartSet.drawValuesEnabled = false barChartSet.valueTextColor = UIColor.white let data: CombinedChartData = CombinedChartData(dataSets: [lineChartSet, barChartSet]) data.barData = BarChartData(dataSet: barChartSet) data.lineData = LineChartData(dataSet: lineChartSet) totalThrownChart.data = data // Formating totalThrownChart.animate(xAxisDuration: 2.0, yAxisDuration: 2.0) totalThrownChart.chartDescription?.text = "" totalThrownChart.leftAxis.labelTextColor = UIColor.white totalThrownChart.rightAxis.enabled = false totalThrownChart.legend.textColor = UIColor.white totalThrownChart.xAxis.labelPosition = .bottom totalThrownChart.xAxis.labelTextColor = UIColor.white totalThrownChart.xAxis.gridColor = UIColor.white totalThrownChart.xAxis.setLabelCount(graphRounds.count, force: true) totalThrownChart.xAxis.granularityEnabled = true totalThrownChart.xAxis.granularity = 1 totalThrownChart.xAxis.axisMaximum = Double(graphRounds.max()!) totalThrownChart.xAxis.axisMinimum = Double(graphRounds.min()!) totalThrownChart.xAxis.axisMinLabels = graphRounds.count totalThrownChart.leftAxis.drawZeroLineEnabled = true totalThrownChart.leftAxis.axisMinimum = 0 }
The text was updated successfully, but these errors were encountered:
what is this rounds[I] ?
rounds[I]
Sorry, something went wrong.
Yip I think that was the issue. Thanks!
No branches or pull requests
What did you do?
Tried to populate a combinedChartView (bar and line).
What did you expect to happen?
Expected each y value to be plotted against one x value. Also expected the y values to be plotted against specific x values.
What happened instead?
On some x values, two y values were plotted against it. Also the y values were not plotted against the correct x values.
Charts Environment
**Charts version/Branch/Commit Number:3.0
**Xcode version:9.3
**Swift version:4.2
**Platform(s) running Charts:iOS
**macOS version running Xcode:10.13.6
Code
The text was updated successfully, but these errors were encountered: