Profile Picture

Changing legend size via Legend.Size

Posted By Benjamin Haas 14 Years Ago
Author
Message
Benjamin Haas
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 0, Visits: 1
Aha, this helps! Thank you very much for the help!

Nevron Support
Posted 14 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 Ben,

You have to set the UseAutomaticSize to false - for example the following code displays the legend at the control center and stretches it to 40% and 20% from  the control width/height respectively:

Dim legend1 As NLegend = NChartControl1.Legends(0)
legend1.Visible = True
legend1.Data.ExpandMode = LegendExpandMode.ColsOnly
legend1.ContentAlignment = ContentAlignment.BottomRight
legend1.BoundsMode = BoundsMode.Stretch
legend1.FillStyle = New NColorFillStyle(Color.Red)
legend1.Location = New NPointL(New NLength(50, NRelativeUnit.ParentPercentage), New NLength(50, NRelativeUnit.ParentPercentage))
legend1.Size = New NSizeL(New NLength(40, NRelativeUnit.ParentPercentage), New NLength(20, NRelativeUnit.ParentPercentage))
legend1.UseAutomaticSize = False

Hope this helps - let us know if you meet any problems.



Best Regards,
Nevron Support Team



Benjamin Haas
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 0, Visits: 1

Hello,

I am having difficulty changing the size of the legend on my pie chart, and I'm wondering if someone could be of assistance. I am attempting to modify the size of the legend using the legend.Size property, but no matter the value I use, the size does not change. This is the code I am using:

Dim legend1 As NLegend = nChartControl1.Legends(0)
legend1.Data.ExpandMode = LegendExpandMode.ColsOnly
legend1.ContentAlignment = ContentAlignment.BottomRight
legend1.FillStyle = myLegendFontColor
legend1.Location = NPointL(New NLength(0, NRelativeUnit.ParentPercentage), New NLength(90, NRelativeUnit.ParentPercentage))
legend1.Size = NSizeL(New NLength(50, NRelativeUnit.ParentPercentage), New NLength(50, NRelativeUnit.ParentPercentage))


I consulted the online documentation, specifically the following link, but could not find any documentation on the legend.Size property:
http://helpdotnetvision.nevron.com/UsersGuide_Legend_Legend_Appearance.html


Thanks very much,
Ben





Similar Topics


Reading This Topic