In chart.js, Is it possible to hide x-axis label/text of bar chart if accessing from mobile ?
I got around this by defining labels as a list of empty strings. Example:
var data = {
labels: ["", "", "", "", ""],
datasets: [{
label: "TEST",
fillColor: "rgba(220,220,220,0.2)",
strokeColor: "rgba(220,220,220,1)",
pointColor: "rgba(220,220,220,1)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(220,220,220,1)",
data: [10, 20, 15, 8, 22]
}]
};
For this you need the label to not be relevant in the tooltip box. I defined mine as follows:
tooltipTemplate: "Latency: <%=value%>"