Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scroll line disappearing only in android for line chart #692

Open
prabu-thanikachalam opened this issue Jul 2, 2024 · 0 comments
Open

Comments

@prabu-thanikachalam
Copy link

Hi,
If I use line chart inside scroll view the scroll line is disappearing if the screen scroll along with chart in android, please find below the code and let me know the solution,
import React, { useState} from 'react';
import { View, Text, ScrollView} from 'react-native';
import { LineChart } from 'react-native-gifted-charts';

export default function App() {

const lineData = [
{ value: 0, dataPointText: '0' },
{ value: 20, dataPointText: '20' },
{ value: 18, dataPointText: '18' },
{ value: 40, dataPointText: '40' },
{ value: 36, dataPointText: '36' },
{ value: 60, dataPointText: '60' },
{ value: 54, dataPointText: '54' },
{ value: 85, dataPointText: '85' },
{ value: 36, dataPointText: '36' },
{ value: 60, dataPointText: '60' },
{ value: 54, dataPointText: '54' },
{ value: 85, dataPointText: '85' },
{ value: 36, dataPointText: '36' },
{ value: 60, dataPointText: '60' },
{ value: 54, dataPointText: '54' },
{ value: 85, dataPointText: '85' },
];

return (

<View
style={{
paddingVertical: 30,
paddingLeft: 10,
backgroundColor: 'white',
flexWrap: 'wrap',
}}
accessible={false}
accessibilityElementsHidden={true}
>
<View style={{ flex: 1 }}>
<Text
style={{
fontFamily: 'Poppins-Regular',
width: 10,
fontSize: 10,
textAlign: 'left',
justifyContent: 'center',
alignSelf: 'center',
color: 'blue',
transform: [{ rotate: '90deg' }],
}}
>
INR

<LineChart
curved={true}
isAnimated={false}
pressEnabled={false}
showStripOnPress={true}
showTextOnPress={true}
data={lineData}
disableScroll={true}
pointerConfig={{
radius: 5,
pointerLabelComponent: () => {
return (

{'1234'}

);
},
}}
hideDataPoints
height={250}
initialSpacing={0}
color1="skyblue"
color2="orange"
textColor1="green"
dataPointsHeight={6}
dataPointsWidth={6}
dataPointsHeight2={6}
dataPointsWidth2={6}
dataPointsColor1="blue"
dataPointsColor2="red"
textShiftY={-2}
textShiftX={-5}
textFontSize={13}
hideRules
spacing={10}
areaChart
/>

<Text
style={{
fontFamily: 'Poppins-Regular',
color: '#808080',
fontSize: 80,
textAlign: 'center',
width: '80%',
}}
>
Time period

<Text
style={{
fontFamily: 'Poppins-Regular',
color: '#808080',
fontSize: 80,
textAlign: 'center',
width: '80%',
}}
>
Time period

<Text
style={{
fontFamily: 'Poppins-Regular',
color: '#808080',
fontSize: 80,
textAlign: 'center',
width: '80%',
}}
>
Time period

<Text
style={{
fontFamily: 'Poppins-Regular',
color: '#808080',
fontSize: 80,
textAlign: 'center',
width: '80%',
}}
>
Time period



);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant