package enea.lecservice.widgets.chart.models;

import com.fasterxml.jackson.annotation.JsonTypeName;
import enea.lecservice.models.dto.DatasourceConfiguration;
import enea.lecservice.widgets.Widget;
import lombok.*;
import lombok.experimental.SuperBuilder;

import java.util.List;

@SuperBuilder
@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
@JsonTypeName("CHART")
public class ChartWidget extends Widget {
    protected String chartType;
    protected List<Series> seriesList;
    protected boolean sortData = false;
    protected boolean skipXLabel = false;
    protected String target ="";
    protected String parameterName = "";

    @Data
    public static class Series {
        DatasourceConfiguration datasourceConfiguration;
        List<String> selectedColumns;
        String xAxisColumn;
        List<SeriesStyle> styles;

        @Data
        public static class SeriesStyle {
            String column;
            String color;
            String chartType;
            Boolean fill;
            Boolean interpolate;
        }
    }
}
