Page 1 of 1
Change map border color
Posted: Thu Apr 11, 2024 1:05 pm
by drewdavis
Hi everybody,
I am using WorldHigh.md map to display country outlines on my chart. Is there a way to change country border colors at runtime?
Thanks in advance!
Re: Change map border color
Posted: Fri Apr 12, 2024 9:10 am
by ArctionKestutis
For Regional map item you could find
BorderLineStyle property (including Color and Width sub-properties). But for that property to be taken into account your Land/region layer's
BorderDrawStyle property should be set as 'Individual'.
You can find and experiment with those properties in our Demo (
https://lightningchart.com/net-charts/d ... nningDemo/)
With those changes you can change border for each country in real-time as long as you have access to map-item.
For example,
Code: Select all
MapLayer[] layers = _chart.ViewXY.Maps.Layers;
int length = layers.Length;
MapLayer layer = null;
for (int i = 0; i < length; i++)
{
layer = layers[i];
if (layer.Type == MapLayer.LayerType.Land)
{
(layer as RegionLayer).BorderDrawStyle = Map.DrawStyle.Individual;
}
}
// AND
MapItem mapItem = e.MapItem;
((Region)mapItem).BorderLineStyle.Color = Colors.Red;
Hope this helps. If you need more technical support, then contact us (
https://lightningchart.com/net-charts/d ... d/support/)