Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have a report which has a chart to display the result. The chart can display well but there is no legend on it. My design view cannot be opened(i dont have any idea on why it cant be opened also, sorry). I tried create it in code behind as follow:

C#
this.xrChart1.Legend.AlignmentVertical = DevExpress.XtraCharts.LegendAlignmentVertical.Top;

this.xrChart1.Legend.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Right;

this.xrChart1.Legend.MaxVerticalPercentage = 60;



but the legend would not display out, any ideas would be appreciated. FIY, i put the above codes inside the Report.Designer.cs instead of Report.aspx.cs. Would it affect the outcome?
Posted
Updated 27-May-14 22:40pm
v2

1 solution

under the Series which you have declared if you are using chart. For example series1, series2, etc. write like this:

C#
series1.Name = "any name here";


the colour of the legends will automatically follow the series's colour.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900