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.
   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
    }
]
}
   };``
You can hide the axis in your code. Just add an angular on-mouseover event and set the display to true/false with negation !condition:
scales: {
    xAxes: [
        {
            display: false
        }
    ],
    yAxes: [
        {
            display: false
        }
    ]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With