I am displaying a graph but when the value is less the graphs are not shown I want a minimum height so they can be displayed.
I am using chartjs to display the graphs.
My html :
<canvas id="chartContainer"></canvas>
My angular code:
$scope.options = {
onClick: SPEND_BY_SUPPLIER,
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += ': ';
}
label += tooltipItem.yLabel;
return label + " " + $scope.SPEND_SUP_LIST[0].CURRENCY_CODE;
}
}
},
scales: {
xAxes: [
{
ticks: {
callback: function (label, index, labels) {
return label +" " + $scope.SPEND_SUP_LIST[0].CURRENCY_CODE;
}
},
scaleLabel: {
display: true,
}
}
]
}
};
new Chart(document.getElementById("chartContainer"), {
type: 'horizontalBar',
data: {
labels: $scope.label_SPEND_SUP_LIST,
datasets: [
{
backgroundColor: ["#3e95cd", "#8e5ea2", "#3cba9f", "#e8c3b9", "#c45850"],
data: $scope.data_SPEND_SUP_LIST
}
]
},
options: $scope.options,
});
I want to set mimimum height for those graphs whose values are very less,please support.