generated from nishkohli96/rn-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d34668d
commit 2f6bd8f
Showing
8 changed files
with
612 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import { | ||
VictoryBar, | ||
VictoryChart, | ||
VictoryTheme, | ||
VictoryLabel, | ||
} from 'victory-native'; | ||
import { ThemedContainer, ThemedBody, ThemedCard } from '_Shared/Comps.themed'; | ||
import Header from '_Shared/Header'; | ||
|
||
const data = [ | ||
/* Label is optional */ | ||
{ quarter: 1, earnings: 13000, label: 'Q1' }, | ||
{ quarter: 2, earnings: 16500, label: 'Q2' }, | ||
{ quarter: 3, earnings: 14250, label: 'Q3' }, | ||
{ quarter: 4, earnings: 19000, label: 'Q4' }, | ||
]; | ||
|
||
const VictoryBarChart = () => { | ||
return ( | ||
<ThemedContainer> | ||
<Header title="Bar Chart" openDrawer /> | ||
<ThemedBody> | ||
<ThemedCard> | ||
<VictoryChart width={350} theme={VictoryTheme.material}> | ||
<VictoryBar | ||
style={{ data: { fill: '#c43a31' } }} | ||
data={data} | ||
x="quarter" | ||
y="earnings" | ||
labelComponent={ | ||
<VictoryLabel | ||
dy={-20} | ||
backgroundStyle={{ | ||
fill: 'gold', | ||
opacity: 0.6, | ||
}} | ||
backgroundPadding={{ bottom: 5, top: 5 }} | ||
/> | ||
} | ||
/> | ||
</VictoryChart> | ||
</ThemedCard> | ||
</ThemedBody> | ||
</ThemedContainer> | ||
); | ||
}; | ||
|
||
export default VictoryBarChart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.