lets-plot-skia icon indicating copy to clipboard operation
lets-plot-skia copied to clipboard

Supports modifying the X and Y scale values, does the view automatically update?

Open changhexuefei opened this issue 11 months ago • 3 comments

Hello, I want to be able to modify the coordinate scale value when clicking on the X and Y coordinate axes, and the curve chart will automatically change with the modification of the coordinate scale. Is this requirement currently supported?

changhexuefei avatar Jan 14 '25 03:01 changhexuefei

Hi! That sounds like zooming/panning. Or do you mean something more complex - like getting areas/coordinates that the user selects/clicks?

IKupriyanov-HORIS avatar Jan 15 '25 17:01 IKupriyanov-HORIS

Hello, I want to achieve this effect, as shown in the video。

https://github.com/user-attachments/assets/865d3761-0dc9-415d-ae59-a7ff70588968

changhexuefei avatar Jan 16 '25 01:01 changhexuefei

Unfortunatley, such functionality is not available out of the box. But you can achieve similar behavior by defining two variables - ymax, ymin and UI elements that will modify these variables. Then the ylim parameter in the coordCartesian can be used to adjust the "viewport" of the plot.

Check out this demo - I think it's pretty close to your goal (note that ylim() won't fit your needs, as it's a scale limit that drops data out of bounds, you need a coordinate system limit).

IKupriyanov-HORIS avatar Jan 16 '25 21:01 IKupriyanov-HORIS