$m-chart_padding = 15px;
$m-chart_tt_height = 40px;
$m-chart_legend_height = 30px;

.m-chart {
    position: relative;
    $box-sizing: border-box;
    width: 800px;
    height: 480px;
    padding: 15px;

    .chart_tt {
        position: absolute;
        z-index: 5;
        top: $m-chart_padding;
        left: $m-chart_padding;
        right: $m-chart_padding;
        $line-height: $m-chart_tt_height;
        font-size: 16px;
        text-align: center;
    }

    .chart_legend {
        position: absolute;
        bottom: $m-chart_padding;
        $line-height: $m-chart_legend_height;
        left: $m-chart_padding;
        right: $m-chart_padding;
        font-size: 12px;
        text-align: center;
    }

    .chart_legend_item {
        display: inline-block;
        cursor: pointer;
        $user-select: none;

        &:before {
            display: inline-block;
            content: '';
            $size: 10px;
            vertical-align: text-bottom;
            margin-right: 4px;
        }
    }

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

    .chart_legend_item + .chart_legend_item {
        margin-left: 2em;
    }

    .chart_legend_item.z-dis {
        color: #ccc;

        &:before { background: #ccc; }
    }

    .chart_ct {
        position: absolute;
        top: $m-chart_padding;
        left: $m-chart_padding;
        right: $m-chart_padding;
        bottom: $m-chart_padding;
    }

    .chart_tt ~ .chart_ct {
        top: $m-chart_padding + $m-chart_tt_height;
    }

    .chart_legend ~ .chart_ct {
        bottom: $m-chart_padding + $m-chart_legend_height;
    }
}

.m-chart-border {
    $border: #eee;
}
