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

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
70

Thank you.
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert SchuttSoftware EngineerCommented:
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:  / http://msdn.microsoft.com/en-us/library/dd489245(v=vs.110).aspx 
All custom properties (note that not all are available for column chart): http://msdn.microsoft.com/en-us/library/dd456764(v=vs.110).aspx 
Other ways to set custom properties: http://msdn.microsoft.com/en-us/library/dd456700(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
0
Robert SchuttSoftware EngineerCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Thank you very much as always.

Mike
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.