更何况不过刚好 2022-02-11 12:55 采纳率: 86.4%
浏览 92
已结题

echart提示框有部分显示不出来

img


如图是我用echarts做的雷达图,需要提示框,但是因为数据较多,提示框超出去,无法显示内容,请问这应该怎么解决呢?

this.chartOption = {
            title: {
                text: '玫瑰图'
            },
            tooltip: {
                show: true,
                textStyle: {
                    color: '#fff'
                },
                backgroundColor: 'rgba(0,0,0,0.7)',
                formatter: (e) => {
                    let value = e.data.value;
                    let str = ``;
                    // let name = ['N', '北北西', '西北', '西西北', 'W', '西西南', '西南', '南南西', 'S', '南南东', '东南', '东东南', 'E', '东东北', '东北', '北北东',
                    // ]
                    value.forEach((item, index) => {
                        str += `<span>${this.name[index]}:${item}</span><br/>`
                    })
                    return str;
                }

            },
            legend: {
                data: ['风速玫瑰图'],
                show: false //不显示图例,
            },
            radar: {
                shape: 'circle',
                axisName: {
                    color: 'rgba(176,58,91,1)' //标签的样式
                },
                splitLine: {
                    lineStyle: {
                        color: [
                            'rgba(0,156,220, 0.1)',
                            'rgba(0,156,220, 0.2)',
                            'rgba(0,156,220, 0.4)',
                            'rgba(0,156,220, 0.6)',
                            'rgba(0,156,220, 0.8)',
                            'rgba(0,156,220, 1)'
                        ].reverse(),
                        type: 'dashed' //虚线
                    } //每层圆圈的样式
                },
                splitArea: {
                    show: false //不显示划分每个区域的样式
                },
                indicator: [
                    { name: 'N', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: 'W', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: 'S', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: 'E', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 },
                    { name: '', max: 100 }
                ],
                center: ['50%', '56%'], //玫瑰图相对于容器的宽高
                axisLine: {
                    lineStyle: {
                        color: 'rgba(0,156,220, 0.5)', //由圆点往外的线的样式
                        type: 'dashed' //虚线
                    }
                }
            },
            series: [
                {
                    name: 'Budget vs spending',
                    type: 'radar',
                    data: [
                        {
                            // value: [5000, 4500, 20000, 3000, 40089, 21000, 5000, 14000, 28000, 26000, 42000, 21000],
                            value: this.data,
                            name: '风速玫瑰图'
                        }
                    ],
                    itemStyle: {
                        color: 'rgb(176,58,91)' //线的样式
                    },
                    areaStyle: {
                        color: 'rgba(176,58,91,0.6)'
                    },
                    lineStyle: {
                        //线的长度
                        width: 1
                        // opacity: 0.5
                    },
                    symbol: 'none' //让拐点消失
                }
            ]
        };

  • 写回答

1条回答 默认 最新

  • 一只成序源 2022-02-11 13:47
    关注

    tooltip:{
    confine:true
    }
    tooltip中加上这个属性

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 2月19日
  • 已采纳回答 2月11日
  • 创建了问题 2月11日

悬赏问题

  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来