Custom Label Position for a Map

  • Last update:February 07, 2025
  • Overview

    Version

    Report Server Version

    11.0

    Problem Description

    If you select Area Map a built-in map of FineReport, and set Area Name label to be displayed, the label will be displayed based on the capital city of each province, as shown in the following figure.

     image 31.png

    However, sometimes you may want Area Name to be displayed in the center of each area, similar to how it is displayed on Baidu Maps.

    1709865605bmJ5.png

    Implementation Method

    The position of the label in Area Map is determined by the center point of the area in Map Configuration. You can modify the latitude and longitude of the center point to change the position of the label.

    image 32.png

    Example

    Data Preparation

    Choose File > New General Report in the upper left corner of the designer, create a dataset ds1, and enter the database query statement select * from map.

     image 35.png

    Chart Insertion

    Merge required cells, click Insert Chart icon on the upper toolbar, choose Map > Area Chart, and click OK, as shown in the following figure.

     image 36.png

    Chart Design

    Select the chart, click the Cell Element icon on the right property panel, and set the attributes (Type, Data, Style, and Special Effect) for the chart.

    Legend Setting

    Select the cell where the map is located, choose Cell Element > Type on the right panel, select China as Map Border, and Custom > Dark Blue as GIS Layer, as shown in the following figure. 

    image 37.png

    Data Binding

    Click Data and bind the required data to the chart, as shown in the following figure.

    image 38.png

    Chart Style Setting

    1. Label Setting

    Select Use Label, choose Common > Area Name as Content, and customize the font, size, and color of Character, as shown in the following figure. 

    image 39.png

    2. Setting Series

    Set Color of Border (namely the boundary line) to gray, as shown in the following figure. 

    image 40.png

    The map setting ends here in this example. Save the map and preview it. The following figure shows the effect.

    image 31.png

    Configuring the Center Point of the Map

    1. Choose Server > Map Configuration, log in to the decision-making platform, and wait until you are redirected to the map configuration page.

    image 41.png

    2. In Geographic Information of the map configuration page, select Area, then select China under world, and the highlighted map of China will appear on the right configuration page. The area information will pop up while clicking the area, as shown in the following figure.

    image 42.png

    3. The default center point of the area is the latitude and longitude of the capital city of that area. You can use the coordinate picking system of Baidu Maps to pick the latitude and longitude of the desired location, and then copy the coordinates, as shown in the following figure. 

    image 43.png


    4. Paste the copied coordinates into Center Point of the area in the map configuration, and click Save to save the point. Click Save in the upper right corner and click Sync Geo File, as shown in the following figure. 

    image 44.png

    After successfully synchronizing the geographic files, you can preview the template again in the designer.

    Effect Display

    PC

    Preview the template again, and you can see the label for the Urumqi area displayed in the center, as shown in the following figure. 

    image 45.png

    Mobile Terminal

    The report can be previewed on both the DataAnalyst app and the HTML5 terminal. The following figure shows the effect.

    image 47.png

    Template Download

    For details, you can download the template Custom Label Position for a Map.cpt.

    iconNote:
    After downloading the template, you need to modify the center point of the area according to the method described in the document to see the effect of modifying the label position.

    Attachment List


    Theme: Chart
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy