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,
                    },
                ],
            };
  • 相关阅读:
    XTU 1250 Super Fast Fourier Transform
    XTU 1249 Rolling Variance
    XTU 1243 2016
    CodeForces 710A King Moves
    CodeForces 710B Optimal Point on a Line
    HDU 4472 Count
    并查集
    高精度四件套
    Kruskal最小生成树
    [蓝桥杯]翻硬币(贪心的详解附带题目测试链接)
  • 原文地址:https://www.cnblogs.com/zwjun/p/15711231.html
Copyright © 2011-2022 走看看