To add interactivity to the graph data
- you need a view with pan gesture
Need to subclass CombinedChartView, LineChartRenderer, BubbleChartRenderer
Create the Renderer objects, - this renderer objects needed to be replaced by the renderers created in CombinedChartView, Hence we subclass it and replace the renderer objects with that of our subclassed version.
In our CombinedChartView(subclass) override the getter,setter of the data variable, Hence while assigning the data, we create our UIView once with Pan gesture, take a reference of it's corresponding ChartDataEntry in UIView, Hence in UIView's Pan handler function we change this DataEntry's xIndex etc and call setNeedsDisplay.(UIView's frame position is not know yet, keep it all at origin)
In our Renderer class (subclass of LineChartRenderer or BubbleChartRenderer) override the DrawDataSet function -this is where the actual drawing happens, this is the place where we could get the exact x,y co-ordinates for our UIView, We finally set the frame position for the views created in CombinedChartView.
That's it, when we pan the UIView, the view will pan and in-turn move the xIndex of the ChartDataEntry