Fill rules are used to colorize a map based on the values of a map feature attribute. When creating a fill rule you must specify the fill rule data column name and the fill styles to use. There are two types of fill rules:
C# |
Copy Code
|
---|---|
NMapFillRuleRange fillRule = new NMapFillRuleRange("POP_CNTRY", Color.White, Color.Black, 12); fillRule.DataGrouping = m_DataGrouping; countries.FillRule = fillRule; |
Visual Basic |
Copy Code
|
---|---|
Dim fillRule As NMapFillRuleRange = New NMapFillRuleRange("POP_CNTRY", Color.White, Color.Black, 12) fillRule.DataGrouping = New NDataGroupingOptimal() countries.FillRule = fillRule |
The following is an example of different data grouping algorithms applied to a world map containing information for the population of each country:
Equal Distribution - also known as quantiles, this method allows for unequally sized data intervals and involves adjustment of the interval limits until an equal number of data points can be slotted into each interval.
Equal Interval - also known as equal ranges (or steps), this method involves division of the entire data range into equally sized intervals.
Optimal - adjusts the size of data intervals in order to minimize the classification error and thus the map looks more balanced and the results seem more correct, with just a few shapes in the highest class as one would expect.