export const chartCfg = (dataChartType, data, moreThanOneSet = false) => {
    let cfg = {
        type: dataChartType,
        data: data,
        options: {
            responsive: true,
            maintainAspectRatio: false,
            aspectRatio: 1,
            legend: {
                display: moreThanOneSet,
                position: 'bottom',
                labels: { boxWidth: 20, fontFamily: 'sans-serif' },
            },
            tooltip: {
                enabled: true,
            },
            plugins: { deferred: { enabled: true, yOffset: '50%', delay: 300 } },
        },
    };
    if (dataChartType === 'bar') {
        return {
            ...cfg,
            options: {
                ...cfg.options,
                scales: {
                    yAxes: [
                        {
                            ticks: {
                                beginAtZero: true,
                            },
                        },
                    ],
                },
            },
        };
    }
    if (dataChartType === 'doughnut' || dataChartType === 'pie') {
        return {
            ...cfg,
            options: {
                ...cfg.options,
                legend: {
                    ...cfg.options.legend,
                    display: true,
                },
            },
        };
    }
    return cfg;
};
export const dataSetProps = (set, dataChartType) => {
    const dataSetProps = {
        datalabels: {
            color: '#FFF',
            font: {
                size: 22,
                weight: 600,
            },
        },
    };
    let variant = {};
    if (dataChartType === 'doughnut' || dataChartType === 'pie') {
        variant = {
            ...dataSetProps,
            borderColor: set.borderColor ? set.borderColor : 'transparent',
            datalabels: {
                ...dataSetProps.datalabels,
                color: '#000000',
            },
        };
    }
    else if (dataChartType === 'line') {
        variant = {
            ...dataSetProps,
            fill: false,
        };
    }
    else if (dataChartType === 'bar') {
        variant = { ...dataSetProps };
    }
    return { ...set, ...variant };
};
//# sourceMappingURL=pn-chart-helper.js.map
