Pagotti Posted May 26, 2009 Report Share Posted May 26, 2009 Hi, I configure AxisX.Style property to a not SingleLine, but label Quote Link to comment Share on other sites More sharing options...
TatianaG Posted May 26, 2009 Report Share Posted May 26, 2009 Unfortunately, Chart FX API does not provide a property to customize Label text area height. You should reduce the text you are currently sending to axis labels. As a workaround, you can change label angle (chart1.AxisX.LabelAngle = 45;). I hope this helps. Regarding the word-wrap question, you can't word-wrap on the axis as you can in a title. As a suggestion - you can use the KeyLabels property (see API reference for details) to assign a short "nick name" to the axis itself and reserve the longer names for the legend box Quote Link to comment Share on other sites More sharing options...
AndreG Posted May 27, 2009 Report Share Posted May 27, 2009 Edit: A little better results, less code. Forgot about the LabelTrimming property... Chart1.AxisX.MaxSizePercentage = 30;Chart1.AxisX.LabelTrimming = System.Drawing.StringTrimming.EllipsisWord; I might have found something that could help you. There is a property in the Axis class called MaxSizePercentage. It will limit the space taken by the axis as a percentage, but in a brute way. It will clip the begining of the string. To avoid that you could force the clipping of the end of the string, using the GetAxisLabel event. Make sure you turn on Notify for the Axis. Chart1.AxisX.MaxSizePercentage = 30;Chart1.AxisX.Notify = true;Chart1.GetAxisLabel += new AxisLabelEventHandler(Chart1_GetAxisLabel); And... protected void Chart1_GetAxisLabel(object sender, AxisLabelEventArgs e){ if (e.Axis == Chart1.AxisX) { if (e.Text.Length > 13) { e.Text = e.Text.Substring(0, 10) + "..."; } }} Quote Link to comment Share on other sites More sharing options...
Pagotti Posted May 27, 2009 Author Report Share Posted May 27, 2009 Hi. The version that I use is 6.2 and I not found this properties (MaxSizePercentage and LableTrimming), but this approach give me an ideia. I try to use Notify and GetAxisLabel event to insert a '\n' character in strings that has a certain size defined by a parameter or a percentage of total height of the control or to use KeyLabels with same technique. If this work I post result here. Thanks again! Quote Link to comment Share on other sites More sharing options...
AndreG Posted May 27, 2009 Report Share Posted May 27, 2009 Ooops. Someone posted a similar question to the 7.0 Web forums and I replied to the wrong one... Sorry! But yes, I hope my solution works for you as well. Let us know. Quote Link to comment Share on other sites More sharing options...
Pagotti Posted June 8, 2009 Author Report Share Posted June 8, 2009 Hi! I tried to insert the '\n' char in text to force a break line, but the labels remain in one line. I configure the AxisX.Style = AxisX.Style and (not SingleLine), but the result is an one line of text in X Axis. How can I tell to control to be a multline for the labels on X Axis and dysplay it correctly? Can you give me a sample? Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.