We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Axis Title

Hi Team,

I need to make the primary X axis and Y axis titles visible/invisible dynamically.
Could you please help me on this? Basically I need to make it invisible if the window is smaller or if it is a mobile view.



Thanks

1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team February 27, 2019 09:12 AM UTC

Hi Jsu, 
 
Greetings from Syncfusion. 
 
We have analyzed your query. Your requirement can be achieved using the load event of chart. Here based on the device, we have assigned the title. Find the code snippet to achieve this requirement. 
 
 
@(Html.EJS().Chart("LineChart").Load("chartLoad") 
    //Other Configurations 
.Render()) 
 
  function chartLoad(args) { 
        //Here we have assigned the empty string when it is mobile device, you can change this based on your scenario 
        args.chart.primaryXAxis.title = ej.base.Browser.isDevice ? "" : "Primary X Axis"; 
        args.chart.primaryYAxis.title = ej.base.Browser.isDevice ? "" : "Primary Y Axis"; 
    } 
 
 
 
 
Thanks, 
Dharani. 


Loader.
Live Chat Icon For mobile
Up arrow icon