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

Add axis name #598

Closed
ChauVV opened this issue Apr 9, 2024 · 1 comment
Closed

Add axis name #598

ChauVV opened this issue Apr 9, 2024 · 1 comment

Comments

@ChauVV
Copy link

ChauVV commented Apr 9, 2024

How can i add Axis name like this

image

@Abhinandan-Kushwaha
Copy link
Owner

Hi @ChauVV
Thanks for requesting this feature. I will add it in the next release.

For now, I can suggest you a workaround. Try adding Text with position absolute. Here's an example-

const data= [
  {value:10, label:'2'},
  {value:15, label:'3'},
  {value:18, label:'4'},
  {value:15, label:'5'},
  {value:12, label:'6'},
  {value:8, label:'7'},
]
return(
  <View style={{marginTop:20}}>

    <LineChart
      data={data}
    />

    <View style={{position:'absolute',top:-20,left:16}}>
      <Text>Wh</Text>
    </View>

    <View style={{position:'absolute',bottom:12,right:32}}>
      <Text>Days</Text>
    </View>
    
  </View>
)

Output-

Screenshot 2024-04-09 at 11 44 50 AM

@ChauVV ChauVV closed this as completed Apr 12, 2024
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

2 participants