Profile Picture

Label shifts to the right side depending on label text length

Posted By Syrhey Karol' 12 Years Ago

Label shifts to the right side depending on label text length

Author
Message
Syrhey Karol'
Posted 12 Years Ago
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi!

It seems that it is an issue.
I’ve added a label into chart. I’ve also set ContentAlignment and Location for the label.
Here is the code:

//string title = "dddd";
string title = "ddddgfhiljklfdgjklgdfjogfdejkgfdljkgdfjlkgalkjgfdljkgligalihgahegihler";

NLabel label = nChartControl1.Labels.AddHeader(title);
label.ContentAlignment = ContentAlignment.BottomRight;
label.Location = new NPointL(new NLength(0), new NLength(0));




If my label contains few symbols then all is fine (image 1.png). But if my label contains big amount of symbols it shifts to the right side (image 2.png).
Empirically way I calculated that if I divide text length on 7 I’ll get amount of pixel that label shifts. So I can Shift it back
What do you think? Maybe I am doing something wrong?

Best Regards,
Zonder


Attachments
1.png (81 views, 3.00 KB)
2.png (67 views, 24.00 KB)



Similar Topics


Reading This Topic