aotushijie
2022-06-21 13:13
采纳率: 60%
浏览 33
已结题

echarts图片颜色是黑色


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.2.1-rc1/echarts.min.js"></script>
</head>
<body>
    <div id="main" style='width: 600px;height:400px;'></div>
     <script type="text/javascript">
        var main = echarts.init(document.getElementById("main"));

         var option = {
              backgroundColor: '#2c343c',
              title: {
                text: '电影票房',
                left: 'center',
                top: 20,
                textStyle: {
                  color: '#ccc'
                }
              },
              tooltip: {
                trigger: 'item'
              },
              visualMap: {
                show: false,
                min: 10000000,
                max: 190000000,
                inRange: {
                  colorLightness: [0, 1]
                }
              },
              series: [
                {
                  name: '票房',
                  type: 'pie',
                  radius: '55%',
                  center: ['50%', '50%'],
                  data: {{data|tojson}}.sort(function (a, b) {
                    return a.value - b.value;
                  }),
                  roseType: 'radius',
                  label: {
                    color: 'rgba(255, 255, 255, 0.3)'
                  },
                  labelLine: {
                    lineStyle: {
                      color: 'rgba(255, 255, 255, 0.3)'
                    },
                    smooth: 0.2,
                    length: 10,
                    length2: 20
                  },
                  itemStyle: {
                    color: '#',
                    shadowBlur: 200,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  },
                  animationType: 'scale',
                  animationEasing: 'elasticOut',
                  animationDelay: function (idx) {
                    return Math.random() * 200;
                  }
                }
              ]
            };

         main.setOption(option);
    </script>

</body>
<html>

img


怎么改啊,我最大值和最小值都改了还是黑色

图片转代码服务由CSDN问答提供 功能建议

 6.5
 亲情822009764.0
 传记:910809311.0
 冒险:1000875629.42
 车事870325439.0
 作1189122265.2
 动画:1052387035.05
 喜剧,1033546414.2
 奇:985373904.43
 家庭:792910554.6
 惊997466321.0
 战争:920848842.17
 抢战994625509.0
 灾难,1496432545.0
 爱情1515697459.0
 犯罪1126147250.33
 科幻1221523804.16
 音乐:9108093110

1条回答 默认 最新

相关推荐 更多相似问题