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
But bars are not overlapped when the X values are as follows. See figure 2.
let xValues = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Figure 2:
Following snippet was used to draw the chart data
for i in 0..<xValues.count { let dataEntry = BarChartDataEntry(x: xValues[i], y: yValues[i]) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(values: dataEntries, label: "Units Sold") let chartData = BarChartData(dataSet: chartDataSet) barChartView?.data = chartData
Please help on how to resolve the bar overlapping on first test case.
The text was updated successfully, but these errors were encountered:
how about you zoom in your first chart or change bar width?
I think you don't think about your data first
Your x value is [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2] which only has 0.1 interval, while your bar width is overwhelming - that seems like a overlap situation.
Either you change your bar width or make x axis has smaller granularity to give a try.
When X set are continuous ordered value like the dataset provided below, each bars are getting overlapped as figure 1.
let xValues = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
let yValues = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0, 4.0, 18.0, 2.0, 4.0, 5.0, 4.0]
Figure 1:
But bars are not overlapped when the X values are as follows. See figure 2.
let xValues = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Figure 2:
Following snippet was used to draw the chart data
for i in 0..<xValues.count { let dataEntry = BarChartDataEntry(x: xValues[i], y: yValues[i]) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(values: dataEntries, label: "Units Sold") let chartData = BarChartData(dataSet: chartDataSet) barChartView?.data = chartData
Please help on how to resolve the bar overlapping on first test case.
The text was updated successfully, but these errors were encountered: