Jump to content
Software FX Community

out-map plot by zip, but display different field on mouse-over


DJake

Recommended Posts

Hi Gang,

I am attempting to produce a map which shows the number of trouble tickets at my facilities by location.  Fortunately, I only have 1 facility in each zip code.  No problem mapping by zip code, but I want the facility name to appear instead of the zip code when I mouse-over the location.  I have simplified the code below a bit to focus on the PowerGadgets issue. 

invoke-sql -Conn... -sql "select zip, count(ProblemNum) as tickets, locatName as sites from databaseX where locatState='MD' group by zip" | out-map -mapsource 'US\5-Digit Zips\Ungrouped\MD-5 Digit Ungrouped' -float -refresh 0:2:0 -Titles_0_Text "Maryland Facilities" -Titles_0_Font "Arial,10,style=bold' -Titles_0_Dock Top -conditionalAttributes_0_Color Lime -conditionalAttributes_0_condition_from 0 -conditionalAttributes_0_condition_to 5 -conditionalAttributes_0_Text '0 - 5' -conditionalAttributes_1_Color Yellow -conditionalAttributes_1_condition_from 6 -conditionalAttributes_1_condition_to 10 -conditionalAttributes_1_Text '6 - 10' -conditionalAttributes_2_Color Red -conditionalAttributes_2_condition_from 11 -conditionalAttributes_2_condition_to 100 -conditionalAttributes_2_Text '>10' -values tickets -Label zip -ToolTipFields sites

What I get is zip displayed on each zip code and a mouse-over that opens a yellow box with the zip code and "tickets: XX."  If I shift the label commend to sites, I get a no data, which I would expect because you can't plot alphanumerics on an out-map.  I've tried the ToolTipFormat, but it seems to make all tool-tip functionality disappear.  I sure would appreciate it if you wouldn't mind enlightening me a bit--I haven't had any luck trying to follow the documentation on this one.  Thanks a bunch for your time and great response speed--so much better than most forums.  Best,

David

Link to comment
Share on other sites

Well I tried several different examples.  They failed yesterday but seem to work today.  Only difference is that I didn't preceed with "-ToolTips true".  In any case, here's what I have and where I'm trying to get.

zip   site tickets

22222   XYX   22

21231   ZZZ 11

The out-map will plot zip, but the tool-tip will read "Facility XYX; Tickets:22" I have tried the following (see code from first post):

-ToolTipFields sites,score -ToolTipFormat "My ticket is: %v"  ==> I get "My ticket is 22"-ToolTipFields sites,score -ToolTipFormat "Location: {$_.sites} Tickets: %v"  ==> I get "Location _.sites Tickets: 22"-ToolTipFields sites,score -ToolTipFormat "Location: %L Tickets: %v"==> I get Location: 22222 Tickets: 22"-ToolTipFields sites,score -ToolTipFormat "Location: %N Tickets: %v"==>I get Location: >10 Tickets: 22" (>10 is the index text)

Is there any way to send three values to the out-map with a 1 to 1 correspondence between zip and one of the textual values, and the third the actual value itself, and replace the zip with the matching textual in the text tool?  I what I'm going for makes sense.  Thanks for the help.  Best, David

Link to comment
Share on other sites

OK, this doesn't sound like something you're going to get easily, but it won't be impossible.  Sounds to me like you're going to need to do some file manipulation.

One thing that can be done with out-map is to use the -createlabellinkfile parameter.  This creates a XML file of the format:

<DataText>Something</DataText>  <-The value in the data passed to out-map<SvgText>Something</SvgText> <-The value in the SVG file<DisplayText>Something</DisplayText> <-The value/string that will be displayed as a tooltip

You would need to create this XML file, then iterate through it and rewrite it to what you need, specifically the <DisplayText></DisplayText> entry.

Then, you can use the XML file you created with out-map -labellinkfile to load the map with the particular XML file.

Does this sound like a path you want to go down?  I can certainly help.

