epezent / implot

Immediate Mode Plotting
MIT License
4.55k stars 503 forks source link

How to customize interaction of the plot drawn by the `ImPlot`? #495

Closed autra-tech-zhanghao closed 1 year ago

autra-tech-zhanghao commented 1 year ago

Hi, I want to rewrite some interaction logic of the plot. For example, a line chart which can not zoom on x direction but still can in y direction. I found that there is the Flag ImPlotFlags_NoInputs that can disable the default behavior of the plot, but as it says, it also can't receive any input event so my custom interaction logic can't be called either. Is there any other way? Thanks a lot~

epezent commented 11 months ago

Hi, you can use ImPlotAxisFlags_Lock with SetupAxis on the x-axis to prevent scroll wheel zoom for this axis only.