title: iOS Charts Library - How to handle X-Axis duplicate values
body: <p>I have used Charts library by @danielgindi to generate the graph for my iOS application. All seems works fine but we are facing issue with X-Axis data duplication.</p>
  
  <p><strong>Input Data for Graph in (X-Axis-Value, Y-Axis-Value)</strong></p>
  
  <p>("29/03/2017 00:00:00","2.7")</p>
  
  <p>("29/03/2017 00:00:00","2.4")</p>
  
  <p>("29/03/2017 00:10:00","1.3")</p>
  
  <p>("29/03/2017 00:10:00","1.5")</p>
  
  <p>("29/03/2017 00:20:00","1.8")</p>
  
  <p>....</p>
  
  <p>....</p>
  
  <p>....</p>
  
  <p>("29/03/2017 01:00:00","1.2")</p>
  
  <p>("29/03/2017 09:00:00","2.7")</p>
  
  <p>("29/03/2017 09:10:00","-10.8")</p>
  
  <p>....</p>
  
  <p>....</p>
  
  <p>....</p>
  
  <p>("29/03/2017 13:10:00","3.9")</p>
  
  <p>("29/03/2017 13:20:00","-.8")</p>
  
  <p>("29/03/2017 13:20:00","5.9"</p>
  
  <p>Where X-Axis value is date time and Y Axis value is Double value associated to that date-time.</p>
  
  <p>I have used following code for the <strong>formatting X-Axis</strong></p>
  
  <pre><code>class ChartStringFormatter: NSObject, IAxisValueFormatter {
  
      public func stringForValue(_ value: TimeInterval, axis: AxisBase?) -&gt; String {
  
          let date = Date(timeIntervalSince1970: value)
          return date.toString(format: "hh:mm a")
      }
  }
  </code></pre>
  
  <p>But when I zoom the graph it has multiple values for X-Axis. How should I resolved this issues?</p>
  
  <p><strong>Expected Output For X Axis Value:</strong></p>
  
  <p>Initially - [12:00 AM, 03:00 AM, 06:00 AM, 09:00 AM, 12:00 PM, 03:00 PM, 06:00 PM, 09:00 PM, 12:00 PM]</p>
  
  <p>When Zoom - [12:00 AM, 01:00 AM, 02:00 AM, 03:00 AM ...... 12:00 PM]</p>
  
  <p>Again Zoom - [12:00 AM, 12:30 AM, 01:00 AM, 01:30AM, 02:00 AM, 02:30 AM, 03:00 AM ...... 12:00 PM]</p>
  
  <p>Again Again Zoom - [12:00 AM, 12:10 AM, 12:20 AM, 12:30 AM ...... 12:00 PM]</p>
  
  <p><strong><a href="https://www.dropbox.com/s/a0wtzpf7s35bo9j/sample.gif?dl=0" rel="nofollow noreferrer">Sample GIF file:</a></strong></p>
  
  <p>iOS Charts Library Link: <a href="https://github.com/danielgindi/Charts" rel="nofollow noreferrer">https://github.com/danielgindi/Charts</a></p>