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've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
lineChartView?.xAxis.labelPosition = .bottom lineChartView?.xAxis.valueFormatter = self lineChartView?.xAxis.labelTextColor = Color.main.color lineChartView?.xAxis.labelFont = AppFonts.regular.font.withSize(7) lineChartView?.xAxis.gridColor = UIColor(red: 224.0/255.0, green: 231.0/255.0, blue: 255.0/255.0, alpha: 1.0) lineChartView?.leftAxis.labelTextColor = Color.main.color lineChartView?.leftAxis.labelFont = AppFonts.regular.font.withSize(9) lineChartView?.leftAxis.gridColor = UIColor(red: 224.0/255.0, green: 231.0/255.0, blue: 255.0/255.0, alpha: 1.0) lineChartView?.leftAxis.axisMinimum = 0 lineChartView?.rightAxis.enabled = false lineChartView?.legend.enabled = false lineChartView?.isUserInteractionEnabled = false var dataEntries: [ChartDataEntry] = [] for i in 0 ..< viewModel.values.count { let dataEntry = ChartDataEntry(x: Double(i), y: Double(viewModel.values[i])) dataEntries.append(dataEntry) } let lineDataSet = LineChartDataSet(entries: dataEntries) lineDataSet.colors = [viewModel.graphColor] lineDataSet.lineWidth = 2.0 lineDataSet.circleRadius = 4.0 lineDataSet.circleColors = [viewModel.graphColor] let chartData = LineChartData(dataSet: lineDataSet) lineChartView?.data = chartData
See each bubble, aligned with the X-axis line, not delayed as we have here: Only the first one is having the position correct:
The 2nd, 3rd and 4th position is wrong
Also, func stringForValue(_ value: Double, axis: AxisBase?) -> String
func stringForValue(_ value: Double, axis: AxisBase?) -> String
value: Double is having the value 0.3, 0.6, 1.3 :| instead of 0, 1, 2, 3 etc
Charts version/Branch/Commit Number: 3.4.0 Xcode version: 11.1 (11A1027) Swift version: 5.0 Platform(s) running Charts: iPhone X iOS 13.1 macOS version running Xcode: macOS Catalina 10.15
The text was updated successfully, but these errors were encountered:
I suggest you take a look at ChartsDemo. This looks like your data issue, as the x axis label value and circle x value is not the same.
Sorry, something went wrong.
No branches or pull requests
[*] I've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
What did you do?
lineChartView?.xAxis.labelPosition = .bottom
lineChartView?.xAxis.valueFormatter = self
lineChartView?.xAxis.labelTextColor = Color.main.color
lineChartView?.xAxis.labelFont = AppFonts.regular.font.withSize(7)
lineChartView?.xAxis.gridColor = UIColor(red: 224.0/255.0, green: 231.0/255.0, blue: 255.0/255.0, alpha: 1.0)
lineChartView?.leftAxis.labelTextColor = Color.main.color
lineChartView?.leftAxis.labelFont = AppFonts.regular.font.withSize(9)
lineChartView?.leftAxis.gridColor = UIColor(red: 224.0/255.0, green: 231.0/255.0, blue: 255.0/255.0, alpha: 1.0)
lineChartView?.leftAxis.axisMinimum = 0
lineChartView?.rightAxis.enabled = false
lineChartView?.legend.enabled = false
lineChartView?.isUserInteractionEnabled = false
var dataEntries: [ChartDataEntry] = []
for i in 0 ..< viewModel.values.count {
let dataEntry = ChartDataEntry(x: Double(i), y: Double(viewModel.values[i]))
dataEntries.append(dataEntry)
}
let lineDataSet = LineChartDataSet(entries: dataEntries)
lineDataSet.colors = [viewModel.graphColor]
lineDataSet.lineWidth = 2.0
lineDataSet.circleRadius = 4.0
lineDataSet.circleColors = [viewModel.graphColor]
let chartData = LineChartData(dataSet: lineDataSet)
lineChartView?.data = chartData
What did you expect to happen?
See each bubble, aligned with the X-axis line, not delayed as we have here:
Only the first one is having the position correct:
What happened instead?
The 2nd, 3rd and 4th position is wrong
Also,
func stringForValue(_ value: Double, axis: AxisBase?) -> String
value: Double is having the value 0.3, 0.6, 1.3 :| instead of 0, 1, 2, 3 etc
Charts Environment
Charts version/Branch/Commit Number: 3.4.0
Xcode version: 11.1 (11A1027)
Swift version: 5.0
Platform(s) running Charts: iPhone X iOS 13.1
macOS version running Xcode: macOS Catalina 10.15
The text was updated successfully, but these errors were encountered: