zoukankan      html  css  js  c++  java
  • react 中echarts-for-react使用 自适应div

    import * as React from 'react'
    import ReactEcharts from 'echarts-for-react'
    
    export interface IProps {
    
    }
    interface IState {
       
    }
    
    class CapitalBudget extends React.Component<IProps, IState> {
      
        constructor(props: IProps) {
            super(props)
           
        }
    
        getOption () {
            return {
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    axisLabel: {
                        formatter: '{value} 年'
                    },
                    axisTick: {
                        alignWithLabel: true
                    },
                    data: ['2012', '2013', '2014', '2015', '2016', '2017', '2018']
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value} 万'
                    },
                },
                series: [{
                    data: [820, 932, 901, 934, 1290, 1330, 1320],
                    type: 'line'
                }]
            }
        }
        render() {
        
            return (
               
                <React.Fragment>  
                    <ReactEcharts
                        option={this.getOption()}
                        
                        style={{ '100%', height: '238px'}}
                    />
                </React.Fragment> 
            )
        }
    }
    
    export default CapitalBudget
    

      

  • 相关阅读:
    加工零件(Dijkstra)
    尼克的任务(DP)
    挖地雷(记忆化搜索)
    滑雪(DP,记忆化搜索)
    子串和子序列(DP)
    八皇后(DFS)
    打印feign报错日志
    restTemplate 踩坑
    共享全局对象
    获取当月多少天
  • 原文地址:https://www.cnblogs.com/whlBooK/p/11174199.html
Copyright © 2011-2022 走看看