问题描述
import React from 'react'
import { LineChart,XAxis,YAxis } from 'react-native-svg-charts'
import { View,Text } from 'react-native'
import { Line,Circle,G,Rect,} from 'react-native-svg'
export default class Chart extends React.PureComponent {
handleFill = (value) => {
if (value>100){
return "rgba(190,30,45,0.5)"
}
else if (value>80 && value<=100){
return "yellow"
}
else{
return "#CCE6D0"
}
}
render() {
const data = [
...
];
const values = data.map(a => a.value);
const days = data.map(a => a.day);
const axesSvg = { fontSize: 10,fill: 'grey' };
const verticalContentInset = { top: 10,bottom: 10 }
const xAxisHeight = 30
const Decorator = ({x,y,data}) => {
return values.map((value,index) => (
<View>
<View style={{marginBottom:50}}>
<Rect
x={x(index)-1.75}
y={y(value+8)}
width="4"
height="40"
fill={this.handleFill(value)}
/>
</View>
<Circle
key={index}
cx={x(index)}
cy={y(value)}
r={2}
stroke={'#639123'}
fill={'#606060'}
/>
</View>
));
};
return (
<View>
<Text style={{fontSize:10}}>BPM</Text>
<View style={{ height: 200,flexDirection: 'row' }}>
<YAxis
...
/>
<View style={{ flex: 1,marginLeft: 10 }}>
<LineChart
...
>
<Decorator />
</LineChart>
<XAxis
....
/>
</View>
</View>
</View>
)
}
}
在这里,我使用它来从中心缩放图像,但是我的选择是从中心缩放图像并进行转换?除了缩放和翻译外,还有其他选择吗?我可以和每个移动画廊拥有相同的photoview吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)