美文网首页
echarts散点图平均值的展示

echarts散点图平均值的展示

作者: 算云烟_ccc7 | 来源:发表于2019-10-10 17:40 被阅读0次

option = {

    color: ['#25A6F7'],

      xAxis: [{

                  scale: true,

                  name:"DRG组数",

                  nameLocation:'middle',

                  axisLine:{

                      lineStyle:{

                          color:'#666',

                      },

                  },

                  splitLine:{

                      show:true

                  },

                  axisLabel: {

                      interval:0,

                      color:'#666',

                      fontSize:14

                  },

                  axisTick:{

                      lineStyle:{

                          color:'#DDDDDD'

                      }

                  }

              }],

              yAxis: [{

                  scale: true,

                  name:"技术难度(病例组合指数CMI)",

                  nameLocation:'middle',

                  nameRotate: 90,

                  nameGap:50,

                  axisLine:{

                      lineStyle:{

                          color:'#666'

                      }

                  },

                  splitLine:{

                      show:true

                  },

                  axisLabel: {

                      interval:0,

                      color:'#666',

                      fontSize:14

                  },

                  axisTick:{

                      lineStyle:{

                          color:'#ddd'

                      }

                  }

              }],

                aria: {

                  show: true

              },

    series: [{

        symbolSize: 20,

        data: [

            [10.0, 8.04],

            [8.0, 6.95],

            [13.0, 7.58],

            [9.0, 8.81],

            [11.0, 8.33],

            [14.0, 9.96],

            [6.0, 7.24],

            [4.0, 4.26],

            [12.0, 10.84],

            [7.0, 4.82],

            [5.0, 5.68]

        ],

        type: 'scatter',

        itemStyle: {

            normal: {

                label: {

                    color: '#7B38F8',

                    show: true,

                    position: 'top',

                    formatter: function (params, ticket, callback) {

                          return params.value[0];

                    },

                },

            }

        },

          markLine : {

                      lineStyle: {

                          normal: {

                              color: 'orange',

                              type: 'solid'

                          }

                      },

                      symbol: ['none', 'none'],

                      label:{

                          show: true,

                          position: 'end',

                          formatter: '{b}: {c}'

                      },

                      data : [

                          {type : 'average', name: '平均组数',valueDim: 'x'},

                          {type : 'average', name: '平均CMI',valueDim: 'y'  }

                      ]

                  },

    }],

};

![demo.png](https://img.haomeiwen.com/i13208025/02c7069107b21c6b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

主要就是markLine 这个属性生效的

相关文章

网友评论

      本文标题:echarts散点图平均值的展示

      本文链接:https://www.haomeiwen.com/subject/nppapctx.html