Section 7: Configuring a Map with Data Expressions

NOTE: A valuable feature of NetCharts Designer is its ability to dynamically generate map images that are automatically color-coded by the given data, thus visualizing your data.

When Completed

Your NetCharts Designer perspective will appear like this:
 
map

Create a New Project

Close all open editors if there are any, and then create a new project named MapProject.

Import an Image into the Project

There are a number of ways to get images into a project, but we will use the import function to do so. Select the MapProject and click on the right mouse button to bring up the menu. Choose the Import menu item.

NOTE: For example, copy/paste, dragging from file browsers, etc.

 
map
 
Expand the General group, select File System from the dialog and then click the Next button. Browse to the C:\Program Files\Visual Mining\NetCharts Designer 7.0\plugins\netcharts.NetCharts Designer_7.0.0\images sub‐directory. In the right panel of the dialog find the usatwolt350.png file and check the box next to it.
 
map
 
Click the Finish button to import the file into the project.

Create Map Regions

Next, we will need to draw the regions that we want to be able to color code. Map regions are defined through the use of the Named Data Set wizard. Bring up the Named Data Set wizard by selecting the New NDS wizard icon in the taskbar.
 
In the Named Data Set wizard, set the Named Data Set Name to mapregions. Then select the Map Region option.
 
map
 
Click Next. In the Select Image group, click on the Image button to launch the file chooser dialog. Select the usatwolt350.png file
 
map
 
Click on Open to bring the image into the wizard.

NOTE: If the name of the image corresponds to the name of an NDS file already in the project, the wizard will ask the user if the user wishes to load that NDS file and try to read polygons from the NDS. This is a useful feature if the polygon region data set needs to be changed or polygons must be added.

Expand the wizard horizontally so you may see the entire map.
 
map
 
In the Select Image group, set the Zoom to 4, and then resize the wizard to show as much of the image as will make you comfortable.
 
map
 
Using scroll bars if necessary, with the left mouse button and clicking on points, draw the region around Nevada, making sure your last mouse click is coincident with the first. Note that map points can be removed by clicking on the right mouse button.
 
map
 
In the Current Polygon group, change the Tag Name to be Server 1 Hits. In the Defined Polygons group, click the Add button to add the region to the list.

NOTE: This tag name will be used later to associate data to this region.

 
map
 
Next, draw a region around Colorado. In the Current Polygon group change the Tag Name to Server 2 Hits. Select the Add button to add that region to the list.
 
Finally, draw a region around North Dakota. In the Current Polygon group, change the Tag Name to Server 3 Hits. Select the Add button to add that region to the list.
 
map
 
Select Finish. The data editor will appear in the main window. Depending on how many points you clicked around the state borders your data my look a little different.
 
map
 
In this case, we will not be editing this data again, so you may close the data editor by selecting the X on the editor tab.

Create the Map Chart

Select the New Chart wizard icon from the tool bar. After the chart wizard appears type in chart as the Chart Name, and select Map as the type.
 
map
 
Select Next. Using the Map Image button, select the Select the usatwolt350.png file.

NOTE: Note that mapregions.ndx is already selected as this map’s region source.

map
 
Select Open, and then Finish on the wizard. The chart will be shown with its defaults. Note also that moving the mouse over the regions will display the label for that region.
 
map

Create Map Data Set

This data will be used to “drive” the chart. Map data is comprised of two elements, the polygon/region “tag” name, and the associated value. This step will configure the data in order to graph those points.
 
Bring up the Named Data Set (NDS) wizard by selecting on the NDS icon. Set the Named Data Set Name to mapdata and select the Hypersonic SQL option.
 
Select Next. Type in select * from pagehittable in the SQL field
 
map
 
Select Finish bringing up the data editor. In the General group, set the Date Format to MMM‐yy (ex. Jan‐02). Click on the Functions tab at the bottom of the data editor. In the Data Pivot group, select the Transpose check box.
 
map

Configure Data Expressions

Click on the chart.cdx – MapProject tab on the editor to bring the chart editor back up. In the tree control, select the Map Expressions node. In the Map Expressions group, select on the Add button. Select the color button and set to red. Set the Fade to 50%. Set for values: to > 1000.
 
map
 
Click the OK button.
 
Click the Add button again. Set the color button to yellow with 50% fade. Set for values between 500 and 1000.

NOTE: Note that you may need to scroll down the for values menu to find the between expression.

 
map
 
Click the OK button
 
Click the Add button again. Set the color button to green with 50% fade. Set for values <= 500.
 
map
 
Click the OK button.

Bind Data to the Chart

Select the Data Source Binding tab at the bottom of the editor. Select the Map Region Data from the tree control. Select the mapdata.ndx from the Data Source menu.
 
map
 
Set the menu over the first column to Tag. Set the menu over the second column to Polygon Point Element. Then, check Row 3. Note that North Dakota changed to yellow since the expression mapping for yellow was those values between 500 and 1000.

map
 
Then check Row 1 and Row 2.
 
map
 
Note that different data columns will produce different results. Change the menu over the second column to <off> and change the fourth column to Polygon Point Element.
 
map