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,
                    },
                ],
            };
  • 相关阅读:
    Setting the Scope of COM Objects in ASP Pages
    不注册调用ActiveX Dll
    完成端口>TransmitFile 和 TransmitPackets (收集)
    浅谈网络游戏《天龙X部》的文件加密格式
    防止被偷窥和修改 Office文档保护秘笈
    oracle日期时间函数大全
    (C#)Windows Shell 外壳编程系列5 获取图标
    在Delphi中关于UDP协议的实现
    《黑手党2》全部50本花花公子杂志收集攻略
    TThread —— 线程类详解
  • 原文地址:https://www.cnblogs.com/zwjun/p/15711231.html
Copyright © 2011-2022 走看看