Multiple axes hiding series

https://stackblitz.com/edit/react-cfau6mfw?file=index.js

In the example, when I click "Japan" on the bottom the chart to hide it the right axis disappears but when I hide only "Germany" the axes stay the same, is there a way to make the left axis disappear when I have only "Germany" hidden?


2 Replies

DG Durga Gopalakrishnan Syncfusion Team May 2, 2025 12:28 PM UTC

Hi Commb,


Thanks for using Syncfusion products.


As of now, we don’t have support to hide the primary y axis while toggling the legend. So, we have considered your requirement as improvement and logged a feature request on ”Support to hide primary y axis while toggling legend”. We will include this improvement in our upcoming Volume 2 Main Release which is expected to be rolled out at end of June 2025. You can keep track of an improvement from the below feedback link. 


Feedback Link :  https://www.syncfusion.com/feedback/67341/support-to-hide-primary-y-axis-while-toggling-legend


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.


Regards,

Durga Gopalakrishnan.



DG Durga Gopalakrishnan Syncfusion Team February 17, 2026 11:26 AM UTC

Commb,


Thank you for your patience. We have implemented your required scenario at the sample level. We recommend using the chart’s legendClick event to control axis visibility based on the corresponding series. For your reference, we have attached the updated sample.


<ChartComponent legendClick={legendClick.bind(this)}>

</ChartComponent>

function legendClick(args) {

      if (!args.series.yAxisName) {

        args.chart.primaryYAxis.visible = !args.series.visible;

      }

      args.chart.refresh();

};



Before Legend Click


After Legend Click


Sample : https://stackblitz.com/edit/react-cfau6mfw-v4rktqjl?file=index.js


Kindly revert us if you have any concerns.


Loader.
Up arrow icon