1

I am using the Charts to plot graph.Getting correct value at initially ,but when start to zoom graph, some values on the X-axis becomes identical.

have written the code like this.

   self.lineChartView.setVisibleXRange(minXRange: 2, maxXRange: Double(dataPoints.count))
   self.lineChartView.xAxis.granularityEnabled = true
   self.lineChartView.xAxis.granularity = 1

also the image of before zoom and after is attached.

.This is the image before zoom

This is the image after zoom,some value become identical.

Manish Kumar
  • 997
  • 2
  • 13
  • 30
  • You mean that the formatter you used is the same? Like you'd want to see also "Q1, Q2, Q3, Q4" for each year, instead of only the year? Do you have these different 4 values into you X Values Array? – Larme Oct 25 '21 at 14:35
  • As I shown in the second image,I want the year should not repeated on zooming.Every year on the x-axis should come one time only.@Larme – Manish Kumar Oct 25 '21 at 15:28
  • Might be you have granularityEnabled = false somewhere else i guess. – Rajneesh071 Dec 06 '21 at 13:20
  • you can pass chartView.setVisibleXRangeMinimum(someValue) – Rajneesh071 Dec 06 '21 at 13:28

0 Answers0