react-native-chart-wrapper <BarChart> Zoom out issue after pinch to zoom

315 Views Asked by At

After Pinch to zoom, I am unable to reset zoom while replacing new data

import { BarChart } from 'react-native-charts-wrapper'; 
 <BarChart                                
                style={styles.grpBarChartStyle}
                                    xAxis={this.state.grpBarChartxAxis}
                                    data={this.state.grpBarChartdata}
                                    legend={this.state.grpBarChartlegend}
                                    drawValueAboveBar={false}
                                    onSelect={this.handleSelect.bind(this)}
                                    highlights={this.state.highlights}
                                    marker={this.state.marker}
                                    chartDescription={{
                                        text: ''
                                    }}
                                />

I tries for xAxis and yAxis but that is change the size of whole chart, and I want to zoom out the inner chart

1

There are 1 best solutions below

0
Toufique Hasan Hemel On

Try with setting pinchZoom={false}

<BarChart
  pinchZoom={false}
  style={styles.grpBarChartStyle}
  xAxis={this.state.grpBarChartxAxis}
  data={this.state.grpBarChartdata}
  legend={this.state.grpBarChartlegend}
  drawValueAboveBar={false}
  onSelect={this.handleSelect.bind(this)}
  highlights={this.state.highlights}
  marker={this.state.marker}
  chartDescription={{
    text: "",
  }}
/>;