$m-lineChart_axis-y_width ?= 40px;
$m-lineChart_axis-x_height ?= 30px;
$m-lineChart_axis_border ?= #ccc;
$m-lineChart_axis-y_offset ?= 10px;
$m-lineChart_axis-x_offset ?= 6px;
$m-lineChart_line_border ?= #eee;
$m-lineChart_line_width ?= 2px;
$m-lineChart_line_offset ?= 6px;
$m-lineChart_point_size ?= 9px;

.m-lineChart {
    .lineChart_grid, .lineChart_layer {
        position: absolute;
        bottom: $m-lineChart_axis-x_height;
        top: $m-lineChart_axis-x_height / 2;
        left: $m-lineChart_axis-y_width;
        right: $m-lineChart_axis-y_width / 2;
        font-size: 0;
    }

    .lineChart_line {
        position: absolute;
    }

    .lineChart_line-x {
        left: -$m-lineChart_line_offset;
        right: -1px;
        border-top: 1px solid $m-lineChart_line_border;
    }

    .lineChart_line-y {
        top: -1px;
        bottom: -$m-lineChart_line_offset;
        border-left: 1px solid $m-lineChart_line_border;
    }

    .lineChart_axis {
        position: absolute;
        z-index: 2;
    }

    .lineChart_axis-x {
        left: $m-lineChart_axis-y_width;
        right: $m-lineChart_axis-y_width / 2 - 1px;
        bottom: 0;
        height: $m-lineChart_axis-x_height;
        border-top: 1px solid $m-lineChart_axis_border;
    }

    .lineChart_axis-y {
        left: 0;
        top: $m-lineChart_axis-x_height / 2 - 1px;
        bottom: $m-lineChart_axis-x_height;
        width: $m-lineChart_axis-y_width;
        border-right: 1px solid $m-lineChart_axis_border;
    }

    .lineChart_label {
        position: absolute;
        font-size: 12px;
    }

    .lineChart_label-x {
        @extend .f-toe;
        top: $m-lineChart_axis-x_offset;
        bottom: 0;
        $transform: translateX(-50%);
        text-align: center;
    }

    .lineChart_label-y {
        left: 0;
        right: $m-lineChart_axis-y_offset;
        $transform: translateY(50%);
        text-align: right;
    }

    .lineChart_label-xName {
        right: -50px;
        top: 6px;
        bottom: 0;
    }

    .lineChart_label-yName {
        right: 10px;
        top: -30px;
        text-align: right;
    }

    .lineChart_layer {
        z-index: 10;

        > svg {
            position: absolute;
            top: 0;
            left: 0;
            $size: 100%;
        }
    }

    // 修复最下面2px线条在svg中只显示一半的问题
    .lineChart_layer-svg {
        bottom: $m-lineChart_axis-x_height - $m-lineChart_line_width;
    }

    .lineChart_line { fill-opacity: 0; stroke-width: $m-lineChart_line_width; }
    .lineChart_area { stroke-opacity: 0; }

    .lineChart_layer {
        > svg:nth-of-type(1) {
            .lineChart_line { stroke: rgba(0,153,255,0.6); }
            .lineChart_area { fill: rgba(0,153,255,0.3); }
        }

        > svg:nth-of-type(2) {
            .lineChart_line { stroke: rgb(255,174,60); }
            .lineChart_area { fill: rgba(255,174,60,0.1); }
        }

        > svg:nth-of-type(3) {
            .lineChart_line { stroke: rgb(78,201,171); }
            .lineChart_area { fill: rgba(78,201,171,0.1); }
        }

        > svg:nth-of-type(4) {
            .lineChart_line { stroke: rgb(245,131,122); }
            .lineChart_area { fill: rgba(245,131,122,0.1); }
        }

        > svg:nth-of-type(5) {
            .lineChart_line { stroke: rgb(158,156,246); }
            .lineChart_area { fill: rgba(158,156,246,0.1); }
        }
    }

    .lineChart_piece {
        position: absolute;
        top: 0;
        bottom: 0;
        border-left: 1px solid transparent;

        &:before {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: -50%;
            width: 50%;
        }

        .u-tooltip {
            display: none;
            position: absolute;
            z-index: 10;
            margin-top: -16px;
            white-space: nowrap;
        }

        .u-tooltip-right-top {
            margin-left: 4px;
        }

        .u-tooltip-left-top {
            margin-right: 10px;
            right: 100%;
        }
    }

    .lineChart_piece:hover {
        border-left: 1px solid rgba(0,0,0,0.2);

        .u-tooltip {
            display: block;
        }
    }

    .lineChart_point {
        position: absolute;
        left: -1px;
        $box-sizing: border-box;
        $size: $m-lineChart_point_size;
        background: white;
        border: 2px solid rgba(0,153,255,0.6);
        $border-radius: 100%;
        margin-bottom: - ($m-lineChart_point_size - 1) / 2;
        margin-left: - ($m-lineChart_point_size - 1) / 2;
    }

    .lineChart_piece .lineChart_point:nth-of-type(1) { border-color: rgba(0,153,255,0.6); }
    .lineChart_piece .lineChart_point:nth-of-type(2) { border-color: rgb(255,174,60); }
    .lineChart_piece .lineChart_point:nth-of-type(3) { border-color: rgb(78,201,171); }
    .lineChart_piece .lineChart_point:nth-of-type(4) { border-color: rgb(245,131,122); }
    .lineChart_piece .lineChart_point:nth-of-type(5) { border-color: rgb(158,156,246); }
}
