rrag / react-stockcharts

Highly customizable stock charts with ReactJS and d3
http://rrag.github.io/react-stockcharts
MIT License
3.88k stars 958 forks source link

Using Clamp with two finger interaction #767

Closed khaphannm closed 4 years ago

khaphannm commented 4 years ago

Hi everyone, When I enabled the Clamp function for the Chart, on mobile web browser, I can swift by one finger to zoom on x axis. But the deal is now I want to perform this action only when using two finger.

What I did by far was detect two finger using ontouchstart event, and set the state to toggle the clamp function as below: `<ChartCanvas styles={{overflow: 'hidden'}} ref={node => {this.canvas=node;}} width={width} height={mainChartHeight} minPointsPerPxThreshold={0.02} ... clamp={twoFingerTouch}

`

As a result, still cannot use clamp function for zooming when move the two finger to the left after state has been updated successfully. Does anyone have idea about that ? Pls help