雨过天晴后。 2021-10-13 21:45 采纳率: 0%
浏览 19

为什么我的echarts图表是从chart盒子的上半部分开始渲染的呢?

img


为什么我的echarts图标不从底部显示呢?

<div class="column">
            <div class="panel bar">
                <h2>123</h2>
                <div class="chart"></div>
                <div class="panel-footer"></div>
            </div>
            <div class="panel line">
                <h2></h2>
                <div class="chart"></div>
                <div class="panel-footer"></div>
            </div>
            <div class="panel">
                <h2></h2>
                <div class="chart"></div>
                <div class="panel-footer"></div>
            </div>
        </div>
.mainbox {
    padding: .125rem .125rem 0;
    display: flex;
    .column{
        flex: 3;
        &:nth-child(2){
          flex: 5;
          margin: 0 10px 15px;
      }
    }
}

.panel {
    position: relative;
    height: 3.875rem;
    border: 1px solid rgba(25, 186, 139, 0.17);
    background: url(../images/line\(1\).png);
    padding: 0 0.1875rem 0.5rem;
    margin-bottom: 0.1875rem;
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      content: "";
      width: 10px;
      height: 10px;
      border-top: 2px solid #02a6b5;
      border-left: 2px solid #02a6b5;
    }
    &::after {
      position: absolute;
      top: 0;
      right: 0;
      content: "";
      width: 10px;
      height: 10px;
      border-top: 2px solid #02a6b5;
      border-right: 2px solid #02a6b5;
    }
    .panel-footer {
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      &::before {
        position: absolute;
        bottom: 0;
        left: 0;
        content: "";
        width: 10px;
        height: 10px;
        border-bottom: 2px solid #02a6b5;
        border-left: 2px solid #02a6b5;
      }
      &::after {
        position: absolute;
        bottom: 0;
        right: 0;
        content: "";
        width: 10px;
        height: 10px;
        border-bottom: 2px solid #02a6b5;
        border-right: 2px solid #02a6b5;
      }
    }
    h2 {
      height: .6rem;
      color: #fff;
      font-size: .25rem;
      text-align: center;
    }
    .chart {
      height: 3rem;
    }
}


let myChart = echarts.init(document.querySelector(".line .chart"));
let option = {
    xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
        data: [120, 200, 150, 80, 70, 110, 130],
        type: 'bar',
        showBackground: true,
        backgroundStyle: {
            color: 'rgba(180, 180, 180, 0.2)'
        }
        }
    ]
};
    myChart.setOption(option);

```

  • 写回答

2条回答 默认 最新

  • 关注

    这是你div的定位问题吧,看看div的css属性。

    评论

报告相同问题?

问题事件

  • 创建了问题 10月13日

悬赏问题

  • ¥200 csgo2的viewmatrix值是否还有别的获取方式
  • ¥15 Stable Diffusion,用Ebsynth utility在视频选帧图重绘,第一步报错,蒙版和帧图没法生成,怎么处理啊
  • ¥15 请把下列每一行代码完整地读懂并注释出来
  • ¥15 pycharm运行main文件,显示没有conda环境
  • ¥15 易优eyoucms关于二级栏目调用的问题
  • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件
  • ¥15 为什么eclipse不能再下载了?
  • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
  • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
  • ¥15 特定网页无法访问,已排除网页问题