zoukankan      html  css  js  c++  java
  • echarts5 在vue3 中tooltip显示不出来

    const unwarp = (obj) => obj && (obj.__v_raw || obj.valueOf() || obj);
            unwarp(this.chart).setOption(this.getOption());
    <div id="app">
        <div id="chart-demo"></div>
    </div>
    <script>
    import { createApp } from 'vue';
    import * as echarts from "echarts";
    const unwarp = (obj) => obj && (obj.__v_raw || obj.valueOf() || obj);
     
    createApp({
        data(){
            return {
                chart:null
            }
        },
        mounted{
            let dom = document.getElementById("chart-demo");
            this.chart = echarts.init(dom);
            unwarp(this.chart).setOption(this.getOption());
        },
        methods:{
            getOption(){
                return {
                    xAxis: {
                        type: 'category',
                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                    },
                    yAxis: {
                        type: 'value'
                    },
                    tooltip:{},
                    series: [{
                        data: [150, 230, 224, 218, 135, 147, 260],
                        type: 'line'
                    }]
                };
            }
        }
    }).mount("#app");
    </script>

    转载:https://blog.csdn.net/xy109/article/details/113869790

    关注博客 https://www.cnblogs.com/aknife/
  • 相关阅读:
    Netty Nio启动全流程
    线性表
    java stream 原理
    SpringBoot 分布式session
    mockito
    RxJava
    HandlerMapping 详解
    SpringMVC 架构
    Spring Cloud 配置服务
    SpringBoot常用配置简介
  • 原文地址:https://www.cnblogs.com/aknife/p/14923500.html
Copyright © 2011-2022 走看看