吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 811|回复: 1
收起左侧

[求助] echarts组件位置的问题

[复制链接]
cqwcns 发表于 2022-7-6 15:19
如图,我创建了一个echarts,其中包含了legend、dataZoom,我希望它们的位置都中下。
首先我通过gird-bottom15%见图表上提,留够空间。
我希望dataZoom随图表提到图表底部(紧挨)。
legend则留在最低部。


查了一遍文档,没有找到方法,请大佬指教,感谢。

微信图片_20220706151930.png

以下是我写的测试Demo,大佬可以复制到官方Demo页面中测试。
网址是:https://echarts.apache.org/examples/zh/editor.html?c=line-stack


我的Demo代码:
[JavaScript] 纯文本查看 复制代码
option = {
  title: {
    text: 'Stacked Line'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine'],
    top: 'bottom',
    left: 'center'
  },
  dataZoom: [
    { startValue: 'Thu'},
    { type: 'inside' },
    ],
  grid: {
    left: '3%',
    right: '4%',
    bottom: '15%',
    containLabel: true
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: 'Email',
      type: 'line',
      stack: 'Total',
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: 'Union Ads',
      type: 'line',
      stack: 'Total',
      data: [220, 182, 191, 234, 290, 330, 310]
    },
    {
      name: 'Video Ads',
      type: 'line',
      stack: 'Total',
      data: [150, 232, 201, 154, 190, 330, 410]
    },
    {
      name: 'Direct',
      type: 'line',
      stack: 'Total',
      data: [320, 332, 301, 334, 390, 330, 320]
    },
    {
      name: 'Search Engine',
      type: 'line',
      stack: 'Total',
      data: [820, 932, 901, 934, 1290, 1330, 1320]
    }
  ]
};

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Vode 发表于 2022-7-6 15:52
dataZoom: [
    { startValue: 'Thu', bottom:'x%'},
    { type: 'inside' },
    ],

免费评分

参与人数 1吾爱币 +1 热心值 +1 收起 理由
cqwcns + 1 + 1 谢谢@Thanks!

查看全部评分

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-8 02:24

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表