package com.huatek.busi.vo.echarts;

import java.io.Serializable;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;

import com.google.common.collect.Lists;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * Echarts接口响应数据
 * 
 * @author anker_cheng
 * @date 2019/09/02
 */
@Data
@ApiModel(value = "EchartLineDataVo", description = "Echart Line Vo")
public class EchartLineDataVo implements Serializable {
    private static final long serialVersionUID = -9041087121910677635L;

    @ApiModelProperty(name = "titleText", value = "title.text")
    private String titleText;

    @ApiModelProperty(name = "xAxisData", value = "xAxis.data")
    private TreeSet<String> xAxisData;

    @ApiModelProperty(name = "series", value = "series")
    private List<SeriesItemVo> series;

    private Integer availableCount;

    public EchartLineDataVo(String titleText) {
        this.titleText = titleText;
        this.xAxisData = new TreeSet<>(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
        });
        this.series = Lists.newArrayList();
    }
}
