/**
 * @category    Webserver
 * @package     ATPX
 * @author      Joss Grimwood <joss@aandtinstruments.com>, Sam Meredith <sam@aandtinstruments.com>
 * @version     0.1
 */

function chartOptionsBar(color, isHorizontal, min, max)
{
    return {
        type: 'bar',
        data: {
            labels: [''],
            datasets: [{
                data: [0],
                backgroundColor: color,
                barPercentage: 1.0,
                barThickness: 'flex',
                categoryPercentage: 1.0,
                borderWidth: 0
            }]
        },
        options:
        {
            animation: false,
            layout: 
            {
                padding: 
                {
                    bottom: -10,
                    left: -10,
                }
            },
            maintainAspectRatio: false,
            indexAxis: isHorizontal ? 'y' : 'x',
            plugins:
            {
                legend:
                {
                    display: false
                },
                tooltip:
                {
                    enabled: false
                }
            },
            responsive: true,
            scales:
            {
                x:
                {
                    min: isHorizontal ? min : 0,
                    max: isHorizontal ? max : 1,
                    border:
                    {
                        display: false
                    },
                    grid:
                    {
                        display: false
                    },
                    ticks:
                    {
                        display: false
                    }
                },
                y:
                {
                    min: isHorizontal ? 0 : min,
                    max: isHorizontal ? 1 : max,
                    border:
                    {
                        display: false
                    },
                    grid:
                    {
                        display: false
                    },
                    ticks:
                    {
                        display: false
                    }
                }
            }
        }
    }
}
