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

Y axis Position

HiI want to know whether can I set the Y axis position in between the X axis in horizontal stacked bar chartex: X axis has 2 to 20 numbers Y axis should be placed at 12

1 Reply

SK Sanjith Kesavan Syncfusion Team June 8, 2017 11:44 AM UTC

Hi Santhosh, 

Thanks for contacting Syncfusion support. We have analyzed your query. Yes, you can set the Y-axis position in between the X-axis in stacked bar chart using axis crossing feature in chart. We have prepared a sample for this. In the sample, we have set the “crossesAt” value of primaryYAxis as “12”. Please find the below code example 

[JS] 
$("#container").ejChart( 
{ 
     //.. 
     primaryYAxis: 
     {                      
       title: { text: 'Percentage' }, 
       crossesAt: 12 
     }, 
     //.. 
}); 
 
Now Y-axis will be placed at the value 12. Please find the below screenshot.  
 

By default, axis labels and title will render next to the axis line. To render axis label and title outside the chart area, please set “showNextToAxisLine” as “false”. Please find the code example below. 

[JS] 
$("#container").ejChart( 
{ 
     //.. 
     primaryYAxis: 
     {                      
       title: { text: 'Percentage' }, 
       crossesAt: 12, 
       showNextToAxisLine: false 
     }, 
     //.. 
}); 
 
Now the chart axis line only placed at 12. Axis labels and title are placed outside the chart area. Please find the screenshot below. 
 
In the below link, we have attached sample for your reference.  
Sample link: stackedbar 

Find the axis-crossing demo sample from the below link 

To know more about axis crossing, please follow the below link. 

Please let us know if you have any concern. 

Regards, 
Sanjith.  


Loader.
Live Chat Icon For mobile
Up arrow icon