index.less 1.61 KB
Newer Older
陈帅's avatar
陈帅 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
@import '~antd/lib/style/themes/default.less';

.pie {
  position: relative;
  .chart {
    position: relative;
  }
  &.hasLegend .chart {
    width: ~'calc(100% - 240px)';
  }
  .legend {
    position: absolute;
    top: 50%;
    right: 0;
    min-width: 200px;
    margin: 0 20px;
    padding: 0;
    list-style: none;
    transform: translateY(-50%);
    li {
      height: 22px;
      margin-bottom: 16px;
      line-height: 22px;
      cursor: pointer;
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
  .dot {
    position: relative;
    top: -1px;
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 8px;
  }
  .line {
    display: inline-block;
    width: 1px;
    height: 16px;
    margin-right: 8px;
    background-color: @border-color-split;
  }
  .legendTitle {
    color: @text-color;
  }
  .percent {
    color: @text-color-secondary;
  }
  .value {
    position: absolute;
    right: 0;
  }
  .title {
    margin-bottom: 8px;
  }
  .total {
    position: absolute;
    top: 50%;
    left: 50%;
    max-height: 62px;
    text-align: center;
    transform: translate(-50%, -50%);
    & > h4 {
      height: 22px;
      margin-bottom: 8px;
      color: @text-color-secondary;
      font-weight: normal;
      font-size: 14px;
      line-height: 22px;
    }
    & > p {
      display: block;
      height: 32px;
      color: @heading-color;
      font-size: 1.2em;
      line-height: 32px;
      white-space: nowrap;
    }
  }
}

.legendBlock {
  &.hasLegend .chart {
    width: 100%;
    margin: 0 0 32px 0;
  }
  .legend {
    position: relative;
    transform: none;
  }
}