We will need to create at least 3 temporary files though: the one created by the -createlabellinkfile, the XML file we rewrite, and a lookup table (the table could even be in-memory actually).

 

Link to comment
Share on other sites

- You should use either ToolTipFields ot ToolTipFormat but not both.

- We have found a bug in some versions of PowerGadgets that make ToolTipFields parameter ignored, this issue has been fixed on build 2783 or later. We will make this build available shortly.

- With a fixed version you should be able to just say -ToolTipFields Site and you will get the following tooltip

Tickets:22Site: XYX

Note that currently we do not support scriptblocks in ToolTipFields and that we will automatically start with the field being charted. Would this be enough for your scenario or is the order of the 2 lines important? If you want to see Facility instead of Sites you could modify your SQL statement to return the field as Facility.

JuanC

Link to comment
Share on other sites

Morning, Juan.

Thank you for your quick response.  I was kinda wondering, because it didn't seem like ToolTipFields did anything.  The Facility/Site thing was just a typo from my vanilla-ing the code sample.  In my case order does not matter--taking the time to build a custom SVG is not always an option in the engagements I am using PowerGadgets to solve (which are a lot--it is a totally awesome tool), at least when you are in the Proof of Concept stage.  All I need is some way for the user to see the name of the site/facility he/she is looking at on the map, so he/she knows what to drill down on for a more detailed set of gadgets for that particular site (passing the facility to the sub-gadget title is no problem).  I am a registered licensee; how do I get build 2783 when it comes out?  Best,

David

Link to comment
Share on other sites

  • 4 weeks later...

Hey Marco,

I talked with tech support and they said 2783 build was in the newest (7/23) release.  I downloaded and tried it, but the functionlity was not changed.  Under the new -Tooltipsfields (as it is intended to work), can you give it more than one parameter name or is it limited to a single parameter?

Best,

David

Link to comment
Share on other sites

Hey Marco,

I talked with tech support and they said 2783 build was in the newest (7/23) release.  I downloaded and tried it, but the functionlity was not changed.  Under the new -Tooltipsfields (as it is intended to work), can you give it more than one parameter name or is it limited to a single parameter?

Best,

David

I'll have to try it out.  I believe you were sent a private link for paying customers.  A new build was (2806) was placed there just this last Tuesday.

I'll have to check if I have 2783 locally.  I had problems with a particular build lately when I tried to upgrade, and that may be the version.  I might have to go with a test virtual machine to be able to try that build out.

First, I'll have to try to figure out how I can reproduce what you're trying to do with just a few lines of code as dummy/fake input.

It could take me a few days to find time to play with this.

(Just to clarify: I am not a PowerGadgets employee, so this testing is done in my spare time.)

Link to comment
Share on other sites

- You should use either ToolTipFields ot ToolTipFormat but not both.

- We have found a bug in some versions of PowerGadgets that make ToolTipFields parameter ignored, this issue has been fixed on build 2783 or later. We will make this build available shortly.

- With a fixed version you should be able to just say -ToolTipFields Site and you will get the following tooltip

Tickets:22

Site: XYX

Note that currently we do not support scriptblocks in ToolTipFields and that we will automatically start with the field being charted. Would this be enough for your scenario or is the order of the 2 lines important? If you want to see Facility instead of Sites you could modify your SQL statement to return the field as Facility.

JuanC

I have build 2806, and "-ToolTipFields Site" does not work properly, the tool tip shows me:

---------------- 

tickets:11

>10

----------------

Which is not what we are asking it to do.

Djake: When do you need this for?  I can provide a workaround...

Link to comment
Share on other sites

  • 1 month later...

Hi Juan,

 Thank you very much for staying with this.  I need to get this in play by the middle of next month.  We purchased an additional 50 licenses and are deploying, but the internals are getting it first and fairly patient, external customers will not be.  The zip code maps are a very handy feature when you want to get a prototype out and the solution sold without incurring the cost of customer SVG map development.  Thanks to you and Marco for the continued assistance.  Best,

 David

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...