echarts折线图添加上限值

2022-05-20  本文已影响0人  张xiao蛋
 option: {
                tooltip: {
                    trigger: 'axis',
                    // formatter: '{a} <br/>{b}: {c} ({d}%)',
                    confine: true,
                },
                // legend: {
                //     data: ['11', '22'],
                //     textStyle: {
                //         color: 'rgba(252, 252, 252, 1)',
                //     },
                // },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true,
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['11', '22', '33', '44', '55', '66', '77'],
                    axisLine: {
                        show: false,
                    },
                    axisTick: {
                        show: false,
                    },
                },
                yAxis: [
                    {
                        type: 'value',
                        name: '111',
                        // splitNumber: 6, //设置坐标轴的分割段数
                        axisLine: {
                            show: true,
                        },
                        axisLabel: {
                            show: true,
                            color: 'rgba(255, 255, 255, 0.5)',
                        },
                        splitLine: {
                            show: true,
                            lineStyle: {
                                color: 'rgba(255, 255, 255, 0.5)',
                                type: 'dashed',
                            },
                        },
                    },
                ],
                series: [
                    {
                        name: '22',
                        smooth: true,
                        type: 'line',
                        showSymbol: false,
                         data: [120, 132, 101, 134, 90, 230, 210],
                        lineStyle: {
                            // 阴影部分
                            shadowOffsetX: 0, // 折线的X偏移
                            shadowOffsetY: 9, // 折线的Y偏移
                            shadowBlur: 8, // 折线模糊
                            shadowColor: 'rgba(145, 132, 132, 1)', //折线颜色
                        },
                        markLine: {
                            data: [
                                {
                                    yAxis: 220,
                                    // type: 'max',
                                },
                            ],
                            symbol: ['none', 'none'],
                            label: {
                                show: false,
                            },
                            lineStyle: {
                                color: '#FC8F5D',
                            },
                        },
                    },
                ],
            },
上一篇 下一篇

猜你喜欢

热点阅读