ActiveReports 15 .NET Edition
ActiveReports 15 User Guide / How To / Page Report/RDL Report How To / Report Controls / Work with Map / Work with Layers / Use Color Rule, Marker Rule and Size Rule
In This Topic
    Use Color Rule, Marker Rule and Size Rule
    In This Topic

    You can visualize the data displayed on a map by setting rules to control color, size or marker type for all map elements on a layer. You can set three types of rules depending on the type of layer in use.

    Color Rule

    Color Rule is set to fill colors for map elements like  polygons, markers (points or polygon center points) and lines while using a Polygon, Point or Line layer.
    Color Rule provides four options:

    1. Apply Appearance Settings : Use the default appearance settings that are set in the Appearance page of the map layer dialog. 
    2. Visualize data by using color palette : This option uses an in-built palette that you specify. Based on related analytical data, each map element is assigned a different color from the palette.
    3. Visualize data by using color ranges : This option, combined with the start, middle, and end colors that you specify on this page and the options that you specify on the Distribution page, divide the related analytical data into ranges. The report then assigns the appropriate color to each map element based on its associated data and the range that it falls into. For example, in a map which uses color to display temperatures on a scale of 0 to 100, low values are blue to represent cold and high values are red to represent hot.
    4. Visualize data by using custom colors : This option uses the list of custom colors that you specify. Based on related analytical data, each map element is assigned a color from the list.

    To set Color Rule for polygons, lines and markers

    To visualize polygons, lines or markers using color palette 

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Color Rule page.
    4. In the Color Rule page, select the Visualize data by using color palette option.
    5. In Data field, set the name of the field or expression that contains the analytical data that you want to visualize by color.
    6. In Palette, set the name of the palette to use.
    7. Click OK to close the dialog.

    To visualize polygons, lines or markers using color ranges

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Color Rule page.
    4. In the Color Rule page, select the Visualize data by using color ranges option.
    5. In Data field, set the name of the field or expression that contains the analytical data that you want to visualize by color.
    6. In Start color, set the color to be used for the color range.
    7. In Middle color, set the color to be used for the color range.
    8. In End color, set the color to be used for the color range.
    9. Click OK to close the dialog.

    To visualize polygons, lines or markers using custom colors 

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Color Rule page.
    4. In the Color Rule page, select the Visualize data by using custom colors option.
    5. In Data field, set the name of the field that contains the analytical data that you want to visualize by color.
    6. Click Add to specify each custom color.
    7. Click OK to close the dialog.

    Marker Rule

    Marker Rule is set on markers that represent points or polygon center points on a map while using a Point layer.
    Marker Rule support two options:
    1. Use a default marker type : You specify one of the available marker types.
    2. Visualize data using markers : This option uses a set of markers in an order in which you want them to be used. Marker types include Rectangle, Circle, Diamond, Triangle, Trapezoid, Star, Wedge, Pentagon, PushPin and Image.

    To set Marker Rule for points

    To visualize points using default marker type

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Marker Rule page.
    4. In Default, set a default marker type that will appear in place of each point on a map.
    5. Click OK to close the dialog.

    To visualize points using specific marker types

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Marker Rule page.
    4. In the Marker Rule page, select the Visualize data using markers option.
    5. In Data field, set the name of the field that contains the analytical data that you want to visualize using different marker types.
    6. Click Add and specify each Marker type in an order in which you want them to be used.
    7. Click OK to close the dialog.

    To visualize points using Image as marker type

    ActiveReports provides Image as one of the many available marker types to use from. You can set this marker type and use any image as a marker on a map layer. Like other marker types, you can either use it as a default marker or use it as one of the member in the markers collection.

    Use Image as Default marker type

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, on the General page, set Marker Type to Image. A new set of properties appears on the page.
    4. In Image Source, choose the source of image from the provided options:
      • External: Select this option and set a path or url of the image file in Image Value.
      • Embedded: Choose from the list of embedded images added to your report. Once you set this option, the Image Value provides you the list of embedded images to choose from.
      • Database: Select this option and set the data field containing the image in the Image Value property.
    5. In MIME Type, set the MIME type of the image chosen. In case you are using the Embedded image source the MIME Type gets set automatically as you select the image in the Image Value property.
    6. Set the Transparent Color and the Resize Mode.
    7. Click OK to close the dialog.

    Use Image in markers collection

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Marker Rule page.
    4. In the Marker Rule page, select the Visualize data using markers option.
    5. In Data field, set the name of the field that contains the analytical data that you want to visualize using different marker types.
    6. Click Add and set Marker type to Image. A new set of properties for image marker types appears on the page.
    7. In Image Source, choose the source of image from the provided options:
      • External: Select this option and set a path or url of the image file in Image Value.
      • Embedded: Choose from the list of embedded images added to your report. Once you set this option, the Image Value provides you the list of embedded images to choose from.
      • Database: Select this option and set the data field containing the image in the Image Value property.
    8. In MIME Type, set the MIME type of the image chosen. In case you are using the Embedded image source the MIME Type gets set automatically as you select the image in the Image Value property.
    9. Set the Transparent Color and the Resize Mode.
    10. Click OK to close the dialog.

    Size Rule

    Size Rule is set on markers, polygon center points or line width while using a Polygon, Point or a Line layer.
    Size Rule support two options:
    1. Use a default marker size or Use a default line width : You specify the marker size or line width in points.
    2. Visualize data by using size or Visualize data by using line width : In this option, you set the minimum (start) and maximum (end) sizes or width for marker or line, specify the data field to be used for varying the marker size or line width and then specify the distribution options to apply to that data.

    To set Size Rule for markers and line width

    To visualize marker or line using default marker size or line width

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Size Rule page.
    4. In Default, set default size or width for each marker or line that appears on a map.
    5. Click OK to close the dialog.

    To visualize marker or line using specific marker size or line width 

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the Size Rule page.
    4. In the Size Rule page, select Visualize data by using size or Visualize data by using line width depending on the layer type in use.
    5. In Data field, set the name of the field that contains the analytical data that you want to visualize using different marker sizes or line width.
    6. Set Start size and End size in case of Point Layer or Minimum line width and Maximum line width in case of Line Layer.
    7. Click OK to close the dialog.

    Distribution Options

    The distribution values are used by the rules to differ the map element display values.

    To create a distribution of values, you divide your data into ranges by specifying the distribution method, the number of sub-ranges, and the range start and end values.

    To set distribution values for rules

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the rule page(Color Rule, Marker Rule or Size Rule) where you need to specify distribution values.
    4. In the rule page of the dialog, select any option to visualize data using the selected rule type and go to the Distribution tab.
    5. On the Distribution tab, select one of the following distribution types:
      • EqualInterval : Create ranges that divide the data into equal range intervals. For the example, the three ranges would be 0-2999, 3000-5999, 6000-8999. Sub-range 1: 1, 10, 200, 500. Sub-range 2: 4777. Sub-range 3: 8999.
      • EqualDistribution : Create ranges that divide that data so that each range has an equal number of items. For example, the three ranges would be 0-10, 11-500, 501-8999. Sub-range 1: 1, 10. Sub-range 2: 200, 500. Sub-range 3: 4777, 8999.
      • Optimal : Specifies ranges that automatically adjust distribution to create balanced sub-ranges. The number of Sub-ranges is determined by the algorithm.
      • Custom : Specify your own number of ranges to control the distribution of values. For example, you can specify your own custom ranges 0-5000 and 5001-10000.
    6. In Number of Sub-ranges, type the number of sub-ranges to use.
    7. In Range start, type a minimum range value. All values less than this number are the same as the range minimum.
    8. In Range end, type a maximum range value. All values larger than this number are the same as the range maximum.
    9. Click OK to close the dialog.

    Displaying Rule results in Legend

    To display rule results in Legend

    1. Click the Map until the map panes appear.
    2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer dialog.
    3. In the selected map layer dialog that appears, go to the rule page(Color Rule, Marker Rule or Size Rule) where you need to specify displaying rule results in a legend.
    4. In the rule page of the dialog, select any option to visualize data using the selected rule type and go to the Legend tab.
    5. Select Show in legend checkbox and set Legend name.
    6. In Legend text, enter text that specify which data should appear in the legend. Use map keywords and custom formats to help control the format of legend text. For example, #VALUE {C2} specifies a currency format with two decimal places. Following are the supported formats that you can use:
      Format Description Example
      #Value Displays a numeric value calculated using "(EndRangeValue - StartRangeValue)/2" formula.
      #FROMVALUE {C0} Displays the currency of the total value with no decimal places. $100
      #FROMVALUE {C2} Displays the currency of the total value to two decimal places. $40.25
      #TOVALUE Displays the actual numeric value of the data field. 100
      #FROMVALUE{N0} - #TOVALUE{N0} Displays the actual numeric values of the beginning of the range and end of the range. 10 - 500
    7. Click OK to close the dialog.