MSChart stripline text covered by column

Posted on 2011-10-18
Last Modified: 2012-08-13
Programming in Viusal studio 2010 C#, I added mschart in my application and added stripline to chart, but the text of stripline is covered by column. I had tried set text position to far or set Axis X minimum size to -1, the result is still covered or shows ugly.
Is it possible to move stripline text to left side of Axis Y or change setting to let text not covered?
Thanks for any suggestion.

//Define the chart area
            ChartArea chartArea = new ChartArea();
            chartArea.Name = "chartArea"+chartID.ToString();
            //define up stripline
            StripLine sl1 = new StripLine();  
            sl1.BackColor = System.Drawing.Color.Red;  
            sl1.IntervalOffset = 4.25;  
            sl1.StripWidth = 0.001;  
            sl1.Text = "4.25";  
            sl1.TextAlignment = StringAlignment.Near;
            //define low stripline
            StripLine sl2 = new StripLine();
            sl2.BackColor = System.Drawing.Color.Red;
            sl2.IntervalOffset = 2.74;
            sl2.StripWidth = 0.01;
            sl2.Text = "2.74";
            sl2.TextAlignment = StringAlignment.Near;//change near to far, text is still covered
            //chartArea.AxisX.Minimum = -1;//looks ugly in image

Open in new window

Question by:snowycanada
    LVL 9

    Accepted Solution


    I tried to bring the stripline text front.. unfortunately I can't. How about setting the TextOrientation property as like,

    sl1.TextOrientation = TextOrientation.Rotated270;//Display text in vertical from bottom to top

    this should display the text completely

    hope this helps for you

    Author Comment

    seems no more suggestion, i had to increase range at X axis ( max. 12 ) and put text at right side, so text can display completely.
    Thanks for dexterrajesh. I just fell vertical text is hard for user to read.

    Author Closing Comment

    is a solution, but not be convenience for reading

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now