溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么利用echarts畫(huà)雷達(dá)圖和折柱混合

發(fā)布時(shí)間:2022-04-07 13:42:41 來(lái)源:億速云 閱讀:266 作者:iii 欄目:開(kāi)發(fā)技術(shù)

本篇內(nèi)容主要講解“怎么利用echarts畫(huà)雷達(dá)圖和折柱混合”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“怎么利用echarts畫(huà)雷達(dá)圖和折柱混合”吧!

導(dǎo)語(yǔ)

通常在根據(jù)設(shè)計(jì)圖寫(xiě)echarts的時(shí)候,很多效果是官方實(shí)例里沒(méi)有的,我在代碼里加上了一些常用的效果,并做了注釋。

雷達(dá)圖

var option = {
    radar: [{
            //數(shù)據(jù)名稱
            indicator: [{
                            text: 'AIS未登記'
                    },
                    {
                            text: '巡邏發(fā)現(xiàn)'
                    },
                    {
                            text: '群眾舉報(bào)'
                    },
                    {
                            text: '其他'
                    },
                    {
                            text: '雷達(dá)發(fā)現(xiàn)'
                    }
            ],
            center: ['50%', '50%'],
            radius: 120,
            startAngle: 90,
            splitNumber: 4,
            shape: 'circle',
            axisName: {
                    formatter: '【{value}】',
                    color: '#428BD4'//顏色
            },
            splitArea: {
                    areaStyle: {
                            color: ['#7BD685', '#34B54B', '#70DEB3', '#4FC7A0'], //內(nèi)部圈圈的顏色
                            shadowColor: 'rgba(0, 0, 0, 0.1)', //內(nèi)部線的顏色
                            shadowBlur: 10
                    }
            },
            //線顏色
            axisLine: {
                    lineStyle: {
                            color: '#428BD4'
                    }
            },
            splitLine: {
                    lineStyle: {
                            color: 'rgba(211, 253, 250, 0.8)'
                    }
            }

    }],
    //鼠標(biāo)放上懸浮展示的內(nèi)容
    tooltip: {
            trigger: 'item'
    },
    series: [{
            name: '表特征分布',
            type: 'radar',
            symbol: 'circle', //拐點(diǎn)樣式
            symbolSize: 6, // 拐點(diǎn)的大小
            emphasis: {
                    lineStyle: {
                            width: 4
                    }
            },
            data: [{
                    value: [60, 5, 1, 1, 1500],
                    name: '',
                    areaStyle: {
                       color: '#C1BFA1'
                    }
                 }
            ]
    }]
};
var myChartecharts = echarts.init(document.getElementById('btzfb'));
myChartecharts.setOption(option);

效果

怎么利用echarts畫(huà)雷達(dá)圖和折柱混合

怎么利用echarts畫(huà)雷達(dá)圖和折柱混合

折柱圖

