BackPrevious Topic  Next TopicNext

Example: Using Geographic Maps

This topic presents an example to demonstrate how you can add a geographic map in a library component and perform data analysis on it in a dashboard.

  1. Make sure SampleReports.cat is the currently open catalog file. If not, navigate to File > Open Catalog to open it from <install_root>\Demo\Reports\SampleReports.
  2. Navigate to Home > New > Library Component.
  3. In the Select Component for Library Component dialog box, select Blank and select OK.
  4. From the Components panel, drag the Geographic Map icon Geographic Map icon in the Visual category to the library component. Designer displays the Create Geographic Map dialog box.
  5. In the Data screen, select WorldWideSalesBV in Data Source 1, then select Next.
  6. In the Display screen, add the group objects Country and then State as the group-by fields to the Drill Path box.
  7. Select Enable Area. Designer selects Enable Marker by default.

Next, we define the marker and area properties for the Country group level.

  1. Select Country in the Drill Path box.
  2. Drag the group object Country from the Resources box to the Shape By text box, then select Shape button beside the text box.
  3. In the Edit Shapes dialog box, select anywhere in the Data Items box and select Ctrl+A on the keyboard to select all countries, then select the icon Solid Circle icon in the preview box below the pattern name to apply the shape to all countries. Select OK to apply the shape.

    Edit Shapes

  4. Drag the aggregation object Total Sales from the Resources box to the Color By text box, then select Color button beside the text box.
  5. In the Edit Gradient Color dialog box, keep the default gradient color, select Middle Value and set its value to 625816.73, specify the opacity to 80%, then select OK to apply the gradient color.

    Edit Gradient Color

  6. Drag the aggregation object Total Cost from the Resources box to the Size By text box, then select Size button beside the text box to specify the zoom percentage to 370%. Select outside the size box to apply the zoom percentage.
  7. Drag the group object Country from the Resources box to the Label By text box under Marker Options.
  8. Select Formula button beside the Marker Tip text box, then select <New Formula...> from its drop-down list to create a formula to control the marker tip information.
  9. In the Enter Formula Name dialog box, type MarkerTipforCountry and select OK.
  10. In the Formula Editor dialog box, define the formula as follows:

    "Country:" + " " + @"Customers.Country" + "\n" +
    "Total Cost:" + " " + ToText(@"Orders Detail.Total Cost","$#,###.00") + "\n" +
    "Total Sales:" + " " + ToText(@"Orders Detail.Total Sales","$#,###.00")

  11. Save the formula and close the Formula Editor dialog box. Designer adds MarkerTipforCountry in the Marker Tip text box automatically.

    Add a Marker Tip

  12. Drag the aggregation object Total Sales from the Resources box to the Fill By text box, then select Color button beside the text box.
  13. In the Edit Gradient Color dialog box, select Green-White-Orange from the gradient color drop-down list, which is the last color at the second line in the list, specify the opacity to 80%, then select OK to apply the gradient color.

Now, we specify the marker and area properties for the State group level.

  1. Select State in the Drill Path box.
  2. Drag the group object State from the Resources box to the Shape By text box.
  3. Select Size button beside the Size By text box to specify the zoom percentage to 230%. Select outside the size box to apply the zoom percentage.
  4. Drag the aggregation object Total Sales from the Resources box to the Fill By text box, then select Color button beside the text box.
  5. In the Edit Gradient Color dialog box, select Green as the gradient color, which is the second color in the color list, specify the opacity to 80%, then select OK to apply the gradient color.
  6. Drag the group object State from the Resources box to the Label By text box under Area Options. Repeat this to add Total Sales to the Label By text box.
  7. Repeat steps 15 to 18 to create another formula AreaTipforState to control the area tip information.

    "Country:" + " " + @"Customers.Country" + "\n" +
    "State:" + " " + @"Customers.State" + "\n" +
    "Total Sales:" + " " + ToText(@"Orders Detail.Total Sales","$#,###.00")

  8. Create the formula LocationInfoforState for the Location Info option.

    @"Customers.State" + "," + @"Customers.Country"

    Add Location Info

  9. Select Next.
  10. In the Filter screen, select Add Condition to add a condition line and specify the filter condition as Country != USA.

    Add a Filter Condition

  11. Select Finish to create the map.
  12. Select the View tab to preview the geographic map. The map shows as a static map and Designer applies the settings we have defined in the Display screen of the map wizard to the map markers and areas.
  13. Preview the geographic map

  14. Navigate to Home > Save to save the library component as Sales Map by Country.lc.
  15. Publish the library component to the default location on Server together with the resources it uses.
  16. Create a dashboard on Server.
  17. In the Resources panel of JDashboard, locate the library component Sales Map by Country.lc in the Component Library node and drag it to the dashboard body.
  18. Point to a marker, and JDashboard displays its tip information just as what we have defined in the map wizard.

    Geographic Map in Dashboard

  19. There are two group levels in this geographic map component, first by Country and then by State, so for the higher group level, we can perform the go-down action, and for the lower group level the go-up action. Point to the marker representing Germany, select it, or right-click it and select Go Down from the shortcut menu. The geographic map jumps one group level down to show the information of states in Germany, and JDashboard displays the filter condition "Country: Germany" at the bottom of the geographic map.

    Click Geographic Map in Dashboard with Information of a State

  20. Scroll the mouse over the geographic map to zoom it out or in. By scrolling the mouse down, we can get a wider area on the map.

    Zoom Out the Geographic Map in Dashboard

Back to top

BackPrevious Topic  Next TopicNext