zoukankan      html  css  js  c++  java
  • echart 样式修改

     坐标轴,字体颜色,如下:
    const option = {
                tooltip: {
                    show: true,
                    trigger: 'axis',
                    backgroundColor: "#fff",
                    textStyle: {
                        color: "#333333",
                    },
                    axisPointer: {
                        type: 'shadow',
                    },
                    formatter: function (params) {
                        const res = {}
                        params.map(item => {
                            res.name = item.name,
                                res.color = item.color,
                                res.value = item.value,
                                res.ratio = parseInt(item.value * 100 / calculateData.totalArea)

                        })
                        return `<div style="background:#fff; padding:0 10px 0 5px">
                        <p>${res.name}</p>
                        <p>
                         <i style='display: inline-block; 10px; height: 10px; background:${res.color}; margin-right: 5px; border-radius: 50%'></i>
                        <span style="padding-left:4px">面积:${res.value}m<sup>2</sup></span>
                        </p>            
                        <span style="padding-left:20px">占比:${res.ratio}%</span>
                        </div>`
                    },

                },
                xAxis: {
                    type: 'category',
                    data: dataX,
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#fff'
                        }
                    },
                    axisLine: {
                        lineStyle: {
                            type: 'solid',
                            color: '#0A55EB',
                        }
                    },
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        // formatter: '{value}',
                        textStyle: {
                            color: '#fff'
                        }
                    },
                    splitLine: { show: false },
                    axisLine: {
                        lineStyle: {
                            type: 'solid',
                            color: '#0A55EB',
                        }
                    },
                },
                series: [
                    {
                        name: '面积',
                        type: 'bar',
                        barWidth: '40%',
                        data: seriesDataTemp,
                    },
                ],
            };
  • 相关阅读:
    Twitter注册
    iOS项目的完整重命名方法图文教程
    加载gif动态图的三种方式
    只 一行显示可左右滚动的文本(UITextField中文限制)
    iOS学习资料链接
    GCD常用方法
    移动端轮播完整版css3加原生写法
    zepto-touch.js插件
    移动端续讲及zepto移动端插件外加touch插件介绍
    解决ios和Android的差异
  • 原文地址:https://www.cnblogs.com/zwjun/p/15711231.html
Copyright © 2011-2022 走看看