@import '../../global/theme.less';

.root {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;

  .titleBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    line-height: 40px;
    padding-top: 12px;
    padding-bottom: 4px;
    color: @t-titlebar-color;
    .title.editMode {
      max-width: calc(~'100% - 140px');
    }
    .titleContainter {
      overflow: hidden;
    }
  }

  .timeRangeContext {
    width: 100%;
    padding-left: 12px;
    font-size: 12px;
    color: @t-time-range-color;
  }

  .moreOption {
    margin-right: 12px;
    flex-shrink: 0;

    .icon,
    i {
      display: inline-block;
      width: 20px;
      line-height: 20px;
      text-align: center;
      color: @t-dashboard-color;
      cursor: pointer;
      transition: 0.3s;
      font-size: 12px;
      &:hover {
        color: @theme-color;
      }
    }
  }

  .chartStyle {
    width: 100%;
    height: 100%;
  }

  .chartErrorCorner {
    display: block;
    cursor: pointer;
    position: absolute;
    left: 0;
    height: 24px;
    width: 24px;
    top: 0;
    z-index: 1;
    color: @normal-color;

    .innerError {
      border-left: 27px solid @delete-color;
      border-right: none;
      border-bottom: 27px solid transparent;
      width: 0;
      height: 0;
      left: 0;
      bottom: 0;
      position: absolute;
    }

    .errorIcon {
      position: relative;
      top: -4px;
      left: 3px;
      font-size: 75%;
      z-index: 1;
      color: @normal-color;
    }
  }
  .chartContainer {
    /**
    * 注意:之前是用height=0. flex-basis: 0px，这个不一定有效果，因为在flex容器中，min-height默认是auto。需要把height或者min-height改成0才能达到预期效果
    * https://stackoverflow.com/a/42138018
    * https://e.gitee.com/xishuhq/issues/table?issue=I88J3P
    * 所以改为  min-height: 0;
    **/
    min-height: 0;
    flex: 1 1 0px;
  }

  .chartExtra {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .lackMlBox {
    height: 100%;
    position: relative;
  }
}

.errorTooltip {
  :global {
    .@{ant-prefix}-tooltip-inner {
      background-color: @delete-color !important;
    }
  }
}
