export class areaRange {

    constructor() {

        this.height = null;
        this.title = null;
        this.series = [];
        this.size = null;
        this.width = null;
        this.subtitle = null;
        this.categories = null;
        this.yLabelFormat = '{value}%';
        this.yTitle = 'Tiempo %';
        this.yMin = 0;
        this.yMax = 100;
        this.inverted = false;
        this.legend = false;
        this.dataLabels = true;
        this.dataLabelsFormat = '{y}%';
        this.export = false;

    }


    setSeries(series) {
        this.series = series;
    };

    setInverted(inverted) {
        this.inverted = inverted;
    };

    setHeight(height) {
        this.height = height;
    };

    setWidth(width) {
        this.width = width;
    };

    setTitle(title) {
        this.title = title;
    };

    setSubtitle(subtitle) {
        this.subtitle = subtitle;
    };

    setYMax(yMin) {
        this.yMin = yMin;
    };

    setYmin(yMax) {
        this.yMax = yMax;
    };

    setCategories(categories) {
        this.categories = categories;
    };

    setYLabelFormat(yLabelFormat){
        this.yLabelFormat = yLabelFormat;
    };

    setYTitle(yTitle){
        this.yTitle = yTitle;
    };

    setLegend(legend){
        this.legend = legend;
    };

    setDataLabels(dataLabels){
        this.dataLabels = dataLabels;
    };

    setDataLabelsFormat(dataLabelsFormat){
        this.dataLabelsFormat = dataLabelsFormat;
    };

    setExport(exporting) {
        this.export = exporting;
    };

    Draw(){

        var  rangeDefaultChart = {

            chart: {
                type: 'arearange',
                zoomType: 'x',
                scrollablePlotArea: {
                    minWidth: 600,
                    scrollPositionX: 1
                }
            },
            exporting:{
                enabled: false
            },
            credits:{
                enabled:false
            },
            title: {
                text: this.title
            },

            xAxis: {
                type: 'datetime'
            },

            yAxis: {
                title: {
                    text: this.yTitle
                }
            },

            tooltip: {
                crosshairs: true,
                shared: true,
                valueSuffix: '%'
            },

            legend: {
                enabled: false
            },

            series: this.series
    };
    
    return rangeDefaultChart;

}

}