import React, {useState} from 'react'; import {TouchableOpacity} from 'react-native'; import {Alert} from 'react-native'; import {View, Text, StyleSheet} from 'react-native'; import {BarChart, LineChart} from './src'; const App = () => { const [toggle, setToggle] = useState(true); const [data, setData] = useState([ {value: 15, label: 'Jan'}, { value: 40, label: 'Feb', verticalLineColor: 'red', // showVerticalLine: true, verticalLineThickness: StyleSheet.hairlineWidth, }, { value: 10, label: 'Mar', }, { value: 30, label: 'Apr', }, {value: 20, label: 'May'}, {value: 40, label: 'Jun'}, {value: 48, label: 'Jul'}, {value: 30, label: 'Aug'}, {value: 20, label: 'Sep'}, {value: 40, label: 'Oct'}, { value: 48, label: 'Nov', onPress: () => Alert.alert('Sales in Nov skyrocketed to $48 M'), }, {value: 30, label: 'Dec'}, ]); return ( {!toggle ? ( ) : ( { // return ( // // ); // }} // focusedCustomDataPoint={() => { // return ( // // ); // }} // onPress={(item, index) => { // console.log('index-->', index); // setData(data => { // item.focusedCustomDataPoint = () => { // return ( // // ); // }; // data[index] = item; // console.log('data------.....', data); // return data; // }); // }} // disableScroll pressEnabled // showDataPointOnPress showStripOnPress showTextOnPress textShiftY={-10} textShiftX={-5} textFontSize={18} textColor={'green'} stripWidth={1} // stripHeight={200} // stripHeight={200} stripOpacity={1} curved isAnimated animationDuration={2000} // animationDuration={2000} // dataPointsShape="rectangular" // showGradient color={'rgb(78, 0, 142)'} yAxisColor={'rgb(78, 0, 142)'} xAxisColor={'rgb(78, 0, 142)'} // dataPointsColor={'yellow'} dataPointsWidth={22} dataPointsHeight={22} xAxisThickness={3} yAxisThickness={3} dataPointsRadius={4} focusedDataPointRadius={10} yAxisTextStyle={{color: 'rgb(78, 0, 142)'}} startFillColor={'rgb(200, 100, 244)'} startOpacity={0.9} endFillColor={'rgb(255, 255, 255)'} endOpacity={0.2} /> )} setToggle(!toggle)} style={{marginTop: 100, alignSelf: 'center'}}> Line Chart ); }; export default App;