Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

How to make Victory Native chart have more natural scrolling

$
0
0

I have a basic bar graph chart that allows panning. The only problem is there is no momentum scrolling. In other words, when you scroll and release your finger, it stops scrolling immediately, which is not natural. How can I enable this?

  const getContainerComponent = () => {    return (<VictoryZoomContainer             allowZoom={false}            allowPan={true}            zoomDimension="x"            zoomDomain={{x: [props.data.length - 7, props.data.length]}}            minimumZoom={{x: 1}}            clipContainerComponent={<VictoryClipContainer />}          />    )  }  return ( <VictoryChart       theme={theme}      minDomain={{ y: 0 }}      containerComponent={ getContainerComponent() }      domainPadding={{ x : [10, 10] }}><VictoryAxis         dependentAxis         tickFormat={(t: number) => `${Math.round(t)}`}        crossAxis={false}      /><VictoryAxis        tickLabelComponent={ <VictoryLabel dy={10} />}       /><VictoryBar         data={arrayOfData}         x="timePeriod"        y="amount"        alignment="middle"        barWidth={25}        cornerRadius={{ top:12, bottom: 12 }}        /></VictoryChart>   )

Chart


Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>