Hiding unused axis in ng2-charts
angular, chart.js, ng2-charts, typescript
Solution
If you want to remove the x axis and y axis data so to do that you need
to use scales and put in bar-chart-demo.ts file and inside export
class you have to paste like that what i mentioned below
and it worked .
public barChartOptions:any = {
scaleShowVerticalLines: false,
animation: false,
scaledisplay:false,
responsive: true,
scales: {
xAxes: [
{
display: false
}
],
yAxes: [
{
display: false
}
]
}
};``
Problem
I'm using two Y axes (right and left) When I hide all the used datasets for one of them, the ticks (Axis labels) turn to 1 to -1. I want to to hide the axis or the labels when it is not used, any ideas? Before Hiding: Both Y Axes used After Hiding: Right Y-Axis Changed - Not used Options>Scales: ``` yAxes: [ {type: "linear", id: "y-axis-0", display: true, position: "right",gridLines:{display: false}, scaleLabel:{display: true, labelString: 'mBar'}}, {type: "linear", id: "y-axis-1", display: true, position: "left",ticks: {beginAtZero:true}, scaleLabel:{display: true, labelString: 'Knots/°C'} } ] ``` Didn't find anything in the documentation.