Jump to content
Software FX Community

How to wrap legend labels when they are too long


TKE

Recommended Posts

Hello TKE,

To accomplish this you may want to use the following:

chart1.LegendBox.Height = 100;

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

chart1.LegendBox.Width = 100;

chart1.LegendBox.Style |= ChartFX.WinForms.LegendBoxStyles.Wordbreak;

Notice that for the property Wordbreak of the LegendBox you must set the size of your LegendBox.

Here is my full sample code:

chart1.Data.Series = 1;

chart1.Data.Points = 3;

chart1.Gallery = ChartFX.WinForms.Gallery.Pie;

chart1.LegendBox.Visible = true;

chart1.Data[0, 0] = 30;

chart1.Data[0, 1] = 50;

chart1.Data[0, 2] = 20;

chart1.Data.Labels[0] = "Internet Explorer nbvbvxbvx";

chart1.Data.Labels[1] = "Netscape";

chart1.Data.Labels[2] = "Other";

chart1.LegendBox.Height = 100;

chart1.LegendBox.Width = 100;

chart1.LegendBox.Style |= ChartFX.WinForms.LegendBoxStyles.Wordbreak;
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...