Profile Picture

How to align Data label to the right of chart?

Posted By Jacky zhang 13 Years Ago
Author
Message
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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
Posted 13 Years Ago
View Quick Profile
Junior Member

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
Last Active: 10 Years Ago
Posts: 16, Visits: 1
It is a NLabel.

Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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
Posted 13 Years Ago
View Quick Profile
Junior Member

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
Last Active: 10 Years Ago
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

 





Similar Topics


Reading This Topic