鍍金池/ 問答/HTML/ echarts怎么自適應和修改移動端fontsize

echarts怎么自適應和修改移動端fontsize

  option1 = {
        title: [
            {
                text: 'Part 1',
                left: "49%",
                top: '34%',
                textAlign: 'center',
                textStyle: {
                    color: '#333333',
                    fontWeight: 'bold',
                    fontSize: '170%'
                }
            },
            {
                text: '財務規(guī)劃,\n績效和控制',
                left: "49%",
                top: '44%',
                textAlign: 'center',
                textStyle: {
                    color: '#333333',
                    fontWeight: 'bold',
                    fontSize: '100%',
                }
            }, {
                text: 'Financial Reporting ,\nPlanning,Performance\nand Control',
                left: "49%",
                top: '54%',
                textAlign: 'center',
                textStyle: {
                    color: '#333333',
                    fontSize: 10
                }
            }
        ],
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>:(tl7fxrl%)"
        },
        itemStyle: dataStyle,
        roseType: 'angle',
        series: [{
            name: '',
            type: 'pie',
            hoverOffset: 40,
            radius: ['43%', '100%'],
            color: ['#32e0f0', '#54caf6', '#1d7fe4'],
            label: {
                normal: {
                    show: false,
                    textStyle: {
                        color: "#fff",
                        fontSize: 18
                    },
                    position: 'inner'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        color: "#fff",
                        fontSize: 18
                    },
                    position: 'inner'
                }
            },
            tooltip: {
                show: false
            },
            data: [{
                value: 20,
                name: '20%\n成本管理'
            }, {
                value: 20,
                name: '20%\n績效管理'
            }, {
                value: 15,
                name: '15%\n對外財務\n報告決策'
            }, {
                value: 15,
                name: '15%\n內部控制'
            }, {
                value: 30,
                name: '30%\n規(guī)劃預算\n編制與預測'
            }],
            animationType: 'scale',
            animationEasing: 'elasticOut',
            animationDelay: function (idx) {
                return Math.random() * 200;
            }
        }]
    };

clipboard.png
現(xiàn)在也沒寫自適應 需要刷新
還有怎么移動端修改文字的大小呢

回答
編輯回答
久愛她
    var myChart = echarts.init(document.getElementById('myChart'));

    myChart.setOption(option1, true);

    window.onresize = myChart.resize;

試試這樣可行?

2017年6月16日 00:05