Nevron Forum

Legend marker size

https://www.nevron.com/Forum/Topic6824.aspx

By Warwick Payten - Monday, August 13, 2012

Hi Is there a way to change the size of the marker in the legend.  There does not seem to be a method for this in Manual Legend Mode.

On the graph i am using the line.markerstyle.width  etc.,  to set the the size.   But the legend still has a large marker in it.

Thanks in advanced for any help.

Warwick

 

 

 

 

 

 

 

By Nevron Support - Monday, August 13, 2012

Hi Warwick,

Currently the legend mark size can be controlled only for the whole legend (not for individual items) through the legend.Data.MarkSize property. We'll publish a SP that will allow you to specify custom mark size per legend item very soon.

By Warwick Payten - Tuesday, August 14, 2012

Thanks   Thats great I only won't to set the marker size to be all  the same anyway.

However I am still a little confused  I tried using:

Dim legend as NLegend = CType(legendsCollection(0), NLegend)

legend.Data.Marksize.Width = New Length(1.5F, NRelative.ParentPercentage)

similar to what i do setting the marker size in the graph but this comes back with the error

"Expression is value and therefore cannot be the target of an assignment"

I have also tried using the following as per the manual:

Dim instance As NLegendData
Dim value As NSizeL

instance.MarkSize = value

value = instance.MarkSize

but  value has two properties that can be set

value.height and value.width

and i am still not clear how to then use that in a statement  as the error comes back with

"Value of tye Nevron.GrahicsCore.Nlength' cannot be converted to NevronGraphicsCore.NSizeL"

 

Cheers Warwick

By Nevron Support - Wednesday, August 15, 2012

Hi Warwick,

The size object is a structure - therefore you cannot assign one of its members like:

legend.Data.Marksize.Width = New Length(1.5F, NRelative.ParentPercentage)

because legend.Data.Marksize will create a copy of the structure and you'll modify the Width property of that copy - that's why you get a compiler error. You need to write something like:

legend.Data.MarkSize = new NSizeL(new NLength(1.5f, NRelativeUnit.ParentPercentage), legend.Data.MarkSize.Height);

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