This is a migrated thread and some comments may be shown as answers.

[Solved] How to make category axis values vertical in a column chart ?

2 Answers 62 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
veysel
Top achievements
Rank 1
veysel asked on 01 Dec 2011, 03:49 PM
Hello,
I'm using a column chart (code sample below). Category values appear vertically and texts overlap.
I want to make category values written vertically. Is there a way to do this ? 
Html.Telerik().Chart()
       .Name("chart")
       //.Title(t => t.Text("Statistics"))
       .Series(s =>
       {
           s.Column(new int[] {Model.UserEntityCounts.MRCount ?? 0
               , Model.UserEntityCounts.POCount ?? 0
               , Model.UserEntityCounts.MRApprovalCount ?? 0
               , Model.UserEntityCounts.POApprovalCount ?? 0
               , Model.UserEntityCounts.ShipmentCount ?? 0
           }
           );
       })
       .CategoryAxis(a => a.Categories(new string[] {"Category Text 1", "Category Text 2", "Category Text 3", "Category Text 4", "Category Text 5"}))
       .HtmlAttributes(new { style = "height: 300px;" })

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 02 Dec 2011, 04:50 PM
Hello Veysel,

You could use the Rotation method in the Category Label configuration to adjust the exact angle of the category values. For example:

.CategoryAxis(a =>
   {
       a.Categories(new string[] { "Category Text 1", "Category Text 2", "Category Text 3", "Category Text 4", "Category Text 5" });
       a.Labels(l => l.Rotation(90));
   })

 

Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
veysel
Top achievements
Rank 1
answered on 05 Dec 2011, 10:32 AM
Hi,
This worked perfectly. Thank you very much.
Tags
Chart
Asked by
veysel
Top achievements
Rank 1
Answers by
Daniel
Telerik team
veysel
Top achievements
Rank 1
Share this question
or