隐藏 ng2-charts 中未使用的轴

Niv*_*Niv 4 typescript chart.js ng2-charts angular

我正在使用两个 Y 轴(右和左)\n当我隐藏其中之一的所有使用的数据集时,刻度(轴标签)将变为 1 到 -1。

\n\n

我想在不使用时隐藏轴或标签,有什么想法吗?

\n\n

隐藏之前:\n使用两个 Y 轴

\n\n

隐藏后:\n右 Y 轴已更改 - 未使用

\n\n

选项>比例:

\n\n
        yAxes: [\n            {type: "linear", id: "y-axis-0", display: true, position: "right",gridLines:{display: false},\n            scaleLabel:{display: true, labelString: \'mBar\'}},\n            {type: "linear", id: "y-axis-1", display: true, position: "left",ticks: {beginAtZero:true},\n            scaleLabel:{display: true, labelString: \'Knots/\xc2\xb0C\'} }\n          ]\n
Run Code Online (Sandbox Code Playgroud)\n\n

在文档中没有找到任何内容。

\n

RAH*_*NDA 5

   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
    }
]
}


   };``
Run Code Online (Sandbox Code Playgroud)