Profile Picture

Map legends - is it possible to change the border / remove the title etc.

Posted By Kevin Harrison 11 Years Ago

Map legends - is it possible to change the border / remove the title...

Author
Message
Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

It seems that the legend created for maps is very fixed in its appearance, completely unlike legends for charts. We frequently create Reports where maps and charts are displayed side-by-side, so the inconsistency between the legend formatting becomes quite obvious (we prefer our chart legends to have no borders and have the same background as the rest of the chart area).

Is there some way to control the map legend appearance that I have missed?

Thanks

Kevin



Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,043, Visits: 3,777
It depends on the type of map legend you are using. For example if you create the map legend as a table shape, you can then freely modify the style of the table shape in order to customize your map's legend.

Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Sorry, I have no idea what you mean. The code I am using is:

 

NMapLegendRange mapLegend = (NMapLegendRange)nevronMap.GetLegend(fillRuleRange);

mapLegend.Title = this.MapDefinition.LegendTitle;

mapLegend.RangeFormatString = "<= {1:" + numberStringFormat + "}";

mapLegend.LastFormatString = "> {0:" + numberStringFormat + "}";

Panel legendControl = new Panel();

legendControl.Name = LegendPanelControlName;

legendControl.Dock = DockStyle.Top;

 

// Create the legend

mapLegend.Create((Panel)legendControl);

 

There seems to be no way for me to change the appearance of the legend, just call Create()



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Can someone answer this please?

Thanks

Kevin



Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,043, Visits: 3,777

Hi,

From the source code you have provided we can see that you create your legend in a panel. To achive your requirements (i.e. to remove the border and change the background) you need to modify some properties of the panel after you have created the legend:

mapLegend.Create((Panel)legendControl);

 

legendControl.BorderStyle = BorderStyle.None;

legendControl.BackColor = Color.Red;

 

The code above will remove the border of the panel and make its background red.



Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Thanks, that works, but it now looks odd with no border and the same background as the rest of the panel, because the title and its underline is just "floating" there. Is there (or can there be added) an option not to display a legend title?

If I don't set a title, then "Legend" is added by default. If I set the title to null, then I get no title, but I still have the horizontal line separating the title from the legend.



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Can someone reply please?

Thanks

Kevin



Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,043, Visits: 3,777
Hi Kevin and thank you for the feedback. We have added support for this feature to Nevron Diagram for .NET and it will be included in the next service pack of the product. All you'll have to do if you do not want a title for your legend will be to set the Title property of the map legend to null or to the empty string.

Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Great service as usual. Thanks.



Similar Topics


Reading This Topic