Pietheme, When to use a pie theme – Pitney Bowes MapXtreme User Manual

Page 275

Advertising
background image

Chapter 14: Using Themes and Legends

PieTheme

MapXtreme v7.1

282

Developer Guide

PieTheme

A pie theme is an object theme containing pie charts with wedges that represent each data value. In
pie charts you compare the wedges in a single pie, or examine a particular pie wedge across all of
the pies. Pie charts also enable you to compare parts of a whole.

When To Use a Pie Theme

Pie charts are particularly useful for analyzing demographic data. For example, you have a dataset
of demographic information for the United States. Your dataset shows the populations of several
major demographic groups. Using pie charts, you can show the population of each demographic
group, and see what fraction of the pie it makes up in each chart. This enables you to see the
distribution of demographic groups on a per state basis, or across the entire United States. You can
also look at one demographic group and see how the relative population of the group varies in
different states.

VB example:

Public Shared Sub MapInfoMappingThematicsPieTheme(ByVal map As Map)
' Load a map based on one table
map.Load(New MapTableLoader("mexico.tab"))
Dim lyr As FeatureLayer = CType(map.Layers("mexico"), FeatureLayer)

' Create a new pie theme
Dim pieTheme As MapInfo.Mapping.Thematics.PieTheme = New _

MapInfo.Mapping.Thematics.PieTheme(map, lyr.Table, "Cars_91", _
"Buses_91", "Trucks_91")

' Create an object theme layer based on that pie theme
Dim thmLayer As ObjectThemeLayer = New ObjectThemeLayer("Count by _

Vehicle Type", Nothing, pieTheme)

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

' DataValueAtSize is calculated automatically if not specified in the
' pie's constructor. But, you can adjust it. If you do so here, you
' have to rebuild the theme. You can adjust it before creating the
' object theme layer, and that way the pies won't need to be built
' twice.

pieTheme.DataValueAtSize /= 2
pieTheme.GraduateSizeBy = GraduateSizeBy.Constant
thmLayer.RebuildTheme()
End Sub

Advertising