Share via


DisplayDataMap method

Displays the set of data as a DataMap object. Any parameters that are not set will have the default values that would be used in the Data Mapping Wizard in the user interface. When you change one or more parameters using this method, the other parameters do not change. Fails for DataSet objects with a DataMapType property of geoDataMapTypeTerritory.

Applies to

Objects: DataSet

Syntax

object.DisplayDataMap([DataMapType], [DataField], [ShowDataBy], [CombineDataBy], [DataRangeType], [DataRangeOrder], [ColorScheme], [DataRangeCount], [ArrayOfCustomValues], [ArrayOfCustomNames], [DivideByField], [ArrayOfDataFieldLabels], [ArrayOfPushpinSymbols])

Parameters

Part

Description

object

An expression that returns a DataSet object.

DataMapType

Optional GeoDataMapType. The type of data map to display. Default is geoDataMapTypeDefault.

GeoDataMapTypeValueDescription
geoDataMapTypeCategoricalColumn8Column Chart Map
geoDataMapTypeDefault–1MapPoint will select the map type
geoDataMapTypeMultipleSymbol5Multiple Symbol Map
geoDataMapTypeNone0Not valid for use with the DisplayDataMap method
geoDataMapTypePushpin4Pushpin Map
geoDataMapTypeSeriesColumn9Series Column Chart Map
geoDataMapTypeShadedArea1Shaded Area Map
geoDataMapTypeShadedCircle3Shaded Circle Map
geoDataMapTypeSizedCircle2Sized Circle Map
geoDataMapTypeSizedPie6Sized Pie Chart Map
geoDataMapTypeTerritory10Not valid for use with the DisplayDataMap method
geoDataMapTypeUnsizedPie7Unsized Pie Chart Map

DataField

Optional Variant. A Field object or an array of Field objects of the data set to be mapped. String fields are invalid for Unsized Pie Chart, Sized Pie Chart, Column Chart, and Series Column Chart maps. Default is the first valid field in the data set.

ShowDataBy

Optional GeoShowDataBy. The geographical entity by which the data is to be shown on the map. See GeoShowDataBy values for a list of values and descriptions. Default is geoShowByDefault.

CombineDataBy

Optional GeoCombineDataBy. Used only if data aggregration is required. Data aggregation is required when the geographical entity designated by GeoShowDataBy is bigger than the set of data to be mapped. Is ignored (geoCombineByNone) if not needed or if the DataSet object has a HowCreated property of geoDataSetDemographic. Default is geoCombineByDefault.

GeoCombineDataByValueDescription
geoCombineByAdd1Data is combined by adding
geoCombineByAverage2Data is combined by calculating an average
geoCombineByCount3Data is combined by a count
geoCombineByDefault-1MapPoint will determine how to combine the data
geoCombineByNone0Data is not combined

DataRangeType

Optional GeoDataRangeType. Determines the appearance of data on the map by range type. Default is geoRangeTypeDefault.

GeoDataRangeTypeValueDescription
geoRangeTypeContinuous1Continuous range of data (used by all map types except Multiple Symbol and Unsized Pie Chart maps)
geoRangeTypeContinuousLog2Continuous logarithmic range of data (used by all map types except Multiple Symbol and Unsized Pie Chart maps)
geoRangeTypeDefault-1MapPoint will determine a range type
geoRangeTypeDiscreteEqualRanges3Discrete equal ranges of data (used by Shaded Area, Shaded Circle, Sized Circle, Multiple Symbol, and Sized Pie Chart maps)
geoRangeTypeDiscreteLogRanges5Discrete logarithmic ranges of data (used by Shaded Area, Shaded Circle, Sized Circle Maps, Multiple Symbol, and Sized Pie Chart maps)
geoRangeTypeEqualDataPoints4Equal data points (used by Shaded Area, Shaded Circle, Sized Circle, Multiple Symbol, and Sized Pie Chart maps)
geoRangeTypeNone7Data is not mapped as a range (used for Unsized Pie Chart maps)
geoRangeTypeUniqueValues6Data that contains text strings, categories, or classes of data (used by Shaded Area, Shaded Circle, Sized Circle, and Multiple Symbol maps)

DataRangeOrder

Optional GeoDataRangeOrder. Determines the order in which data is displayed. Ignored for Unsized Pie Chart, Column Chart, and Series Column Chart maps. Default is geoRangeOrderDefault.

