V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
littlepython
V2EX  ›  程序员

这个前端怎么显示不出来,有什么问题

  •  1
     
  •   littlepython · 2019-05-10 23:41:48 +08:00 · 1757 次点击
    这是一个创建于 1784 天前的主题,其中的信息可能已经有所发展或是发生改变。

    主要是显示圆里面按照比例分布 HTML 代码:

    <meta charset="UTF-8"> <title>Title</title> <script src="echarts.common.min.js" type="text/javascript"></script>
    <script type="text/javascript"> // 基于准备好的 dom,初始化 echarts 实例 var myChart = echarts.init(document.getElementById('main')); <pre><code>// 指定图表的配置项和数据 var option = { backgroundColor: '#2c343c', title: { text: 'Python', left: 'center', top: 20, textStyle: { color: '#ccc' } }, // 全局调色盘。 color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'], dataset: { source: [['5000 以下', 5], ['5000-7000', 3], ['7000-10000', 12], ['10000 以上', 62]] }, tooltip: { trigger: 'item', formatter: "{a} <br/>{b} : {c} ({d}%)" }, visualMap: { show: false, min: 80, max: 600, inRange: { colorLightness: [0, 1] } }, series: [ { name: '职位个数', type: 'pie', radius: '55%', center: ['50%', '50%'], label: { normal: { textStyle: { color: 'rgba(255, 255, 255, 0.3)' } } }, labelLine: { normal: { lineStyle: { color: 'rgba(255, 255, 255, 0.3)' }, smooth: 0.2, length: 10, length2: 20 } }, animationType: 'scale', animationEasing: 'elasticOut', animationDelay: function (idx) { return Math.random() * 200; } } ] }; // 使用刚指定的配置项和数据显示图表。 myChart.setOption(option); </code></pre> </script>
    4 条回复    2019-05-11 16:06:20 +08:00
    ntnyq
        1
    ntnyq  
       2019-05-11 09:36:33 +08:00   ❤️ 1
    注释掉了
    null2018
        2
    null2018  
       2019-05-11 11:53:45 +08:00   ❤️ 1
    那么问题来了,注释里写的基于准备好的 dom 初始化 echarts 实例,你的 dom 呢?
    littlepython
        3
    littlepython  
    OP
       2019-05-11 16:05:56 +08:00
    @null2018 弄好了 js 的版本用的是老版本
    littlepython
        4
    littlepython  
    OP
       2019-05-11 16:06:20 +08:00
    @ntnyq js 用了老版本
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2724 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 12:38 · PVG 20:38 · LAX 05:38 · JFK 08:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.