UNPKG

cloud-ui.vusion

Version:
382 lines (318 loc) 7.09 kB
$axis-y_width: 40px; $axis-x_height: 30px; $axis_border: #ccc; $axis-y_offset: 10px; $axis-x_offset: 6px; $line_border: #eee; $line_width: 2px; $line_offset: 6px; .wrap { height: 100%; } .grid { position: absolute; bottom: $axis-x_height; top: 15px; left: $axis-y_width; right: 20px; font-size: 0; } .layer { position: absolute; bottom: $axis-x_height; top: 15px; left: $axis-y_width; right: 20px; font-size: 0; } .line { position: absolute; fill-opacity: 0; stroke-width: $line_width; } .line[role="x"] { left: -$line_offset; right: -1px; border-top: 1px solid $line_border; } .line[role="y"] { top: -1px; bottom: -$line_offset; border-left: 1px solid $line_border; } .axis { position: absolute; z-index: 2; } .axis[role="axisx"] { left: $axis-y_width; right: 19px; bottom: 0; height: $axis-x_height; border-top: 1px solid $axis_border; } .axis[role="axisy"] { left: 0; top: 14px; bottom: $axis-x_height; width: $axis-y_width; border-right: 1px solid $axis_border; } .label { position: absolute; font-size: 12px; z-index: 10; } .label[role="label-xName"] { right: -50px; top: 6px; bottom: 0; } .label[role="label-yName"] { right: 10px; top: -30px; text-align: center; } .label[role="labelx"] { top: $axis-x_offset; bottom: 0; transform: translateX(-50%); text-align: center; } .label[role="labely"] { left: 0; right: $axis-y_offset; transform: translateY(50%); text-align: right; } .label-xName { right: -50px; top: 6px; bottom: 0; } .label-yName { right: 10px; top: -30px; text-align: right; } .layer .elsvg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* 修复最下面2px线条在svg中只显示一半的问题 */ .layer[role="layersvg"] { bottom: 28px; } .area { stroke-opacity: 0; } .layer .elsvg .line { stroke: rgb(97,218,198); } .layer .elsvg .area { fill: rgba(97,218,198,0.3); } .layer .elsvg:nth-of-type(1) .line { stroke: $theme-dark-chart-color1; } .layer .elsvg:nth-of-type(1) .area { fill: $theme-dark-chart-rgba-color1; } .layer .elsvg:nth-of-type(2) .line { stroke: $theme-dark-chart-color2; } .layer .elsvg:nth-of-type(2) .area { fill: $theme-dark-chart-rgba-color2; } .layer .elsvg:nth-of-type(3) .line { stroke: $theme-dark-chart-color3; } .layer .elsvg:nth-of-type(3) .area { fill: $theme-dark-chart-rgba-color3; } .layer .elsvg:nth-of-type(4) .line { stroke: $theme-dark-chart-color4; } .layer .elsvg:nth-of-type(4) .area { fill: $theme-dark-chart-rgba-color4; } .layer .elsvg:nth-of-type(5) .line { stroke: $theme-dark-chart-color5; } .layer .elsvg:nth-of-type(5) .area { fill: $theme-dark-chart-rgba-color5; } .layer .elsvg:nth-of-type(6) .line { stroke: $theme-dark-chart-color6; } .layer .elsvg:nth-of-type(6) .area { fill: $theme-dark-chart-rgba-color6; } .layer .elsvg:nth-of-type(7) .line { stroke: $theme-dark-chart-color7; } .layer .elsvg:nth-of-type(7) .area { fill: $theme-dark-chart-rgba-color7; } .layer .elsvg:nth-of-type(8) .line { stroke: $theme-dark-chart-color8; } .layer .elsvg:nth-of-type(8) .area { fill: $theme-dark-chart-rgba-color8; } .layer .elsvg:nth-of-type(9) .line { stroke: $theme-dark-chart-color9; } .layer .elsvg:nth-of-type(9) .area { fill: $theme-dark-chart-rgba-color9; } .layer .elsvg:nth-of-type(10) .line { stroke: $theme-dark-chart-color10; } .layer .elsvg:nth-of-type(10) .area { fill: $theme-dark-chart-rgba-color10; } .piece { position: absolute; top: 0; bottom: 0; border-left: 1px solid transparent; } .piece::before { content: ''; position: absolute; top: 0; bottom: 0; left: -50%; width: 50%; } .piece .u-tooltip { display: none; position: absolute; z-index: 10; margin-top: -16px; white-space: nowrap; padding: 4px 12px; font-size: 12px; background: #333; color: #eee; box-sizing: border-box; max-width: 230px; } .piece .u-tooltip::after { content: ''; display: block; position: absolute; border: 5px solid #333; } .piece .u-tooltip[role="u-tooltip-right-top"] { margin-left: 4px; } .piece .u-tooltip[role="u-tooltip-right-top"]::after { top: 10px; left: -5px; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-right-bottom"] { margin-left: 4px; } .piece .u-tooltip[role="u-tooltip-right-bottom"]::after { top: 10px; left: -5px; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-left-top"] { margin-right: 10px; right: 100%; } .piece .u-tooltip[role="u-tooltip-left-top"]::after { top: 10px; right: -5px; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-left-bottom"] { margin-right: 10px; right: 100%; } .piece .u-tooltip[role="u-tooltip-left-bottom"]::after { top: 10px; right: -5px; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } .piece:hover { border-left: 1px solid rgba(0,0,0,0.2); } .piece:hover .u-tooltip { display: block; } .point { position: absolute; left: -1px; box-sizing: border-box; background: white; border: 2px solid rgba(0,153,255,0.6); border-radius: 100%; margin-bottom: -4px; margin-left: -4px; width: 9px; height: 9px; display: none; } .piece .point { border-color: rgb(97,218,198); background: rgb(97,218,198); } .piece:hover .point { display: block; } .piece .point:nth-of-type(1) { border-color: $theme-dark-chart-color1; background: $theme-dark-chart-color1; } .piece .point:nth-of-type(2) { border-color: $theme-dark-chart-color2; background: $theme-dark-chart-color2; } .piece .point:nth-of-type(3) { border-color: $theme-dark-chart-color3; background: $theme-dark-chart-color3; } .piece .point:nth-of-type(4) { border-color: $theme-dark-chart-color4; background: $theme-dark-chart-color4; } .piece .point:nth-of-type(5) { border-color: $theme-dark-chart-color5; background: $theme-dark-chart-color5; } .piece .point:nth-of-type(6) { border-color: $theme-dark-chart-color6; background: $theme-dark-chart-color6; } .piece .point:nth-of-type(7) { border-color: $theme-dark-chart-color7; background: $theme-dark-chart-color7; } .piece .point:nth-of-type(8) { border-color: $theme-dark-chart-color8; background: $theme-dark-chart-color8; } .piece .point:nth-of-type(9) { border-color: $theme-dark-chart-color9; background: $theme-dark-chart-color9; } .piece .point:nth-of-type(10) { border-color: $theme-dark-chart-color10; background: $theme-dark-chart-color10; }