김서영

pie chart

......@@ -2,8 +2,8 @@
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 14768,
"expoServerNgrokUrl": "https://x2-7pb.anonymous.searchguide.exp.direct",
"packagerNgrokUrl": "https://packager.x2-7pb.anonymous.searchguide.exp.direct",
"ngrokPid": 9336
"packagerPid": 14076,
"expoServerNgrokUrl": "https://7f-yzp.anonymous.searchguide.exp.direct",
"packagerNgrokUrl": "https://packager.7f-yzp.anonymous.searchguide.exp.direct",
"ngrokPid": 2900
}
......
......@@ -3,6 +3,6 @@
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": "x2-7pb",
"urlRandomness": "7f-yzp",
"https": false
}
......
......@@ -3,7 +3,7 @@ import { Text } from 'react-native-paper';
import { StyleSheet,View } from 'react-native';
export default PromptSearchRate = () => (
<View style={{alignItems:'center'}}>
<View style={{alignItems: 'center',justifyContent: 'center'}}>
<Text style={styles.Text}>아직까지 검색</Text>
<Text style={styles.Text}>결과가 없습니다!</Text>
</View>
......
import React,{ useState } from 'react';
import { Surface, Text ,HelperText} from 'react-native-paper';
import { StyleSheet,View } from 'react-native';
import { StackedBarChart } from 'react-native-svg-charts';
import { StackedBarChart, PieChart } from 'react-native-svg-charts';
import PromptSearchRate from '../PromptSearch/PromptSearchRate';
export default RateBar = (props) => {
......@@ -14,48 +14,53 @@ export default RateBar = (props) => {
<>
<View style={styles.container}>
<Text style={styles.Text}> 점수 : {props.score.full}</Text>
<View style={styles.colorContainer}>
<View style={styles.textContainer}>
<View style={styles.colorA}></View><Text>키워드 점수</Text>
</View>
<View style={styles.textContainer}>
<View style={styles.colorB}></View><Text>맞춤법 점수</Text>
</View>
<View style={styles.container}>
<Text style={styles.message}>눌러서 각각의 점수를 알아보세요!</Text>
</View>
<View style={styles.infoContainer}>
<HelperText type={'info'} visible={click==2} style={styles.helper}>맞춤법 : {props.score.fix}</HelperText>
<HelperText type={'info'} visible={click==1} style={styles.helper}>키워드 : {props.score.key}</HelperText>
</View>
<StackedBarChart
data={ [{
keyword: {
<View style={styles.chartContatiner}>
<View>
<PieChart
style={ styles.chart }
data={[{
value: props.score.key,
svg: {
svg:{
fill : '#e85a71',
onPressIn: () => {setClick(1)},
onPressOut: ()=>{setClick(0)}
},
key: "키워드"
},
korean: {
{
value: props.score.fix,
svg: {
fill : '#d8e9ef',
onPressIn: () => {setClick(2)},
onPressOut: ()=>{setClick(0)}
},
key: "맞춤법"
},
rest: {
{
value: (100-(props.score.key+props.score.fix)),
key : ""
}
}]}
style={{height:50, width:'90%'}}
keys={['keyword','korean','rest']}
colors={['#ffaa5a','#2cc3c2','#ffffff']}
showGrid={ false }
horizontal={ true }
contentInset={ { top: 10 } }
valueAccessor={({ item, key }) => item[key].value}
]}
innerRadius={"60%"}
/>
<View style={styles.infoContainer}>
<HelperText type={'info'} visible={click==1} style={styles.helper}>키워드 : {props.score.key}</HelperText>
<HelperText type={'info'} visible={click==2} style={styles.helper}>맞춤법 : {props.score.fix}</HelperText>
</View>
<Text style={styles.message}>눌러서 각각의 점수를 알아보세요!</Text>
<View style={styles.colorContainer}>
<View style={styles.textContainer}>
<View style={styles.colorA}></View><Text>키워드 점수</Text>
</View>
<View style={styles.textContainer}>
<View style={styles.colorB}></View><Text>맞춤법 점수</Text>
</View>
</View>
</View>
</>
: <PromptSearchRate />}
</Surface>
......@@ -73,10 +78,10 @@ const styles = StyleSheet.create({
},
colorContainer:{
position:"absolute",
right:0,
right:10,
},
colorA:{
backgroundColor:'#ffaa5a',
backgroundColor:'#e85a71',
height: 7,
width: 7,
marginRight: 5,
......@@ -84,13 +89,23 @@ const styles = StyleSheet.create({
fontSize: 13,
},
colorB:{
backgroundColor:'#2cc3c2',
backgroundColor:'#d8e9ef',
height: 7,
width: 7,
marginRight: 5,
fontFamily:"Regular",
fontSize: 13,
},
chartContatiner:{
flexDirection:'row',
justifyContent:"flex-start",
alignItems:'flex-start',
},
chart:{
height: 120,
width:"90%",
position:"absolute",
},
textContainer:{
flexDirection:'row',
justifyContent:'center',
......@@ -104,11 +119,13 @@ const styles = StyleSheet.create({
width: '100%'
},
surface: {
padding: 8,
flex: 0.3,
paddingTop: 8,
paddingBottom:5,
flex: 0.45,
width: '95%',
alignItems: 'center',
justifyContent: 'center',
flexDirection:'column',
alignItems: "center",
justifyContent: 'flex-start',
elevation: 2,
marginTop: 10,
borderRadius: 5,
......@@ -121,9 +138,10 @@ const styles = StyleSheet.create({
message:{
fontFamily:"Son",
fontSize: 20,
marginBottom: 10,
},
helper:{
fontFamily:"Regular",
fontFamily:"Bold",
fontSize:15
}
});
......
......@@ -39,7 +39,8 @@ const RateLine = ({load,pastRecords }) => {
const styles = StyleSheet.create({
surface: {
padding: 8,
paddingTop: 5,
paddingBottom:5,
flex: 0.3,
width: '95%',
alignItems: 'center',
......@@ -51,7 +52,7 @@ const styles = StyleSheet.create({
},
info:{
fontSize:22,
marginBottom: 5,
marginBottom: 10,
fontFamily:"Bold",
},
score:{
......@@ -61,7 +62,8 @@ const styles = StyleSheet.create({
scoreContainer:{
flexDirection:'row',
justifyContent: 'space-around',
width:'100%'
width:'100%',
backgroundColor :'#ececf8',
},
data:{
fontSize:10,
......@@ -69,6 +71,7 @@ const styles = StyleSheet.create({
fontFamily:"Regular",
},
past:{
backgroundColor :'#ececf8',
alignItems:'center',
marginBottom:5
},
......