码迷,mamicode.com
首页 > 其他好文 > 详细

echart 打开新世界的大门

时间:2018-10-25 14:09:58      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:gradient   arm   ges   vgs   aac   and   uga   gas   VUCA   

实时折线图

option = {
    backgroundColor:‘#2B2B2B‘,
    tooltip: {
        trigger: ‘axis‘
    },
    legend: {
        data:[‘频率‘],
        textStyle:{
            color:‘#FFF‘,
            fontSize:20
        }
    },
    xAxis:  {
        type: ‘category‘,
        boundaryGap: false,
        splitLine:{
            show:true,
            lineStyle:{
                type:‘dotted‘
            }
        },
        axisLabel:{
            textStyle:{
                color:‘#FFF‘,
                fontSize:20
            }
        },
        axisLine:{
            lineStyle:{
                color:‘#FFF‘
            }
        },
        data: [‘00:00‘,‘01:00‘,‘02:00‘,‘03:00‘,‘04:00‘,‘05:00‘,‘06:00‘,‘07:00‘,‘08:00‘,‘09:00‘,‘10:00‘,‘11:00‘,‘12:00‘,‘13:00‘,‘14:00‘,‘15:00‘,‘16:00‘,‘17:00‘,‘18:00‘,‘19:00‘,‘20:00‘,‘21:00‘,‘22:00‘,‘23:00‘,‘23:59‘]
    },
    yAxis: {
        type: ‘value‘,
        axisLabel: {
            formatter: ‘{value} Hz‘,
            textStyle:{
                color:‘#FFF‘,
                fontSize:20
            }
        },
        min:48.75,
        max:51.25,
        axisLine:{
            lineStyle:{
                color:‘#FFF‘
            }
        },
        splitLine:{
            show:true,
            lineStyle:{
                type:‘dotted‘
            }
        }
    },
    series: [
        {
            name:‘频率‘,
            type:‘line‘,
            symbol:‘circle‘,
            itemStyle:{
                normal:{
                    color:‘#00FF00‘
                }
            },
            data:[],
            markPoint: {
                symbolSize:1,
                data: [
                    {type: ‘max‘, name: ‘最大值‘,itemStyle:{normal:{color:‘#00FF00‘}}},
                    {type: ‘min‘, name: ‘最小值‘,itemStyle:{normal:{color:‘#00FF00‘}}}
                ],
                label:{normal:{textStyle:{color:‘#00ff00‘,fontSize:25}}}
            },
            lineStyle:{
                normal:{
                    color:‘#00FF00‘,
                    width:3
                }
            },
            markLine: {
                lineStyle:{
                    normal:{
                        type:‘solid‘,
                        width:2
                    }
                },
                data: [
                    {type: ‘average‘, name: ‘平均值‘,itemStyle:{normal:{color:‘#FFFFFF‘}}}
                ],
                label:{normal:{textStyle:{color:‘#FFF‘,fontSize:20}}}
            }
        },
        {
            name:‘最大值‘,
            type:‘line‘,
            symbol:‘circle‘,
            symbolSize:1,
            itemStyle:{
                normal:{
                    color:‘red‘
                }
            },
            lineStyle:{normal:{width:2}},
            data:[51, 51, 51, 51, 51, 51, 51,51,51,51,51,51,51,51, 51, 51, 51, 51, 51, 51,51,51,51,51,51,51],
            
        },
        {
            name:‘最小值‘,
            type:‘line‘,
            symbol:‘circle‘,
            symbolSize:1,
            itemStyle:{
                normal:{
                    color:‘red‘
                }
            },
            lineStyle:{normal:{width:2}},
            data:[49, 49, 49, 49, 49, 49, 49,49,49,49,49,49,49,49, 49, 49, 49, 49, 49, 49,49,49,49,49,49,49],
            
        }
    ]
};

var index=0;
setInterval(function () {
    if (index<=24) {
        option.series[0].data.push(Math.random().toFixed(2) * 2+49);
    } else {
        option.series[0].data=[];
        index=0;
    }
    index++;
    myChart.setOption(option, true);
},1000);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>echart学习</title>
</head>
<body>

     
 <p>------------------------</p>
 
  <div id="main2" style="height:400px"></div>   
 
 
<!--   
     <script src="js/echarts-all.js" charset="utf-8"></script>-->
<script src="https://cdn.bootcss.com/echarts/3.8.5/echarts-en.common.js"></script>
<script type="text/javascript">
      
      

  
  
    var myChart22 = echarts.init(document.getElementById(‘main2‘)); 
  var option22 = {
    backgroundColor: ‘#2B2B2B‘,
    tooltip: {
        trigger: ‘axis‘
    },
    legend: {
        data: [‘频率‘],
        textStyle: {
            color: ‘#FFF‘,
            fontSize: 20
        }
    },
    xAxis: {
        type: ‘category‘,
        boundaryGap: false,
        splitLine: {
            show: true,
            lineStyle: {
                type: ‘dotted‘
            }
        },
        axisLabel: {
            textStyle: {
                color: ‘#FFF‘,
                fontSize: 20
            }
        },
        axisLine: {
            lineStyle: {
                color: ‘#FFF‘
            }
        },
        data: [‘00:00‘, ‘01:00‘, ‘02:00‘, ‘03:00‘, ‘04:00‘, ‘05:00‘, ‘06:00‘, ‘07:00‘, ‘08:00‘, ‘09:00‘, ‘10:00‘, ‘11:00‘, ‘12:00‘, ‘13:00‘, ‘14:00‘, ‘15:00‘, ‘16:00‘, ‘17:00‘, ‘18:00‘, ‘19:00‘, ‘20:00‘, ‘21:00‘, ‘22:00‘, ‘23:00‘, ‘23:59‘]
    },
    yAxis: {
        type: ‘value‘,
        axisLabel: {
            formatter: ‘{value} Hz‘,
            textStyle: {
                color: ‘#FFF‘,
                fontSize: 20
            }
        },
        min: 48.75,
        max: 51.25,
        axisLine: {
            lineStyle: {
                color: ‘#FFF‘
            }
        },
        splitLine: {
            show: true,
            lineStyle: {
                type: ‘dotted‘
            }
        }
    },
    series: [{
            name: ‘频率‘,
            type: ‘line‘,
            symbol: ‘circle‘,
            itemStyle: {
                normal: {
                    color: ‘#00FF00‘
                }
            },
            data: [],
            markPoint: {
                symbolSize: 1,
                data: [{
                        type: ‘max‘,
                        name: ‘最大值‘,
                        itemStyle: {
                            normal: {
                                color: ‘#00FF00‘
                            }
                        }
                    },
                    {
                        type: ‘min‘,
                        name: ‘最小值‘,
                        itemStyle: {
                            normal: {
                                color: ‘#00FF00‘
                            }
                        }
                    }
                ],
                label: {
                    normal: {
                        textStyle: {
                            color: ‘#00ff00‘,
                            fontSize: 25
                        }
                    }
                }
            },
            lineStyle: {
                normal: {
                    color: ‘#00FF00‘,
                    width: 3
                }
            },
            markLine: {
                lineStyle: {
                    normal: {
                        type: ‘solid‘,
                        width: 2
                    }
                },
                data: [{
                    type: ‘average‘,
                    name: ‘平均值‘,
                    itemStyle: {
                        normal: {
                            color: ‘#FFFFFF‘
                        }
                    }
                }],
                label: {
                    normal: {
                        textStyle: {
                            color: ‘#FFF‘,
                            fontSize: 20
                        }
                    }
                }
            }
        },
        {
            name: ‘最大值‘,
            type: ‘line‘,
            symbol: ‘circle‘,
            symbolSize: 1,
            itemStyle: {
                normal: {
                    color: ‘red‘
                }
            },
            lineStyle: {
                normal: {
                    width: 2
                }
            },
            data: [51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51],

        },
        {
            name: ‘最小值‘,
            type: ‘line‘,
            symbol: ‘circle‘,
            symbolSize: 1,
            itemStyle: {
                normal: {
                    color: ‘red‘
                }
            },
            lineStyle: {
                normal: {
                    width: 2
                }
            },
            data: [49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49],

        }
    ]
};

var index22 = 0;
setInterval(function() {
    if (index22 <= 24) {
        option22.series[0].data.push(Math.random().toFixed(2) * 2 + 49);
    } else {
        option22.series[0].data = [];
        index22 = 0;
    }
    index22++;
    myChart22.setOption(option22, true);
}, 1000);
   
 </script>
</body>
</html>

  

 

 

彩虹效果

app.title = ‘随便玩玩儿,嘻嘻‘;

var red = ‘#F00‘;
var orange = ‘#F60‘;
var yellow = ‘#FF0‘;
var green = ‘#0C0‘;
var cyan = ‘#17D4DE‘;
var blue = ‘#2616D9‘;
var purple = ‘#B013DC‘;
var white = ‘#EFEFEF‘;
var sky = ‘#88FFFF‘;
var brown = ‘#D2691E‘;

var duration = 5000;

option = {
    title: {
        text: ‘彩虹‘,
        subtext: ‘作者: 断浪‘,
    },
    backgroundColor: ‘#88FFFF‘,
    series: [
        //红
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : red;
                }
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [280, 250],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘red‘,
                    value: 10
                },
                {
                    name: ‘land1‘,
                    value: 10
                }
            ]
        },
        //橙
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : orange;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [250, 220],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘orange‘,
                    value: 10
                },
                {
                    name: ‘land2‘,
                    value: 10
                }
            ]
        },
        //黄
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : yellow;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [220, 190],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘yellow‘,
                    value: 10
                },
                {
                    name: ‘land3‘,
                    value: 10
                }
            ]
        },
        //绿
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : green;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [190, 160],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘green‘,
                    value: 10
                },
                {
                    name: ‘land4‘,
                    value: 10
                }
            ]
        },
        //青
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : cyan;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [160, 130],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘green‘,
                    value: 10
                },
                {
                    name: ‘land5‘,
                    value: 10
                }
            ]
        },
        //蓝
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : blue;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [130, 100],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘blue‘,
                    value: 10
                },
                {
                    name: ‘land6‘,
                    value: 10
                }
            ]
        },
        //紫
        {
            type: ‘pie‘,
            animationDuration: duration,
            itemStyle: {
                color: function(data) {
                    return data.dataIndex == 1 ? sky : purple;
                }
            },
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false
                }
            },
            labelLine: {
                show: false
            },
            legendHoverLink: false, //是否联动高亮 defult:true
            hoverOffset: 0, //高亮时的偏移区域 defult:10
            center: [‘50%‘, ‘70%‘],
            radius: [100, 70],
            startAngle: 180, //起始角度
            data: [{
                    name: ‘purple‘,
                    value: 10
                },
                {
                    name: ‘land7‘,
                    value: 10
                }
            ]
        },
    ],
};

  中间带图片参数

var giftImageUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAARiElEQVR4Xu2dCfC/xRzH3zmSIzeRO5KKJopoHJEyaJhp4u8Yd0xSlKuSm4kylPJ3F2Lwj0KuSciVs3GVTDlDiXJEB6G/eU/7zGzb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k2i2OcG3u/J0jVByp4oiVwkwKCJCZhHdee1vTR+I+DQZO1D0FwEV1FK/dUgiQdm2vmgcoIEACRFKUdhUQIO3aXjUPUECABIikKO0qIEDatb1qHqCAAAkQSVHaVUCAtGt71TxAAQESIJKitKuAAGnX9qp5gAICJEAkRWlXAQHSru1V8wAFBEiASIrSrgICpF3bq+YBCgiQAJEUpV0FBEi7tlfNAxQQIAEiKUq7CgiQdm2vmgcoIEACRFKUdhUQIO3aXjUPUECABIikKO0qIEDatb1qHqCAAAkQSVHaVUCAtGt71TxAAQESIJKitKuAAGnX9qp5gAICJEAkRWlXAQHSru1V8wAFBEiASIrSrgICpF3bq+YBCgiQAJEUpV0FBEi7tlfNAxQQIAEiKUq7CgiQdm2vmgcoIEACRFKUdhUQIO3aXjUPUECABIikKO0qIEDatb1qHqCAAAkQSVHaVUCAtGt71TxAAQESIJKitKuAAGnX9qp5gAL/B9xLvvbGgVBFAAAAAElFTkSuQmCC";
option = {
    backgroundColor: ‘#fff‘,
    tooltip: {
        trigger: ‘item‘,
        formatter: "{b} : {d}% <br/> {c}"
    },
    graphic: {
        elements: [{
            type: ‘image‘,
            style: {
                image: giftImageUrl,
                width: 130,
                height: 130
            },
            left: ‘center‘,
            top: ‘center‘
        }]
    },
    /*legend: {
        orient: ‘horizontal‘,
        icon: ‘circle‘,
        bottom: 20,
        x: ‘center‘,
        
        data: [‘金融‘, ‘房地产‘, ‘专业服务业‘, ‘批发和零售业‘, ‘其他‘]
    },*/
    series: [{
        type: ‘pie‘,
        radius: [‘35%‘, ‘50%‘],
        center: [‘50%‘, ‘50%‘],
        color: [‘#0E7CE2‘, ‘#FF8352‘, ‘#E271DE‘, ‘#F8456B‘, ‘#00FFFF‘, ‘#4AEAB0‘],
        data: [{
                value: 335,
                name: ‘金融‘
            },
            {
                value: 310,
                name: ‘房地产‘
            },
            {
                value: 234,
                name: ‘其他‘
            },
            {
                value: 235,
                name: ‘批发和\n零售业‘
            },
            {
                value: 254,
                name: ‘专业\n服务业‘
            }
        ],
        labelLine: {
            normal: {
                show: true,
                length: 20,
                length2: 20,
                lineStyle: {
                    color: ‘#12EABE‘,
                    width: 2
                }
            }
        },
        label: {
            normal: {
                formatter: ‘{c|{b}}\n{d|{d}%}‘,
                rich: {
                    b: {
                        fontSize: 16,
                        color: ‘#12EABE‘,
                        align: ‘left‘,
                        padding: 4
                    },
                    d: {
                        fontSize: 16,
                        align: ‘left‘,
                        padding: 2
                    },
                    c: {
                        color: ‘#333‘,
                        fontSize: 16,
                        align: ‘left‘,
                        padding: 2
                    }
                }
            }
        }
    }]
};

  

双曲螺线

var data = [];
for (var circle = 0; circle < 5; ++circle) {
    for (var i = 0; i <= 100; i++) {
        var theta = i / 100 * 360;
        var alpha = circle * 360 + theta;
        var r = Math.pow(Math.E, 0.003 * alpha);
        data.push([r, theta]);
    }
}

option = {
    title: {
        text: ‘双曲螺线‘
    },
    polar: {},
    tooltip: {
        trigger: ‘item‘
    },
    angleAxis: {
        type: ‘value‘,
        startAngle: 135,
        show: false
    },
    radiusAxis: {
        show: false,
        max: 225
    },
    series: [{
        coordinateSystem: ‘polar‘,
        name: ‘line‘,
        type: ‘line‘,
        data: data,
        symbolSize: 0,
        symbol: ‘circle‘,
        areaStyle: {
            normal: {
                color: new echarts.graphic.RadialGradient(0.64, 0.5, 1, [{
                    offset: 0.1,
                    color: ‘rgba(255, 0, 0, 0.5)‘
                }, {
                    offset: 1,
                    color: ‘rgba(255, 255, 0, 0)‘
                }], false)
            }
        },
        lineStyle: {
            normal: {
                color: ‘#C25353‘,
                width: 3
            }
        }
    }]
};

  geo地图

var geoCoordMap = {
‘福州‘: [119.4543,25.9222],
‘太原‘: [112.3352,37.9413],
‘长春‘: [125.8154,44.2584],
‘重庆‘: [107.7539,30.1904],
‘西安‘: [109.1162,34.2004],
‘成都‘: [103.9526,30.7617],
‘常州‘: [119.4543,31.5582],
‘北京‘: [116.4551,40.2539],
‘北海‘: [109.314,21.6211],
‘海口‘: [110.3893,19.8516],
‘广州‘: [113.5107,23.2196]
};

var GZData = [
    [{name:‘广州‘},{name:‘福州‘,value:95}],
    [{name:‘广州‘},{name:‘太原‘,value:90}],
    [{name:‘广州‘},{name:‘长春‘,value:80}],
    [{name:‘广州‘},{name:‘重庆‘,value:70}],
    [{name:‘广州‘},{name:‘西安‘,value:60}],
    [{name:‘广州‘},{name:‘成都‘,value:50}],
    [{name:‘广州‘},{name:‘常州‘,value:40}],
    [{name:‘广州‘},{name:‘北京‘,value:30}],
    [{name:‘广州‘},{name:‘北海‘,value:20}],
    [{name:‘广州‘},{name:‘海口‘,value:10}]
];

var convertData = function (data) {
    var res = [];
    for (var i = 0; i < data.length; i++) {
        var dataItem = data[i];
        var fromCoord = geoCoordMap[dataItem[0].name];
        var toCoord = geoCoordMap[dataItem[1].name];
        if (fromCoord && toCoord) {
            res.push({
                fromName: dataItem[0].name,
                toName: dataItem[1].name,
                coords: [fromCoord, toCoord]
            });
        }
    }
    return res;
};

var color = [‘#46bee9‘];
var series = [];
[[‘广州‘, GZData]].forEach(function (item, i) {
    series.push(
    {
        name: item[0] + ‘ Top10‘,
        type: ‘lines‘,
        zlevel: 2,
        symbol: [‘none‘, ‘arrow‘],
        symbolSize: 10,
        effect: {
            show: true,
            period: 6,
            trailLength: 0,
            symbol: ‘arrow‘,
            symbolSize: 5
        },
        lineStyle: {
            normal: {
                color: color[i],
                width: 1,
                opacity: 0.6,
                curveness: 0.2
            }
        },
        data: convertData(item[1])
    },
    {
        name: item[0] + ‘ Top10‘,
        type: ‘effectScatter‘,
        coordinateSystem: ‘geo‘,
        zlevel: 2,
        rippleEffect: {
            brushType: ‘stroke‘
        },
        label: {
            normal: {
                show: true,
                position: ‘right‘,
                formatter: ‘{b}‘
            }
        },
        symbolSize: function (val) {
            return val[2] / 8;
        },
        itemStyle: {
            normal: {
                color: color[i]
            }
        },
        data: item[1].map(function (dataItem) {
            return {
                name: dataItem[1].name,
                value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
            };
        })
    });
});

option = {
    backgroundColor: ‘#404a59‘,
    tooltip : {
        trigger: ‘item‘
    },
    geo: {
        map: ‘china‘,
        label: {
            emphasis: {
                show: false
            }
        },
        roam: true,
        itemStyle: {
            normal: {
                areaColor: ‘#323c48‘,
                borderColor: ‘#404a59‘
            },
            emphasis: {
                areaColor: ‘#2a333d‘
            }
        }
    },
    series: series
};

  

玫瑰图

var data = [{
    value: 1,
    name: ‘华南城市1‘
}, {
    value: 2,
    name: ‘华南城市2‘
}, {
    value: 3,
    name: ‘华南城市3‘
}, {
    value: 4,
    name: ‘华南城市4‘
}, {
    value: 5,
    name: ‘华南城市5‘
}, {
    value: 6,
    name: ‘华南城市6‘
}, {
    value: 1,
    name: ‘华东城市1‘
}, {
    value: 2,
    name: ‘华东城市2‘
}, {
    value: 3,
    name: ‘华东城市3‘
}, {
    value: 4,
    name: ‘华东城市4‘
}, {
    value: 5,
    name: ‘华东城市5‘
}, {
    value: 6,
    name: ‘华东城市6‘
}, {
    value: 1,
    name: ‘华北城市1‘
}, {
    value: 2,
    name: ‘华北城市2‘
}, {
    value: 3,
    name: ‘华北城市3‘
}, {
    value: 4,
    name: ‘华北城市4‘
}, {
    value: 5,
    name: ‘华北城市5‘
}, {
    value: 6,
    name: ‘华北城市6‘
}, {
    value: 1,
    name: ‘华西城市1‘
}, {
    value: 2,
    name: ‘华西城市2‘
}, {
    value: 3,
    name: ‘华西城市3‘
}, {
    value: 4,
    name: ‘华西城市4‘
}, {
    value: 5,
    name: ‘华西城市5‘
}, {
    value: 6,
    name: ‘华西城市6‘
}, {
    value: 1,
    name: ‘东北城市1‘
}, {
    value: 2,
    name: ‘东北城市2‘
}, {
    value: 3,
    name: ‘东北城市3‘
}, {
    value: 4,
    name: ‘东北城市4‘
}, {
    value: 5,
    name: ‘东北城市5‘
}, {
    value: 6,
    name: ‘东北城市6‘
}]
var labelData = [{
    value: 6,
    name: ‘华南‘
}, {
    value: 6,
    name: ‘华东‘
}, {
    value: 6,
    name: ‘华北‘
}, {
    value: 6,
    name: ‘华西‘
}, {
    value: 6,
    name: ‘东北‘
}];

option = {
     backgroundColor: ‘#0C2A40‘,
    title: {
        text: ‘我是标题‘,
        left: ‘1%‘,
        top: ‘1%‘,
         textStyle:{
                color:"#FFF",
                fontSize:"12"
            }
    },
    tooltip: {
            trigger: ‘item‘,
          
        },
    color: ["#FC0300", "#FC0303", "#FC0A0A", "#FC1A1A", "#FC3131", "#FC4B4B",
        "#19B7CF", "#2CB9CE", "#34BCD1", "#3BBFD1", "#48BFD1", "#58C1D1",
        "#CA8622", "#C98B2E", "#C9903B", "#CB9848", "#C99D5A", "#CBA567",
        "#2F4554", "#314652", "#344852", "#394852", "#3E4D55", "#404D55",
        "#91C7AE", "#98C6B2", "#9DC9B7", "#AAC6B9", "#B4C6BF", "#BCC9C4",

    ],

    series: [{
        type: ‘pie‘,
        data: data,
        roseType: ‘area‘,
        itemStyle: {
            normal: {

                // borderColor: ‘#22C3AA‘
            }
        },
        label: {
            normal: {
                position: ‘inside‘
            }
        }


    }, {
        type: ‘pie‘,
        data: labelData,
        radius: [‘88%‘, ‘100%‘],
        zlevel: -2,
        itemStyle: {
            normal: {
                color: ‘#152E43‘,
                borderColor: ‘#0F5FA0‘
            }
        },
        label: {
            normal: {
                position: ‘inside‘
            }
        }
    }]
};

  

 

echart 打开新世界的大门

标签:gradient   arm   ges   vgs   aac   and   uga   gas   VUCA   

原文地址:https://www.cnblogs.com/surfaces/p/9849012.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!