Subscribe to this thread
Home - General / All posts - Help with Script to Format Labels
miken

127 post(s)
#18-Mar-15 15:42

If anyone could please help with code or a link to a topic that covers this it would be greatly appreciated.

I have a drawing with water wells. I also have a table that I want to import or link which contains water quality data for each well over a period of time. I would like to generate a formatted multi-line label as shown in the PNG below. I have included a simple example of what I am looking to do. I have no experience with scripting and would like to use Manifold to create some maps for my environmental projects.

Thanks for any help!

Attachments:
Labels.PNG
LabelsExample.map

adamw


10,447 post(s)
#18-Mar-15 16:17

If you want that to be a labels component (eg, because you have lots of points and don't want to make an image / label for each manually), then (a) get numbers shown in images into fields for points, and (b) create a labels component bound to the points drawing and use these fields in label text.

See examples in this help topic.

You can't align numbers in columns in a single label component, but you can get quite close to the desired look by using multiple label components for the same drawing, displaying different values at different offsets.

After you establish the process in the UI, try scripting it (see the Labels object, etc). If you encounter any specific difficulties, bring them here, we will try to help.

Graeme

990 post(s)
#19-Mar-15 02:26

Attached is a manually configured "if close enough is good enough" solution along the lines Adam suggests. A query pulls out annual summaries which are then related to the well drawing's table. It's then a question of creating and manually tweaking a standard label component with additional lines and extra spaces to approximate your desired appearance. Good luck!

Attachments:
Labels work around.PNG
LabelsExampleWorkAround.map

miken

127 post(s)
#19-Mar-15 14:52

Thank you Adam and Graeme. This helps me get the basics done and I really appreciate your help. I will create a query in my database outside of Manifold to generate a drawing table the looks like Graeme's and import it. I will then set up a label component to approximate what I want as Graeme has done. As I get new data, I can then append the label format as needed with date X and results X.

I will continue to learn how to script and maybe figure something out to automate the label format updates.

Thanks again for the input.

oisink
370 post(s)
#24-Mar-15 18:15

The script in the link below might also help you see hoe to format labels based on field values of the related record.

http://www.georeference.org/Forum/t119153.1#119154

Oisin

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.