EChartsPage.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import React, { Component } from 'react';
  2. import {
  3. StyleSheet,
  4. View,
  5. FlatList, Image,
  6. } from 'react-native';
  7. import BIChartsItem from "../commons/bi/BIChartsItem";
  8. import BasePage from "./BasePage";
  9. export default class EChartsPage extends BasePage {
  10. static navigationOptions = {
  11. headerBackImage:(
  12. <View style={{marginLeft:18}}>
  13. <Image
  14. source={{uri: 'uu_back-icon'}}
  15. style={{ width: 12, height: 20,marginRight:6}}
  16. />
  17. </View>
  18. ), //使用组件
  19. }
  20. constructor(props){
  21. super(props);
  22. this.state={
  23. dataArray:['line','bar','pie'],
  24. }
  25. }
  26. renderItem(data){
  27. return <BIChartsItem
  28. typeTitle = {data.item}
  29. />
  30. }
  31. render() {
  32. return (
  33. <View style={styles.container}>
  34. <FlatList
  35. data={this.state.dataArray}
  36. keyExtractor={item => "" + (item.item)}
  37. renderItem = {data=>this.renderItem(data)}
  38. />
  39. </View>
  40. );
  41. }
  42. }
  43. const styles = StyleSheet.create({
  44. container: {
  45. flex:1,
  46. backgroundColor: '#efefef',
  47. },
  48. title:{
  49. color:'white',
  50. fontSize:20,
  51. textAlign:'center',
  52. },
  53. });