MapInfo Pro

 View Only
  • 1.  MapInfo Pro Label formatting: How to use 2 colors in one label expression

    Posted 09-20-2017 06:12

    How to use 2 colors in one label expression?

    I have for an example this expression:

    Outer_dia+" "+Dia_unit+" "+Material+" ( "+Label+")"

    The normal label color is set as black.

    The last part with +" ( "+Label+")", I want to make red:

    200mm PE (+label in red = future dim 160 mm PE)



  • 2.  RE: MapInfo Pro Label formatting: How to use 2 colors in one label expression

    Employee
    Posted 09-20-2017 02:48

    I see one way of doing this, Jesper.

    I requires you to have the layer twice in the Layer Control and split the Label Expression into two. But it will also have to have the label shown on two lines - I hope that is ok?

    For the first layer, set the label font to black and the expression to: Outer_dia+" "+Dia_unit+" "+Material

    For the second layer, set the label font to read and the expression to: Chr$(10) + "(" + Label + ")"

    Let me know if this works for you



  • 3.  RE: MapInfo Pro Label formatting: How to use 2 colors in one label expression

    Posted 09-20-2017 02:54

    Thank you Peter. I know this solution but it does not work well for pipe line labels in my case. I was hoping to use a Mapbasic expression setting the font color?? Is it possible?



  • 4.  RE: MapInfo Pro Label formatting: How to use 2 colors in one label expression

    Posted 09-20-2017 03:04
      |   view attached

    In some cases it might work:2017-09-20_090130

    The labels will battle for the space, coming from two layers ;-)

    So I would have preferred to use a label in one line / expression on one layer.



  • 5.  RE: MapInfo Pro Label formatting: How to use 2 colors in one label expression

    Employee
    Posted 09-25-2017 08:04
      |   view attached

    I tried with some other settings. Maybe they work better for you too:

    Make sure both layers have these label have this setting: Curved but without Auto position along line.

    For the black label position it above the line with 0 pixel offset. Label expression: Outer_dia+" "+Dia_unit+" "+Material

    For the red label position it below the line with 1 pixel offset. Label expression: "(" + Label + ")"

    Red and Black label