Change map border color

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
drewdavis
Posts: 1
Joined: Thu Apr 11, 2024 11:01 am

Change map border color

Post by drewdavis » Thu Apr 11, 2024 1:05 pm

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!

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Change map border color

Post by ArctionKestutis » Fri Apr 12, 2024 9:10 am

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/)

Post Reply