Printing a map containing pie/bar themes, Bartheme, When to use a bar theme – Pitney Bowes MapXtreme User Manual

Page 276

Advertising
background image

Chapter 14: Using Themes and Legends

BarTheme

MapXtreme v7.1

283

Developer Guide

Printing a Map Containing Pie/Bar Themes

When cloning a map for printing that contains pie or bar themes, be sure to take the size of the paper
into consideration to get expected results. The paper size is used to calculate the size of the pie/bars
in the printed output. Use the paper size at 100 percent so that the graphs/themes are the same
relative size in the print preview as they are on the MapControl.

BarTheme

A bar theme is an object theme that contains bar charts with bars that represent each data value. A
bar chart is built for every map object (feature) at the centroid of the object, enabling you to analyze
several thematic variables in a particular chart by comparing the height of the bars.

When To Use a Bar Theme

Bar themes are useful for examining the same variable across all the features in your map. For
example, you have a table of U.S. state boundaries containing female and male population. Using
bar charts, you can create a thematic map that displays a two–bar chart for each state: one bar
representing female, and the other representing male population. You can compare the population
differences of each state, or you can examine several states and compare population differences to
the others.

VB example:

Public Shared Sub MapInfo_Mapping_Thematics_BarTheme(ByVal map As Map)
‘ Load a map based on one table.
map.Load(New MapTableLoader(“world.tab”))
Dim lyr As FeatureLayer = CType(map.Layers(“world”), FeatureLayer)

‘ Create a new bar theme.
Dim barTheme As MapInfo.Mapping.Thematics.BarTheme = New _

MapInfo.Mapping.Thematics.BarTheme(map, lyr.Table, “Pop_Native”,_
“Pop_Asian”, “Pop_Other”)

‘ Create an object theme layer based on that bar theme.
Dim thmLayer As ObjectThemeLayer = New ObjectThemeLayer(“World _

Pop”, Nothing, barTheme)

‘ Add object theme to the map’s layer collection.
map.Layers.Add(thmLayer)

‘ Stack the bars and graduate by a constant amount.
barTheme.Stacked = True
barTheme.GraduateSizeBy = GraduateSizeBy.Constant
thmLayer.RebuildTheme()

End Sub

Advertising