GeoDataRangeOrderValueDescription
geoRangeOrderDefault-1MapPoint will determine a range order
geoRangeOrderHighToLow2Display data in high to low order
geoRangeOrderLowToHigh1Display data in low to high order

ColorScheme

Optional Long. An integer that determines the color scheme used for mapped data. See the ColorScheme property topic for color schemes and integer values associated with different data map types. Default is geoColorSchemeDefault (-1).

DataRangeCount

Optional Long. An integer (1–8) that indicates the number of data ranges. Ignored for continuous data ranges and Unsized Pie Chart, Column Chart, and Series Column Chart maps.

ArrayOfCustomValues

Optional Variant. An array of the custom value for each data range. If used, this parameter sets the IsCustomized property of a DataRanges collection, which will be cleared if the user changes the range type. Ignored for Unsized Pie Chart maps.

  • For continuous and continuous logarithmic ranges, the array size is 3. Only the first and last values should be set (similar to the user interface where the middle value is disabled).

  • For unique values, the array size is equal to the DataRangeCount parameter.

  • For discrete equal ranges, discrete logarithmic ranges, and equal data points, the array size is equal to the DataRangeCount parameter +1. Contains the low values of each range plus the high value of the top range.

  • For Column Chart and Series Column Chart maps, the array size is 5 to match the ArrayOfCustomNames parameter, but only the first and last values are used (similar to the user interface where the middle three values are disabled).

ArrayOfCustomNames

Optional Variant. An array that contains labels for the map legend. Ignored for Unsized Pie Chart maps.

  • For continuous ranges, the array size is 3.

  • For Column Chart and Series Column Chart maps, the array size is 5.

  • For all others, the array size is determined by the DataRangeCount parameter.

DivideByField

Optional Variant. The field or column to which the DataFields property of the DataMap object is compared. If this parameter is not provided, then the current DivideByField is used. To clear the DivideByField, pass in an empty variant.

ArrayOfDataFieldLabels

Optional Variant. An array that contains color labels for the legend. For Series Column Chart maps, the array size is 1. For the other map types, the array size is equal to the number of data fields.

ArrayOfPushpinSymbols

Optional Variant. An array that establishes the Pushpin symbols used with Multiple Symbol maps. The array size is equal to the DataRangeCount parameter, and values are 0–335, or if custom symbols are used, 0 to the highest ID property of a custom Symbol object.

Remarks

Example

[Microsoft Visual Basic 6.0]

Sub CreateShadedAreaMapUsingMapPointDemographics()
Dim objApp As New MapPoint.Application
Dim objDataSet As MapPoint.DataSet
Dim objDataMap As MapPoint.DataMap
Dim objField As MapPoint.Field

'Set up application and objects to use
objApp.Visible = True
objApp.UserControl = True
Set objDataSet = objApp.ActiveMap.DataSets.GetDemographics()
Set objField = objDataSet.Fields("Households (2000)")

'Create the data map, and give it a name
Set objDataMap = _
objDataSet.DisplayDataMap(geoDataMapTypeShadedArea, _
objField, geoShowByRegion1, geoCombineByDefault, _
geoRangeTypeDiscreteEqualRanges, geoRangeOrderDefault, 15)
objDataMap.LegendTitle = "State Households"
End Sub

[C#]

void CreateShadedAreaMapUsingMapPointDemographics()
{
MapPoint.ApplicationClass objApp = new MapPoint.ApplicationClass();
MapPoint.DataSet objDataSet;
MapPoint.DataMap objDataMap;
MapPoint.Field objField;

//Set up application
objApp.Visible = true;
objApp.UserControl = true;

//Get a new demographics set to DataMap
objDataSet = objApp.ActiveMap.DataSets.GetDemographics(MapPoint.GeoCountry.geoCountryDefault);

//Get a field from the demographics
object key = "Households (2000)";
object missing = System.Type.Missing;
objField = objDataSet.Fields.get_Item(ref key);
//Create the data map and give it a name
objDataMap = objDataSet.DisplayDataMap(MapPoint.GeoDataMapType.geoDataMapTypeShadedArea,
objField, MapPoint.GeoShowDataBy.geoShowByRegion1,
MapPoint.GeoCombineDataBy.geoCombineByDefault,
MapPoint.GeoDataRangeType.geoRangeTypeDiscreteEqualRanges,
MapPoint.GeoDataRangeOrder.geoRangeOrderDefault, 15,
0, missing, missing, missing, missing, missing);
objDataMap.LegendTitle = "State Households";
}

Note   This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.