echarts smooth圆滑曲线

46 阅读1分钟
const option: ECOption = {
        xAxis: {
            type: 'category',
            axisTick: {
                show: false, //关键设置,坐标轴刻度也不显示
            },
            splitLine: {
                show: false,// 拆分线条, 是否显示图表内的纵线
            },

            axisLabel: { show: false },
            axisLine: {
                show: false, //关键设置,不显示X轴线条
            },
            boundaryGap: false,
            data: datax
        },
        yAxis: {
            type: 'value',
            splitLine: {
                show: false,// 拆分线条, 是否显示图表内的纵线
            },
            axisTick: {
                show: false,
            },
            axisLabel: {
                show: false,
            },
            axisLine: {
                lineStyle: {
                  color: "#fff",
                  width: 1 //这里是为了突出显示加上的
                }
              }
        },
        tooltip: {
            trigger: 'axis'
        },
        grid: {
            top: '1%',
            left: '3%',
            right: '3%',
            bottom: '1%',
            containLabel: true
        },
        series: [
            {
                data: datay,
                type: 'line',
                smooth: true,//曲线圆滑
                lineStyle: {
                    width: 0
                },
                showSymbol: false,
                areaStyle: areaStyleArray[config.cindex]
            }
        ]
    };

如果smooth: true,//曲线圆滑 则是下面图形。

image.png

如果不设置本属性。则是尖锐的图形点

image.png