Positioning of Lable on X-Axis

Hi,
I want to change the position of X-axis label in my chart which is having 3 column series. Currently the label is getting placed on the second series.I need to put it below the first series.
What i want to acheive is :
file attached as 1.png
What I am currently getting is :
file attached as 2.png

Attachment: Output_files_500773ef.zip

5 Replies

MP Michael Prabhu M Syncfusion Team September 21, 2018 08:50 AM UTC

Hi Urvashi, 
 
Greetings from Syncfusion, we have analyzed your query and we like to get to know your scenario better so that we can provide you a proper solution. Can you provide us more information on the following? 
 
1.      How many series have you used? 
a.      Have you used 3 column series with 1 data on each series? 
b.      Or have you used 1 column series with 3 data point on it? 
2.      In either case can you let us know what type of axis you are using? 
3.      If possible, can you provide us the data for the chart or some code snippets that define your chart? 
 
Because from the given screenshot we were not able to understand your application scenario or the context at what you are trying to achieve clearly, we like to explain behavior of the axis labels in detail, axis labels are placed in the axis based on the range and interval that is automatically calculated based on the data passed on the series. For e.g. if the range is 0 to 10 and the interval 2 you can see labels in the order like 0,2,4,6,8,10. This is the behavior of our chart, same for DateTime axis with respect date time interval and range. So, if you could provide the context of your requirement then we could provide a possible solution. 
 
Thanks, 
Michael  




UR Urvashi September 21, 2018 09:35 AM UTC

Hi,
I'm using 3 column series with 1 data on each series.
The data is like following:
  Data3 = new List<Person>()
            {
                new Person{Name = "7 AM",Height= 1},
                new Person{Name = "8 AM", Height=2},
                new Person{Name = "9 AM", Height=3},
                new Person{Name = "10 AM", Height=2.5},
                new Person{Name = "11 AM", Height=1},
                new Person{Name = "12 AM", Height=0.0},
            };

X-being the string format(Showing hours),Y being the height.Hope it gives some insite.



MP Michael Prabhu M Syncfusion Team September 21, 2018 12:34 PM UTC

Hi Urvashi, 
 
We have analyzed your requirement and x-axis label can be positioned by using the "LabelAlignment" property as like in below code snippet and we have prepared a sample based on that and it can be downloaded from the below link. 
 
 
Code snippet[C#]: 
 
  <chart:CategoryAxis> 
               <chart:CategoryAxis.LabelStyle> 
                      <chart:ChartAxisLabelStyle LabelAlignment="Start" /> 
               </chart:CategoryAxis.LabelStyle> 
</chart:CategoryAxis> 
 
Thanks, 
Michael 
 
 


 



UR Urvashi September 24, 2018 03:24 AM UTC

Hi ,
I'm using sfchart(version : 15.4.0.17).The property LableAlignment is not showing up for me in suggestions , nd if i use your code it doesnt work.

I'm only getting two properties in LabelStyle .


MP Michael Prabhu M Syncfusion Team September 24, 2018 07:22 AM UTC

Hi Urvashi, 
 
The LableAlignment support is released in SfChart(version 16.1.0.24). So please update your SfChart version to use this feature. 
 
Thanks, 
Michael  
 


Loader.
Up arrow icon