我想在我使用 echarts.js (v1) ( https://ecomfe.github.io/ )构建的图表中将数字转换为土耳其里拉货币。你可以在下面看到我的图表和 echarts js 代码。
我的图表:
如您所见,数字无法快速读取。所以,我想将“49146729.18 TL”转换为“49.146.729,18 TL”。(在土耳其语中,我们使用“.”(点)分隔千位,使用“,”逗号分隔小数。)
这是我的 echarts.js 代码:
// based on prepared DOM, initialize echarts instance
var myChart = echarts.init(document.getElementById('Cirolar'));
// specify chart configuration item and data
var option = {
color: ['#ef6e6e'],
tooltip: {
formatter: '{c} TL',
},
grid: {
width: '100%',
left: '0%',
top: '1%',
bottom: '1%',
containLabel: true
},
xAxis: {
data: ["2017", "2016", "2015"]
},
yAxis: {
axisLine: {
show: false
},
axisLabel: {
show: false
},
axisTick: …Run Code Online (Sandbox Code Playgroud) 我的水平 FlatList 不会在模态中滚动。您可以在下面找到我的 FlatList 和 RenderItem 代码:
<FlatList
data={this.props.selectedGroupData.groupMembersList}
renderItem={this.ilgiliKisiler}
keyExtractor={item => item.uid}
nestedScrollEnabled={true}
horizontal={true}
removeClippedSubviews={true}
/>
</View>
Run Code Online (Sandbox Code Playgroud)
和 renderItem 函数:
ilgiliKisiler = ({ item }) => {
console.log("on Related Users item => ", item);
return (
<TouchableOpacity style={{flex: 1}}>
<View style={{ flexDirection: "row" }}>
<View style={styles.relatedUsersContainer}>
<View style={{ alignItems: "center" }}>
<Image
source={
item.avatar
? { uri: item.avatar }
: require("../../assets/images/defaultAvatar.png")
}
style={styles.relatedUsersImage}
/>
</View>
<View style={{ flexDirection: "column" }}>
<Text style={styles.relatedUsersText} numberOfLines={2}>
{item.name}
</Text>
</View>
</View>
</View>
</TouchableOpacity> …Run Code Online (Sandbox Code Playgroud) 首先,我正在使用React Native。我从Firebase获取数据,并想快速写入存储区(由Redux提供)。但这行不通。您可以在下面找到我的所有代码:
功能:
async getTumData (uid) {
const {selectedGroupDetail, getSelectedGroupDetail} = this.props;
var yeniGrupDetayi = {};
await firebase.database().ref("/groups/"+uid).once('value').then(
function(snapshot){
yeniGrupDetayi = {...snapshot.val(), uid: uid};
}).catch(e => console.log(e.message));
console.log("FONKSIYON ICERISINDEKI ITEM ==>", yeniGrupDetayi);
this.props.getSelectedGroupDetail(yeniGrupDetayi);
console.log("ACTION'DAN GELEN ITEM ===>", selectedGroupDetail);
}
Run Code Online (Sandbox Code Playgroud)
行动:
export const getSelectedGroupDetail = (yeniGrupDetayi) => {
return {
type: GET_SELECTED_GROUP_DETAIL,
payload: yeniGrupDetayi
}
};
Run Code Online (Sandbox Code Playgroud)
减速器:
case GET_SELECTED_GROUP_DETAIL:
return { ...state, selectedGroupDetail: action.payload}
Run Code Online (Sandbox Code Playgroud)
Ç?kt ?:
FONKSIYON ICERISINDEKI ITEM ==> {admin: {…}, groupDescription: "Yayg?n inanc?n tersine, Lorem Ipsum rastgele sözcü…erini inceledi?inde …Run Code Online (Sandbox Code Playgroud)