How to change the color and alignment of the chart header?


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Matt,

You need to change the header location and Content alignment:

NLabel header = new NLabel("My Cool Chart");

header.TextStyle.FillStyle = new NColorFillStyle(Color.Blue);
header.TextStyle.FontStyle = new NFontStyle("Arial", 14, FontStyle.Italic);
header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
header.ContentAlignment = ContentAlignment.BottomCenter;
header.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

nChartControl1.Panels.Add(header);

That way the initial position of the header is at x = 50% and the label content is placed around it.



Best Regards,
Nevron Support Team


Matt McLoughlin
Matt McLoughlin
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 1, Visits: 1

1.  How do I change the color of the header text?

2.  How do I align the header to be centered?  Currently it is left justified.  However, when I change header.ContentAlignment, it totally messes up the alignment of the header and the gauge.  All I want to do is center it.

Thanks!!!

 

My current header code:

 

NLabel header = new NLabel("My Cool Chart");

header.TextStyle.FontStyle = new NFontStyle("Arial", 14, FontStyle.Italic);

header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

header.ContentAlignment = ContentAlignment.BottomRight;

header.Location = new NPointL(new NLength(3, NRelativeUnit.ParentPercentage),

new NLength(2, NRelativeUnit.ParentPercentage));


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search