index.less 1.61 KB
Newer Older
jim's avatar
jim committed
1
@import '~antd/lib/style/themes/default.less';
2 3

.pie {
偏右's avatar
偏右 committed
4 5
  position: relative;
  .chart {
6 7
    position: relative;
  }
偏右's avatar
偏右 committed
8
  &.hasLegend .chart {
jim's avatar
jim committed
9
    width: ~'calc(100% - 240px)';
偏右's avatar
偏右 committed
10
  }
11 12 13 14
  .legend {
    position: absolute;
    right: 0;
    min-width: 200px;
偏右's avatar
偏右 committed
15 16
    top: 50%;
    transform: translateY(-50%);
afc163's avatar
afc163 committed
17
    margin: 0 20px;
afc163's avatar
afc163 committed
18 19
    list-style: none;
    padding: 0;
20 21 22 23 24
    li {
      cursor: pointer;
      margin-bottom: 16px;
      height: 22px;
      line-height: 22px;
偏右's avatar
偏右 committed
25 26 27
      &:last-child {
        margin-bottom: 0;
      }
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
    }
  }
  .dot {
    border-radius: 8px;
    display: inline-block;
    margin-right: 8px;
    position: relative;
    top: -1px;
    height: 8px;
    width: 8px;
  }
  .line {
    background-color: @border-color-split;
    display: inline-block;
    margin-right: 8px;
    width: 1px;
    height: 16px;
  }
  .legendTitle {
    color: @text-color;
  }
  .percent {
    color: @text-color-secondary;
  }
  .value {
    position: absolute;
    right: 0;
  }
afc163's avatar
afc163 committed
56
  .title {
afc163's avatar
afc163 committed
57
    margin-bottom: 8px;
afc163's avatar
afc163 committed
58
  }
59 60 61 62 63
  .total {
    position: absolute;
    left: 50%;
    top: 50%;
    text-align: center;
64
    max-height: 62px;
偏右's avatar
偏右 committed
65
    transform: translate(-50%, -50%);
66 67 68 69 70 71
    & > h4 {
      color: @text-color-secondary;
      font-size: 14px;
      line-height: 22px;
      height: 22px;
      margin-bottom: 8px;
afc163's avatar
afc163 committed
72
      font-weight: normal;
73 74 75 76
    }
    & > p {
      color: @heading-color;
      display: block;
afc163's avatar
afc163 committed
77
      font-size: 1.2em;
78 79
      height: 32px;
      line-height: 32px;
偏右's avatar
偏右 committed
80 81 82 83 84
      white-space: nowrap;
    }
  }
}

85 86 87 88 89 90
.legendBlock {
  &.hasLegend .chart {
    width: 100%;
    margin: 0 0 32px 0;
  }
  .legend {
91
    position: relative;
92
    transform: none;
93 94
  }
}