SwiftCharts icon indicating copy to clipboard operation
SwiftCharts copied to clipboard

Panning issue

Open ThomasJomphe opened this issue 7 years ago • 2 comments

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...

ThomasJomphe avatar Apr 26 '18 18:04 ThomasJomphe

Any suggestions ???

ThomasJomphe avatar May 14 '18 18:05 ThomasJomphe

Sorry for the late response... take a look at this example:

https://github.com/i-schuetz/SwiftCharts/blob/master/Examples/Examples/CustomUnitsExample.swift#L119

ivnsch avatar May 21 '18 08:05 ivnsch