Control implementation method based on Power BI and Amap four-level region dimension mark display
By combining Gaode maps and echarts in Power BI, the precise marking display and interaction functions of the four-level regional dimensions are realized, which solves the problem that Power BI cannot meet the positioning of the four-level administrative regions, and improves the accuracy and user experience of data visualization.
Patent Information
- Application Number
- CN202510522014.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-08
AI Technical Summary
In the existing technology, Power BI cannot meet the precise positioning and labeling needs of the fourth-level administrative regions, and general map services are difficult to meet the localization needs. It lacks the effective combination of Power BI and Gaode Map to realize the display of four-level regional dimension marking.
Seamlessly connect to Gaode Map in the Power BI environment, and through data cleaning, integration and custom development, it realizes accurate marking display of four-level regional dimensions, and supports rich data interaction, combining Gaode Map API and echarts for map drawing and interaction functions.
It improves the accuracy and intuitiveness of data visualization, enhances the user interaction experience, improves the efficiency and accuracy of data analysis, and supports user-defined styles and interactive operations.
Smart Images

Figure CN120447819A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dimension mark display technology, specifically a method based on Power BI and Amap Figure 4 Control implementation method for displaying level area dimension tags. Background Art
[0002] With the advent of the big data era, data visualization has become one of the most important means of analyzing massive amounts of data. As a powerful business intelligence tool, PowerBI can help users obtain data from various sources and present it intuitively in the form of charts, reports, etc. However, when processing geographic location-related data, the built-in map function of PowerBI may not meet the needs of accurately locating and labeling specific areas (such as fourth-level administrative districts).
[0003] In addition, due to differences in geographic information classification standards among different countries and regions, using general map services may be difficult to meet local needs.
[0004] As a leading map service provider in China, Amap's rich geographic information and precise positioning services provide strong support for data visualization. However, there is currently no custom control on the market that effectively combines Power BI and Amap to display four-level regional dimension markers. Summary of the Invention
[0005] (1) Technical problems solved
[0006] In order to solve the above technical problems, the present invention provides a Figure 4 The control implementation method for displaying markers of four-level regional dimensions can be seamlessly connected to Amap in the Power BI environment to achieve accurate marker display of four-level regional dimensions. It also supports rich data interaction operations and highly customized functions to meet the needs of geographic information data visualization in different business scenarios.
[0007] (2) Technical solution
[0008] Based on this, the present invention provides the following technical solutions: a method based on Power BI and Amap Figure 4 The control implementation method for displaying level-level regional dimension markers is as follows:
[0009] Step S1: Data acquisition and integration: Use the pbiviz cli framework provided by Power Bi officially and the update function to obtain the original data passed in by Power Bi Desktop, and then process and integrate the original data:
[0010] Step S11: Obtaining a data set containing geographic information (such as address, latitude and longitude) and related business data from various data sources (such as enterprise databases, Excel spreadsheets, cloud storage, etc.);
[0011] Step S12: Convert the incoming raw data into JSON format. Replace Null data with 0 to ensure the standardization of the data format and the integrity of the data content.
[0012] Step S13: Clean, convert, and pre-process the data to ensure data accuracy and consistency, analyze the geographic information data, extract the four-level regional dimension information, and associate and integrate it with the corresponding business data;
[0013] Step S2: distinguishing map types, dividing the map into pie chart marks and coordinate point marks;
[0014] Step S21: Embed the AutoNavi map component in Power BI and perform initialization settings through the AutoNavi map API, including configuration of basic parameters such as map type (such as normal map, satellite map), map display range, and zoom level;
[0015] Step S22: Based on the custom development function of Power BI and combined with the API of Amap, a custom control for displaying four-level regional dimension markers is implemented;
[0016] Step S23: When performing map-related operations, the initial data is set to the additive data type. If the value of the quantity field in each data item is exactly equal to 1, and the name field does not contain the names of provinces, cities, or counties, the corresponding map display format is a coordinate point mark map. On the contrary, if the above conditions are not met, that is, the value of the quantity field is not equal to 1 or the name field contains the names of provinces, cities, or counties, the corresponding map display format is a pie chart mark map.
[0017] Step S3: Region marking and visualization: Integrate Amap and echarts, and accurately mark regions on Amap based on the four-level region dimension information in the integrated data;
[0018] Step S31: Accurately mark the regions on the Amap based on the four-level regional dimension information in the integrated data;
[0019] Step S32: For each area marker, associate the corresponding business data and visually display the distribution of business data in different areas through visual elements (such as pie charts to achieve a comparison effect of different categories). For example, the specific location of stores can be displayed through punctuation on the map.
[0020] Step S33: encapsulate corresponding methods for the two different map display formats, namely, pie chart and coordinate point marking;
[0021] Step S4: Interactive function, visual interaction through the report in Power Bi;
[0022] Step S41: Implementing a mouse hover interaction function. When the user hovers the mouse over a region mark, a detailed information box pops up, displaying the region's detailed geographic information (such as name, area, etc.) and detailed content of related business data (such as sales, number of customers, etc.);
[0023] Step S42: Click interaction is supported. After the user clicks the area mark, further operations can be performed, such as drilling down to the next level of area detailed information display;
[0024] Step S43: providing interactive map zooming and panning functions, allowing users to freely zoom in and out of the map to view details of different areas or browse a larger geographical area as needed, while maintaining real-time data loading and consistency of visualization effects during the panning process;
[0025] Step S5: Customize the style. Users can personalize the styles of the controls based on their actual needs, modify the color and theme of the map, and modify the font color, size, etc. according to their needs.
[0026] (3) Beneficial effects
[0027] Compared with the prior art, the present invention provides a Figure 4 The control implementation method for displaying level-level regional dimension marks has the following beneficial effects:
[0028] This is a data analysis based on Power BI and Amap. Figure 4 The control implementation method for displaying level-one regional dimension markers improves the accuracy and intuitiveness of data visualization: by combining the advantages of Power BI and Amap, data visualization of four-level regional dimensions is realized, allowing users to understand and analyze data more intuitively; it enhances the user's interactive experience: custom controls support user interactive operations, such as selecting areas step by step, marking data points, etc., which improves user participation and usage experience; it improves the efficiency and accuracy of data analysis: through data cleaning, modeling and visualization, users can obtain and analyze data more quickly and accurately, providing strong support for decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Schematic diagram of the process of the present invention;
[0030] Figure 2 A schematic diagram of the code for obtaining raw data for the present invention;
[0031] Figure 3 For the present invention, the original data is processed into JSON, and the Null data is replaced with a 0 code diagram;
[0032] Figure 4 This is a schematic diagram of the present invention for determining whether data has repeated codes;
[0033] Figure 5 This is a schematic diagram of the code for determining the data map type of the present invention;
[0034] Figure 6 This is a schematic diagram of the code for integrating Amap and echarts in the present invention;
[0035] Figure 7 This is a schematic diagram of the code encapsulation of the pie chart method of the present invention;
[0036] Figure 8 This is a schematic diagram of the code encapsulation of the coordinate point marking method of the present invention;
[0037] Figure 9 This is a code diagram of the map rendering method of the present invention;
[0038] Figure 10 This is a schematic diagram of the interactive function method code of the present invention;
[0039] Figure 11 Schematic diagram of the code for implementing the custom style of the present invention Figure 1 ;
[0040] Figure 12 Schematic diagram of the code for implementing the custom style of the present invention Figure 2 ;
[0041] Figure 13 This is a schematic diagram showing the effect of the present invention Figure 1 . DETAILED DESCRIPTION
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] See also Figure 1 , a data analytics platform based on Power BI and Amap Figure 4 The control implementation method for displaying level-level regional dimension markers is as follows:
[0044] Data acquisition and integration, through the pbiviz cli framework provided by Power Bi official, with the help of update function to obtain the original data passed by Power BiDesktop, and process and integrate the original data. The specific operations are as follows Figure 2 As shown:
[0045] Obtain data sets containing geographic information (such as addresses, latitude and longitude) and related business data from various data sources (such as enterprise databases, Excel spreadsheets, cloud storage, etc.);
[0046] Convert the incoming raw data into JSON format. For the Null data, replace them with 0 to ensure the standardization of the data format and the integrity of the data content. The specific operation is as follows: Figure 3 As shown;
[0047] Clean, convert, and pre-process data to ensure data accuracy and consistency, analyze geographic information data, extract four-level regional dimension information, and associate and integrate it with corresponding business data;
[0048] Differentiate map types, dividing maps into pie chart markers and coordinate point markers;
[0049] Embed the Amap component in Power BI and perform initialization settings through the Amap API, including configuring basic parameters such as map type (such as regular map, satellite map), map display range, and zoom level;
[0050] Based on the custom development function of Power BI and combined with the API of Amap, a custom control for displaying four-level regional dimension markers is implemented;
[0051] When performing map-related operations, the initial data is set to the additive data type. If the quantity field value in each data is exactly equal to 1, and its name field does not contain the geographical names of provinces, cities, and counties, then the corresponding map display form is the coordinate point mark map; on the contrary, if the above conditions are not met, that is, the quantity field value is not equal to 1 or the name field contains the names of provinces, cities, and counties, the corresponding map display form is the pie chart mark map. Such judgment logic can help us accurately determine the display form of the map based on the specific characteristics of the data, thereby achieving a reasonable and accurate map presentation effect and judging whether the data is repeated. Figure 4 As shown, determine the data map type as Figure 5 As shown;
[0052] After a series of data processing steps, the data has been processed and the next step is to draw a map. In this step, we introduced two very practical tools, Amap and echartsAPI, to assist in map drawing. We integrated Amap and echarts, and based on the four-level regional dimension information in the integrated data, we can accurately mark the regions on Amap. Figure 6 As shown;
[0053] Based on the four-level regional dimension information in the integrated data, accurate regional marking is performed on the Amap.
[0054] For each regional marker, associate the corresponding business data and use visual elements (such as pie charts to achieve a comparison effect of different categories) to intuitively display the distribution of business data in different regions. For example, the specific location of stores can be displayed through punctuation on the map.
[0055] For the two different map display forms, pie charts and coordinate point markings, the corresponding methods are encapsulated respectively. The encapsulation of the pie chart method aims to accurately realize the reasonable display of the pie chart on the map, so that it can clearly and intuitively present the corresponding data relationship; and the encapsulation of the coordinate point marking method is to ensure that the coordinate points can be accurately marked on the map, so that the map can reflect the corresponding data information through the coordinate points. In this way, through these encapsulated methods, the map drawing work can be carried out in an orderly manner, and finally the map display effect that meets the expectations is presented. The pie chart method encapsulation is as follows: Figure 7 As shown, the coordinate point marking method is encapsulated as Figure 8 As shown, the map rendering method is as follows Figure 9 As stated;
[0056] Interactive function, through the report in Power Bi, visual interaction, interactive function method is as follows Figure 10 As shown;
[0057] Implemented mouse hover interaction. When the user hovers the mouse over a region marker, a detailed information box pops up, displaying the region's detailed geographic information (such as name, area, etc.) and related business data details (such as sales, number of customers, etc.);
[0058] Supports click interaction. After the user clicks the area mark, they can perform further operations, such as drilling down to the next level of area detailed information display;
[0059] Provides interactive map zooming and panning functions. Users can freely zoom in and out of the map to view details of different areas or browse a larger geographical area as needed. During the panning process, data loading and visualization effects are kept consistent in real time.
[0060] Custom styles: users can adjust the styles of the controls according to their actual needs, modify the color and theme of the map, and modify the font color and size according to their needs. The code can be implemented as follows: Figure 11 、 12 As shown, the effect is as follows Figure 13 shown.
[0061] In summary, based on the custom development function of Power BI and combined with the API of Amap, a custom control was developed that can display four-level regional dimension markers.
[0062] A data analytics tool based on Power BI and Amap Figure 4 The control implementation method for displaying four-level regional dimension marks includes the collaborative working mode and data flow logic among the data integration module, map interaction interface, regional markup and visualization module, interactive function module and customized function module, specific data integration technologies and algorithms, such as the identification and parsing process of multiple data sources in the intelligent data adaptation module, the unique method of data cleaning and fusion, and the processing logic of four-level regional data classification and association; improved the accuracy and intuitiveness of data visualization: by combining the advantages of Power BI and Amap, four-level regional dimension data visualization is realized, allowing users to understand and analyze data more intuitively; enhanced user interactive experience: custom controls support user interactive operations, such as selecting areas and marking data points at each level, which improves user participation and usage experience; improved the efficiency and accuracy of data analysis: through data cleaning, modeling and visualization, users can obtain and analyze data more quickly and accurately, providing strong support for decision-making.
[0063] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A control implementation method for displaying four-level regional dimension markers based on Power BI and Amap, characterized by: The specific steps are as follows: Step S1: Data acquisition and integration: Use the pbiviz cli framework provided by Power Bi officially, with the help of the update function to obtain the original data passed in by Power Bi Desktop, and process and integrate the original data; Step S2: distinguishing map types, dividing the map into pie chart marks and coordinate point marks; Step S3: Region marking and visualization: Integrate Amap and echarts, and accurately mark regions on Amap based on the four-level region dimension information in the integrated data; Step S4: Interactive function, visual interaction through the report in Power Bi; Step S5: Customize the style. The user can adjust the styles of the control according to their actual needs.
2. A control implementation method for displaying four-level regional dimension labels based on Power BI and Amap according to claim 1, characterized in that: The specific operations in step S1 as described above are: Step S11: Obtaining a data set containing geographic information (such as address, latitude and longitude) and related business data from various data sources (such as enterprise databases, Excel spreadsheets, cloud storage, etc.); Step S12: Convert the incoming raw data into JSON format. Replace Null data with 0 to ensure the standardization of the data format and the integrity of the data content. Step S13: Clean, convert and pre-process the data to ensure the accuracy and consistency of the data, parse the geographic information data, extract the four-level regional dimension information, and associate and integrate it with the corresponding business data.
3. The control implementation method for displaying four-level regional dimension marks based on Power BI and Amap according to claim 1 is characterized by: The specific operations in step S2 as described above are: Step S21: Embed the AutoNavi map component in Power BI and perform initialization settings through the AutoNavi map API, including configuration of basic parameters such as map type (such as normal map, satellite map), map display range, and zoom level; Step S22: Based on the custom development function of Power BI and combined with the API of Amap, a custom control for displaying four-level regional dimension markers is implemented; Step S23: When performing map-related operations, the initial data is set to an additive data type. If the quantity field value in each piece of data is exactly equal to 1, and its name field does not contain geographical names such as provinces, cities, and counties, then the corresponding map display format is a coordinate point mark map; on the contrary, if the above conditions are not met, that is, the quantity field value is not equal to 1 or the name field contains the names of provinces, cities, and counties, the corresponding map display format is a pie chart mark map.
4. The method for implementing a control based on Power BI and Amap's four-level regional dimension mark display according to claim 1, characterized in that: The specific operations in step S3 are as follows: Step S31: Accurately mark the regions on the Amap based on the four-level regional dimension information in the integrated data; Step S32: For each area mark, associate the corresponding business data, and intuitively display the distribution of business data in different areas through visualization elements (such as pie charts to achieve a comparison effect of different categories); Step S33: encapsulate corresponding methods for the two different map display formats, namely, pie chart and coordinate point marking.
5. The method for implementing a control based on Power BI and Amap's four-level regional dimension mark display according to claim 1, characterized in that: The specific operations in step S4 as described above are: Step S41: Implementing a mouse hover interaction function. When the user hovers the mouse over a region mark, a detailed information box pops up, displaying the region's detailed geographic information (such as name, area, etc.) and detailed content of related business data (such as sales, number of customers, etc.); Step S42: Click interaction is supported. After the user clicks the area mark, further operations can be performed, such as drilling down to the next level of area detailed information display; Step S43: Provide map zooming and panning interactive functions. Users can freely zoom in and out of the map as needed to view details of different areas or browse a larger geographical area. During the panning process, the real-time loading of data and the consistency of the visualization effect are maintained.