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


Map legends - is it possible to change the border / remove the title...
Author
Message
Kevin Harrison 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K

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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K

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 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K

Can someone answer this please?

Thanks

Kevin


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

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 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K

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 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K

Can someone reply please?

Thanks

Kevin


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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 1
Kevin Harrison 1
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
Posts: 176, Visits: 1.9K
Great service as usual. Thanks.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search