So, I finally got it to work, and wanted to add it to the community. Here's what my chart looks like:

When you drag your finger along the graph, the reader above moves and reads the value from the diagram.
For this to work, I had to do the following:
In the file that you are implementing the graph, be sure to include ChartViewDelegate
Then we implement the chartValueSelected method.
If you then use the getMarkerPosition method, you can center your βmarkerβ wherever you want.
Here is a sample code:
class MarkerView: UIView { @IBOutlet var valueLabel: UILabel! @IBOutlet var metricLabel: UILabel! @IBOutlet var dateLabel: UILabel! } let markerView = MarkerView() func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight) { let graphPoint = chartView.getMarkerPosition(entry: entry, highlight: highlight)
markerView is an xib that I manually added to the main view, which also contains a graphical view. markerView is a UIView containing three labels. These are 3.0, impressions and Apr, which you see in the picture.
graphPoint is a CGPoint located on a graph. You can use x and y for graphPoint to move your markerView . Here, I just saved the y value of the markerView and changed its x value to make it move forward and backward when touched.
Rob norback
source share