Section 7: Configuring a Map with Data Expressions
When Completed
Your NetCharts Designer perspective will appear like this:
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.
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.
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.
Click Next. In the Select Image group, click on the Image button to launch the file chooser dialog. Select the usatwolt350.png file
Click on Open to bring the image into the wizard.
Expand the wizard horizontally so you may see the entire 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.
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.
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.
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.
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.
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.
Select Next. Using the Map Image button, select the Select the usatwolt350.png file.
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.
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
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.
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.
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.
Click the OK button
Click the Add button again. Set the color button to green with 50% fade. Set for values <= 500.
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.
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.
Then check Row 1 and Row 2.
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.