Fix x axis cutting off for some charts

Closes #119
This commit is contained in:
Brandon Presley 2022-11-23 21:49:27 +13:00
parent 62ca3ef1c4
commit b504de45a2
1 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,12 @@ export default function Chart({
return ( return (
<> <>
<View style={{height: 300, padding: PADDING, flexDirection: 'row'}}> <View
style={{
height: 300,
padding: PADDING,
flexDirection: 'row',
}}>
<YAxis <YAxis
data={yData} data={yData}
style={{marginBottom: xAxisHeight}} style={{marginBottom: xAxisHeight}}
@ -51,10 +56,9 @@ export default function Chart({
<Grid /> <Grid />
</LineChart> </LineChart>
<XAxis <XAxis
style={{marginHorizontal: -10, height: xAxisHeight}}
data={xData} data={xData}
formatLabel={xFormat} formatLabel={xFormat}
contentInset={{left: 10, right: 10}} contentInset={{left: 15, right: 16}}
svg={axesSvg} svg={axesSvg}
/> />
</View> </View>