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
I have the following function to create and display chart:
func setChart(chartview: BarChartView, xarray: [String], yarray: [Double]){ var dataEntries: [BarChartDataEntry] = [] for i in 0..<xarray.count { let dataEntry = BarChartDataEntry(x: Double(i), y: Double(yarray[i])) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(values: dataEntries, label: "") let chartData = BarChartData(dataSet: chartDataSet) chartview.xAxis.valueFormatter = IndexAxisValueFormatter(values:xarray) chartview.xAxis.labelPosition = .bottom chartview.chartDescription?.enabled = false chartview.rightAxis.enabled = false chartview.legend.enabled = false chartview.data = chartData }
And then I have two Views with two charts like this:
setChart(chartview: barChartView, xarray: countArray, yarray: doubleArray) setChart(chartview: barChartView2, xarray: agversionarray, yarray: doubleArray2)
Sometimes the chart looks good like this:
But other times the chart X-Axis has two many values or is missing values like this:
I also printed out my X and Y array when the graph looks weird and they are as follows:
Graph 1
["iOS 10", "iOS 9"] [193.0, 3.0]
Graph 2
["2.1.0.6", "2.1.0.5", "2.0.32", "2.0.30", "2.0.23"] [173.0, 3.0, 15.0, 4.0, 1.0]
The data looks fine, not sure why its being formatted like that.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the following function to create and display chart:
And then I have two Views with two charts like this:
Sometimes the chart looks good like this:
But other times the chart X-Axis has two many values or is missing values like this:
I also printed out my X and Y array when the graph looks weird and they are as follows:
Graph 1
Graph 2
The data looks fine, not sure why its being formatted like that.
The text was updated successfully, but these errors were encountered: