Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LegendLabels values overlapped (Read 5056 times)
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
LegendLabels values overlapped
Sep 7th, 2012 at 9:14am
Print Post  
Dear Stoyan,

     i am not able to wrap the LegendLabels property, it is getting overlapped

currently i have 14 columns but soon i will have around 50. kindly help

my code follows

int[] tcount = new int[count];
                string[] vname = new string[count];
                for (int i = 0; i < count; i++)
                {
                    tcount[i] = Convert.ToInt32(ds.Tables[0].Rows[i]["total_count"]);
                    vname[i] = (ds.Tables[0].Rows[i]["village_name"].ToString());
                }
                BarChart1.Data = tcount;
                BarChart1.XLabels = vname;
                BarChart1.LegendColumns = count;
                BarChart1.LegendLabels = vname;
                BarChart1.LegendWordWrap=true;
                //BarChart1.PieceOutIndex = 0;
                //BarChart1.PieceOutPercent = 60;
                BarChart1.TitleText = "Pregnant Women anemic-" + phcs;
            
                //Brushe
                BarChart1.ChartBrushes[0] = new MindFusion.Drawing.PathGradientBrush("#FFFFFFFF;#FFFF8080;0;0;0;0;");
                BarChart1.ChartBrushes[1] = new MindFusion.Drawing.PathGradientBrush("#FFFFFFFF;#FFFF8080;0;0;0;0;");
  

legends.JPG (Attachment deleted)

if you want something then go and grab it
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LegendLabels values overlapped
Reply #1 - Sep 7th, 2012 at 12:50pm
Print Post  
Hi,

Are you trying to break the legend labels into several rows? This is possible, but it is not done with the LegendWordWrap property. LegendWordWrap breaks a long legend label into smaller text lines and will work if labels contain more than one word. Try this if you want to have legend labels arranged in a table of several rows and columns:

Code
Select All
barChart1.LegendColumns = 10;
barChart1.LegendWidth = 600; 



Setting columns to 10 as above will arrange 50 labels in 5 rows. If you don't specify LegentWidth explicitly, the max. width of the legend box will be equal to the width of the chart and that might not be enough to fit all labels.

You could also try rotating the axis labels to prevent them from overlapping:

Code
Select All
barChart1.XAxisSettings.RotationAngle = 30; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
madhan1
Full Member
***
Offline


FOLLOW NO ONE BUT LEARN
FROM EVERY ONE ..

Posts: 101
Location: India
Joined: Feb 17th, 2010
Re: LegendLabels values overlapped
Reply #2 - Sep 10th, 2012 at 12:56pm
Print Post  
Thanks stoyan.
  

if you want something then go and grab it
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint