Visualizing Spatial Data – Create an interactive report
March 15, 2013 1 Comment
In my previous blog post I showed you how to create a report containing spatial data. But what if you want to give your users a little bit more information. How about a mouse-over tooltip, of what they’re actually looking at? Or maybe even a click-through to another report or website? Let’s take a look at how to achieve this.
I’m starting with the report that I created in my previous blog post. I’m not going to add data to the report, but instead change some options.
Because you’re working with a full map in your report, it might be hard to see what kind of location you’re looking at. So the easiest way to fix this, is to add labels to your map control. But if you have a lot of small polygons, you might end up with somethings that looks like this:
In the image above you see the province of South-Holland. In the red rectangle, you see the 2nd largest city of the Netherlands: Rotterdam. But this illustrates the issue, that if you have a lot of small polygons, you won’t be able to see the labels.
So a workaround for this, is to add a tooltip (a mouseover label) to your report. This will show the label you selected, if you (or the user of your report) can see what the polygon represents. So how can we do that?
Go to your Design window, and right-click on a polygon in your map control, and click on “Polygon Properties”:
In the next window, click on the “Fx” button next to the Tooltip textblock:
In this window, enter the following expression:
Now if you hover over your report, you’ll see the following tooltip:
If you want to spice things up even more, you could also add a click-event to your report. In my case, I wanted to add a click-event that showed the users the Wikipedia page of the city.
Start by right-clicking again on a polygon in your map control, and click “Polygon Properties”. Now go to the Action tab, and click the “Fx” button again:
Now fill in the following expression:
Now if you go to your report, you can click on a polygon and it will open up the Wikipedia page for that specific city.
Another option would be to open up a report via a click-event, to show your users more information from another report. Or maybe you want to redirect your users to a specific page on your intranet. Just imagine all the opportunities…😉