Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 7 of 7

DisplayDatamap and ArrayOfCustomValues

This is a discussion on DisplayDatamap and ArrayOfCustomValues within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm really at wits end here. I'm trying to display sized pie charts showing the balance of inbound and outbound ...

  1. #1
    PGLRepDev is offline Junior Member White Belt
    Join Date
    Mar 2005
    Posts
    2

    DisplayDatamap and ArrayOfCustomValues

    I'm really at wits end here. I'm trying to display sized pie charts showing the balance of inbound and outbound shipments into an area. I'm outputting graphs for each state, and I'd like to equalize them so that all maps range between 1 and 3000.

    However, the help files are mostly useless in this area. All it says is that only the first and last values should be passed, but doesn't show how. I've seen a handful (okay, 3) posts around the net that are kinda-sorta-related, but nothing substantial -- that works.

    Every time I try to pass specific values, I recieve the oh-so-helpful "The parameter is incorrect." Below is the main example, with variations following.

    I've got other issues going on, but this is by far the most frustrating. Help appreciated in advance.

    Thanks,
    Anthony.


    (NOTE: I've tried in all of these both 0 and 1 as the starting value)
    Main procedure call:
    objDataSet.DisplayDataMap(geoDataMapTypeSizedPie, varArrayOfFields, , , geoRangeTypeContinuous, , , 3, Array(0,,3000), Array("0","1500","3000"))

    Var1:
    .....3, Array(0,1500,3000), Array("0","1500","3000"))

    Var2:
    Dim rngValues(1 To 3) As Variant
    Dim rngNames(1 To 3) As Variant
    rngValues(1) = 0
    rngValues(3) = 3000
    rngNames(1) = "0"
    rngNames(2) = "1500"
    rngNames(3) = "3000"
    .....3, rngValues, rngNames)

    Var2:
    Dim rngValues(1 To 3) As Variant
    Dim rngNames(1 To 2) As Variant
    rngValues(1) = 0
    rngValues(3) = 3000
    rngNames(1) = "0"
    rngNames(2) = "1500"
    rngNames(3) = "3000"
    .....3, rngValues, rngNames)

  2. #2
    PGLRepDev is offline Junior Member White Belt
    Join Date
    Mar 2005
    Posts
    2

    Two Possibilities...

    1. No one has an answer.
    2. No one (statistcally speaking) develops in this monster, so no one has an answer.

    Seriously, this program is BEAUTIFUL. You can produce some truly amazing maps to represent data.

    However, if you have a LOT to do with it, and are a programmer, you're gonna wanna take a crack at the object model. The problem? There are no resources out there. There's nothing like a "Developer's Guide to MapPoint Application Development" out there (as I doubt "MapPoint for Dummies" hits code that hard).

    I just don't get it. Every other MS environment where there's an object model you can hit programmably has some sort of guide to it. MP is well over 5 years old, but there's nothing.

    I'm just getting tired of telling my boss every day, "I'm not any further."

  3. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    I've had a lot of trouble with DisplayDataMap.. it always seems like a minor miracle once it works.

    There is a lot of good content in the articles section.. also try using the Search just below the MP2K above, also try the Google search at the bottom.

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  4. #4
    kdulaney is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    8
    PGLRepDev:

    I had the same problem with DisplayDataMap when passing integer or string arrays in for the legendvalues and legendlabels. I changed them to object[] arrays in C# and viola!. Not sure how that works in VB but thought this might help.

    KD

  5. #5
    Roman Pfarrhofer is offline Junior Member White Belt
    Join Date
    May 2005
    Posts
    1

    Re: Two Possibilities...

    Quote Originally Posted by PGLRepDev
    1. No one has an answer.
    2. No one (statistcally speaking) develops in this monster, so no one has an answer.
    Hi kdulaney!

    I've faced the same problem yesterday and today for many hours: The last hint I needed, I've found in this article: http://support.microsoft.com/default...b;EN-US;305200

    Well, a long hardly commented peace of source, but it helped!

    For everyone who has the same problems here my peace of code that is working. I'm loading my data from a small Excel-Sheet and display the column "Inquiries" as SizedCircles on the map.

    Code:
    object[,] dataArray = { {1, GeoFieldType.geoFieldName}, {
                              2, GeoFieldType.geoFieldInformation}, {
                              3, GeoFieldType.geoFieldLatitude}, {
                              4, GeoFieldType.geoFieldLongitude}, {
                              5, GeoFieldType.geoFieldData}
                            };
    MapPoint.DataSet dataSet = map.DataSets.ImportData(
      "C:\\temp\\Example.xls!Sheet1"
      , dataArray
      , MapPoint.GeoCountry.geoCountryMultiCountry
      , MapPoint.GeoDelimiter.geoDelimiterDefault
      , MapPoint.GeoImportFlags.geoImportExcelSheet
      );
    
    object key = "inquiries";
    Field field = dataSet.Fields.get_Item(ref key);
    if(field != null) {
      object missing = System.Reflection.Missing.Value;
      DataMap dataMap = dataSet.DisplayDataMap(
        GeoDataMapType.geoDataMapTypeSizedCircle // DataMapType
        , field // DataField
        , GeoShowDataBy.geoShowByLatLong // ShowDataBy
        , GeoCombineDataBy.geoCombineByNone // CombineDataBy
        , GeoDataRangeType.geoRangeTypeDiscreteEqualRanges // DataRangeType
        , GeoDataRangeOrder.geoRangeOrderHighToLow // DataRangeOrder
        , 8 // ColorScheme
        , 6 // DataRangeCount
        , missing // ArrayOfCustomValues
        , missing // ArrayOfCustomNames
        , missing // DivideByField
        , missing // ArrayOfDataFieldLabels
        , missing // ArrayOfPushpinSymbols
        );
    
      if(dataMap != null) {
        dataMap.LegendTitle = "some title";
      }
    }
    Example.xls!Sheet1 has following columns:
    Name Description Lat Long Inquiries

    Let me know if this was useful to anyone.

    CU Roman

  6. #6
    chrishad95 is offline Junior Member White Belt
    Join Date
    Jun 2006
    Posts
    1

    sample code

    Here's my code where the enduser has given me a comma separated list of values:

    Code:
    Dim cvalues() As Object
    if _datarangevalues <> "" then
       ReDim cvalues&#40;_datarangecount&#41;
       For irv As Integer = 0 To _datarangecount -1
          cvalues&#40;irv&#41; = _datarangevalues.Split&#40;","&#41;&#40;irv&#41;.trim&#40;&#41;
       Next
       
       odatamap = dsgrid1.DisplayDataMap&#40; _
    		DataMapType&#58;=_datamaptype, _
    		DataField&#58;=oField, _
    		ShowDataBy&#58;=_showbydata , _
    		DataRangeCount&#58;=_datarangecount, _
    		DataRangeType&#58;=_datarangetype, _
    		DataRangeOrder&#58;=_datarangeorder , _
    		ArrayOfCustomValues&#58;=cvalues , _
    		ColorScheme&#58;=mappoint.GeoDataConstants.geoColorSchemeDefault  &#41;
    
    Else 
       '  _datarangevalues = "" they didn't give me anything so 
       ' I will leave out that parm and MP will split them up automatically
    
    	
    	odatamap = dsgrid1.DisplayDataMap&#40; _
    		DataMapType&#58;=_datamaptype, _
    		DataField&#58;=oField, _
    		ShowDataBy&#58;=_showbydata , _
    		DataRangeCount&#58;=_datarangecount, _
    		DataRangeType&#58;=_datarangetype, _
    		DataRangeOrder&#58;=_datarangeorder , _
    		ColorScheme&#58;=mappoint.GeoDataConstants.geoColorSchemeDefault  &#41;	
    end if

  7. #7
    markmpf is offline Junior Member White Belt
    Join Date
    Jul 2010
    Posts
    6

    Re: DisplayDatamap and ArrayOfCustomValues

    I know this thread is old, but I got the answer for this (in VBA at least)

    Code:
    Dim Arr(0 To 2)
    Arr(0) = 0.01
    Arr(2) = 2000.1
                
    Set objDatamap = objDataset.DisplayDataMap(ArrayOfCustomValues:=Arr, _
      ' other parameters here
    )
    With this declaration it also works:

    Code:
    Dim Arr(0 To 2) As Variant

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. DisplayDataMap
    By chpw in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 02-14-2011, 08:26 PM
  2. DisplayDataMap method c#
    By fletch in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-08-2005, 07:26 AM
  3. DisplayDataMap in Delphi 7
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-17-2004, 06:59 AM
  4. DisplayDataMap with delphi ?
    By seb24 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-29-2004, 10:49 AM
  5. DisplayDataMap and C#
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-04-2003, 02:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96