Panning issue
I have a little problem with panning in a chart... This is my code :
// Get previous chart attributes var scaleX = (oldChart?.scaleX)! var scaleY = (oldChart?.scaleY)! var transX = (oldChart?.transX)! var transY = (oldChart?.transY)! // Zoom and pan in the new chart to have the same than the previous newChart.zoom(scaleX: scaleX, scaleY: scaleY) newChart.pan(x: transX, y: transY, elastic: true)
The new chart have the same dimensions than the old one, so it should be working.
All works fine, but only the vertical alignment in the panning don't work... Each time I execute that code, the chart jumps to the top, and bottom, and top, and bottom of the chart.... It goes back to the same position at every 2 executions of that code. What I do wrong ? or maybe it's a bug ?
Thanks...
Any suggestions ???
Sorry for the late response... take a look at this example:
https://github.com/i-schuetz/SwiftCharts/blob/master/Examples/Examples/CustomUnitsExample.swift#L119