{% if 'deviceInfo' in data and data['deviceInfo'] %}
<script>
$("#chart .name").html('{{data['deviceInfo']['name']}}');
var date = {% for key,value in enumerate(data['statList']) %}{% if key == 0 %}{% raw value['data']['time'] %}{% end %}{% end %};
if (date == "") {
    $("#chart").hide();
    //$(".crumbs .statMenu").hide();
} else {

    var series = [
        {% for key,value in enumerate(data['statList']) %}
        {% if key > 0 %},{% end %}
        {
            name:'{{value['name']}}',
            type:'line',
            data:{% raw value['data']['value'] %},
            markPoint: {
                data: [
                    {type: 'max', name: '最大值'},
                    {type: 'min', name: '最小值'}
                ]
            },
            markLine: {
                data: [
                    {type: 'average', name: '平均值'}
                ]
            }
        }
        {% end %}
        ];

    myChart.setOption({
        xAxis: {
            data: date
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value} {{data['type']['unit']}}'
            }
        },
        series: series
    });
    $("#chart").show();
    //$(".crumbs .statMenu").show();
}
</script>
{% end %}