- Are you having issues getting labels to appear on a feature layer in a map chart?
I ran into an interesting problem this week. A user was working with a very detailed map chart. It had at least 10 layers split up between marker layers and feature layers. The user wanted to put labels on one of the feature layers that represented well paths (aka well sticks), but they wouldn’t show up. I ran several tests trying to figure out the problem. I put labels on other feature layers. I created new, simpler maps with just this one layer. I compared the settings with other feature layers that had labels.
As is quite often the case, the answer was in the data. The table (an information link) behind the feature layer didn’t have X and Y coordinate columns, and labels need the coordinates to know where to place the labels. The sticks were placed correctly on the map without the x and y coordinates, but the labels require them. I needed to add XCenter, XMax, XMin, YCenter, YMax and YMin columns to make the labels work. The moral of the story — Always check your data!
Update on 8/30/2017 — I ran into this problem again and came back to my post for help in solving it. In re-reading the post, I realized more detail and information were needed to show how I solved the problem.
The post says — I needed to add XCenter, XMax, XMin, YCenter, YMax and YMin columns to make the labels work. Well, how did I do that?
Answer — I used all six of the WKBEnvelope spatial functions
More specifically, I applied those functions to the SHAPE column in my information link. Those functions generate the XCenter, XMax, XMin, YCenter, YMax and YMin columns required for the labels. The exact expression was — WKBEnvelopeXCenter([SHAPE]).
Guest Spotfire blogger residing in Whitefish, MT. Working for SM Energy’s Advanced Analytics and Emerging Technology team!