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

X axis labels get overlap and crowded when amount of data increase #737

Open
syedhadi209 opened this issue Oct 9, 2024 · 0 comments
Open

Comments

@syedhadi209
Copy link

syedhadi209 commented Oct 9, 2024

when the data is small the x axis label gets rendered correctly like this
image

but when the amount of data is large its show the x axis too conjusted and crowded
image

is there any way we can normalize the data or anything ?

<ScrollView> {validDataset.length > 0 ? ( <LineChart data={{ labels: labels, datasets: [ { data: validDataset.length > 0 ? validDataset : [0], }, { data: [-100], withDots: false, }, { data: [100], withDots: false, }, ], }} width={ smallGraph ? Dimensions.get('window').width - 260 : Dimensions.get('window').width - 25 } height={height} yAxisInterval={10} formatXLabel={formatDate} withHorizontalLabels={showYAxis} withVerticalLabels={smallGraph ? false : true} withVerticalLines={true} chartConfig={{ backgroundColor: 'transparent', backgroundGradientFrom: theme.custom.background.cards, backgroundGradientFromOpacity: 0, backgroundGradientTo: theme.custom.background.cards, backgroundGradientToOpacity: 0.5, decimalPlaces: 0, color: () => gradientColor, labelColor: () =>${theme.custom.text.secondary}, propsForBackgroundLines: { strokeWidth: '0', }, propsForDots: { r: smallGraph ? '0' : '5', strokeWidth: '1', stroke: gradientColor, }, }} bezier style={{ marginVertical: 0, borderRadius: 16, width: '100%', paddingRight: showYAxis ? 35 : 20, paddingBottom: height < 180 ? 18 : 0, marginTop: 0, }} /> ) : ( <View style={{ height: 50, display: 'flex', justifyContent: 'center', alignItems: 'center', }}> <Text>No data available</Text> </View> )} </ScrollView>

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