echarts 图居中

论坛 期权论坛 脚本     
匿名技术用户   2021-1-5 15:25   505   0

template:

      <Card class="card-style">
        <div
          class="siggle-chart"
          id="histogram"
        ></div>
      </Card>

style:

.card-style {
  height: 600px;
  width: 100%;
  margin-top: 20px;
  margin-left: 20px;
  margin-right: 20px;
  margin-bottom: 40px;
}
.siggle-chart {
  width: 1100px;
  height: 520px;
  margin: auto;
}

图表的位置和大小是由grid控制的

            grid: {
              bottom: 150,
              top: 20,
              right: 0,
              left: 50,
              height: 300
            },

图例的位置是由legend控制的

            legend: {
              data: this.functionDailyPvUv.legendList,
              top: 400,
              bottom: 20,
              right: 0
            },

多个折线图仅显示一个图,默认显示某一个

            legend: {
              data: this.functionDailyPvUv.legendList,
              top: 400,
              bottom: 20,
              right: 0
              selectedMode: 'single',
              selected: {
                'PV': true,
                'UV': false
              }
            },

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP