0

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.

4
  • 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? Commented Oct 25, 2021 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 Commented Oct 25, 2021 at 15:28
  • Might be you have granularityEnabled = false somewhere else i guess. Commented Dec 6, 2021 at 13:20
  • you can pass chartView.setVisibleXRangeMinimum(someValue) Commented Dec 6, 2021 at 13:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.