How to align Data label to the right of chart?


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 Jacky,

You have to change the content alignment of the label - in this case you need top left alignment. The following code shows a label positioned at the bottom right side of the control, 5 points from the chart right and bottom edges.

NLabel label = new NLabel();
label.Text =
"Some Label Text";
label.ContentAlignment =
ContentAlignment.TopLeft;
label.Location =
new NPointL(new NLength(100, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));
label.UseAutomaticSize =
true;
label.Margins =
new NMarginsL(5, 5, 5, 5);
nChartControl1.Document.RootPanel.ChildPanels.Add(label);

Hope this helps - let us know if you have any questions or comments.



Best Regards,
Nevron Support Team


Jacky zhang
Jacky zhang
Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)
Group: Forum Members
Posts: 16, Visits: 1
It is a NLabel.
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
Is this a series data label or a NLabel panel? Usually there are more than one data labels in a chart, so this is a little bit confusing.


Best Regards,
Nevron Support Team


Jacky zhang
Jacky zhang
Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)
Group: Forum Members
Posts: 16, Visits: 1

My problem is that the data label is variable length. but I want to keep it in the bottom right of the chart. How to align Data label to just  the right of chart?

thanks,

-Jacky

 


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