//
var optionbdtj = {
        tooltip: {
                trigger: 'axis',
                axisPointer: {
                        type: 'cross',
                        crossStyle: {
                                color: '#999'
                        }
                }
        },
        title: {},
        legend: {
                data: ['系統(tǒng)預(yù)警', '線下發(fā)現(xiàn)', '數(shù)量變動(dòng)'],
                textStyle: {
                        color: '#7A7A7A'
                },
        },
        xAxis: [{
                type: 'category',
                data: ['1月', '2月', '3月', '4月'],
                axisPointer: {
                        type: 'shadow'
                },
                axisLine: {
                        lineStyle: { //改變xy軸線條的顏色
                                color: "#C3DCEA",
                                width: 1 //這里是為了突出顯示加上的
                        }
                },
                axisLabel: {
                        textStyle: { //改變xy軸上文字的顏色
                                color: "#75B4FC"
                        }
                }

        }],

        yAxis: [{
                        type: 'value',
                        name: '單位(艘)',
                        min: 0,
                        max: 1000,
                        interval: 200,
                        axisLine: {
                                lineStyle: { //改變xy軸線條的顏色
                                        color: "#E5F0F6",
                                        width: 1 //這里是為了突出顯示加上的
                                }
                        },
                        axisLabel: {
                                formatter: '{value} ',
                                color: '#B7B7B7'
                        },
                        splitLine: {
                                lineStyle: { //改變xy軸線條的顏色
                                        color: "#E5F0F6",
                                        width: 1 //這里是為了突出顯示加上的
                                }
                        },
                        nameTextStyle: {
                                color: '#B7B7B7'
                        }
                },
                {
                        type: 'value',
                        name: '單位(%)',
                        min: 0,
                        max: 100,
                        interval: 20, //間隔數(shù)
                        axisLine: {
                                lineStyle: { //改變xy軸線條的顏色
                                        color: "#E5F0F6",
                                        width: 1 //這里是為了突出顯示加上的
                                }
                        },
                        axisLabel: {
                                formatter: '{value} ',
                                color: '#B7B7B7'
                        },
                        splitLine: {
                                lineStyle: { //改變xy軸線條的顏色
                                        color: "#E5F0F6",
                                        width: 1 //這里是為了突出顯示加上的
                                }
                        },
                        nameTextStyle: {
                                color: '#B7B7B7'
                        }
                }
        ],
        series: [{
                        name: '系統(tǒng)預(yù)警',
                        type: 'bar',
                        barWidth: 15, // 柱子寬度
                        tooltip: {
                                valueFormatter: function(value) {
                                        return value + ' ';
                                }
                        },
                        itemStyle: {
                                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#96DBCA'
                                        },
                                        {
                                                offset: 0.5,
                                                color: '#6EC9C6'
                                        },
                                        {
                                                offset: 1,
                                                color: '#43B6C3'
                                        }
                                ])
                        },
                        emphasis: {
                                itemStyle: {
                                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                        offset: 0,
                                                        color: '#96DBCA'
                                                },
                                                {
                                                        offset: 0.7,
                                                        color: '#6EC9C6'
                                                },
                                                {
                                                        offset: 1,
                                                        color: '#43B6C3'
                                                }
                                        ])
                                }
                        },
                        data: [600, 400, 700, 230, 250, 760, 135, 162, 320, 200, 600, 300]
                },
                {
                        name: '線下發(fā)現(xiàn)',
                        type: 'bar',
                        barWidth: 15, // 柱子寬度
                        tooltip: {
                                valueFormatter: function(value) {
                                        return value + ' ';
                                }
                        },

                        itemStyle: {
                                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#FEC52F'
                                        },
                                        {
                                                offset: 0.5,
                                                color: '#FEB32C'
                                        },
                                        {
                                                offset: 1,
                                                color: '#FE9F29'
                                        }
                                ])
                        },
                        emphasis: {
                                itemStyle: {
                                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                        offset: 0,
                                                        color: '#FEC52F'
                                                },
                                                {
                                                        offset: 0.7,
                                                        color: '#FEB32C'
                                                },
                                                {
                                                        offset: 1,
                                                        color: '#FE9F29'
                                                }
                                        ])
                                }
                        },
                        data: [200, 200, 300, 400, 600, 100, 200, 230, 230, 160, 120, 610]
                },
                {
                        name: '數(shù)量變動(dòng)',
                        type: 'line',
                        symbolSize: 8, //實(shí)心大小
                        symbol: 'circle', //實(shí)心
                        yAxisIndex: 1,
                        lineStyle: {
                                width: 3,
                                shadowColor: 'rgba(0, 216, 255, 1)', //陰影
                                shadowBlur: 8,
                                shadowOffsetY: 2
                        },
                        tooltip: {
                                valueFormatter: function(value) {
                                        return value + ' ';
                                }
                        },
                        itemStyle: {
                                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#14D8FD'
                                        },
                                        {
                                                offset: 0.5,
                                                color: '#14D8FD'
                                        },
                                        {
                                                offset: 1,
                                                color: '#14D8FD'
                                        }
                                ])
                        },
                        data: [65, 46, 83, 57]
                }
        ]
};
var myChartbdtj = echarts.init(document.getElementById('bdtj'));
myChartbdtj.setOption(optionbdtj);

效果

怎么利用echarts畫(huà)雷達(dá)圖和折柱混合

怎么利用echarts畫(huà)雷達(dá)圖和折柱混合

到此,相信大家對(duì)“怎么利用echarts畫(huà)雷達(dá)圖和折柱混合”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI