position of ... series2.IsValueShownAsLabel = true;  c#

Posted on 2014-08-13
Last Modified: 2014-08-14
The following line of code

series2.IsValueShownAsLabel = true;      

shows the data values for series2 above the line (default setting I guess).

70_____________________________________________________________     <-- above the line

Question: How can I make the value position on the line or below the line as shown below:

70-----------------------------------------------------------------------          <-- on the line
______________________________________________________________         <-- below the line

Thank you.
Question by:Mike Eghtebas
    LVL 35

    Expert Comment

    by:Robert Schutt
    You use CustomProperties on series or point for that, for example:
    series2.IsValueShownAsLabel = true;
    series2.CustomProperties = "LabelStyle=Center";
    series2.Points[0].CustomProperties = "LabelStyle=Bottom";

    Open in new window

    Description of LabelStyle:  /
    All custom properties (note that not all are available for column chart):
    Other ways to set custom properties:
    LVL 35

    Accepted Solution

    I see in your other new question that you were already close to a solution but using BarLabelStyle, which is for use in a bar chart.
    Also, it's important to note that SmartLabelStyle must be disabled so for example:
                    chart.Series["Default2"].SmartLabelStyle.Enabled = false;
                    chart.Series["Default2"]["LabelStyle"] = "Center";  // This will change Label Position
                    chart.Series["Default2"].LabelAngle = 90;    // This will rotate Data Label

    Open in new window

    So that second line is one of the alternative ways to set a Custom Property, maybe a bit nicer than what I did in my initial post on this question.
    LVL 33

    Author Closing Comment

    by:Mike Eghtebas
    Thank you very much as always.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    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

    20 Experts available now in Live!

    Get 1:1 Help Now