Label information processing method and device of multi-layer pie chart and terminal

By optimizing the detection of label information and leader positions in multi-layer pie charts, the problem of label hiding or stacking is solved, and the complete label information display of multi-layer pie charts is realized.

CN113553368BActive Publication Date: 2025-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010337274.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-26
Publication Date
2025-11-21
Estimated Expiration
2040-04-26

AI Technical Summary

Technical Problem

In existing technologies, the label information of pie charts is fixed in terms of the position and number of slots. When there is a lot of label information, it is easy for it to be hidden or stacked, resulting in incomplete display.

Method used

By acquiring the data items of a multi-layered pie chart, determining the initial positions of label information and leaders, performing label collision detection and leader angle overlap detection, adjusting the target positions of labels and leaders, avoiding hiding or stacking, and realizing the display of label information in a multi-layered pie chart.

Benefits of technology

It increases the amount of label information displayed in pie charts, ensuring clear display of label information and leaders, and supports the complete display of multi-layer pie charts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553368B_ABST
    Figure CN113553368B_ABST
Patent Text Reader

Abstract

The disclosure provides a label information processing method and device of a multi-layer pie chart and a terminal, and belongs to the technical field of Internet. The method comprises the following steps: acquiring a multi-layer pie chart to be processed; acquiring at least two data items corresponding to the multi-layer pie chart, wherein the data items comprise data proportions and label information, and are used to display a sector area and corresponding label information; determining a first initial position of the label information and a second initial position of a lead line of the label information according to the data proportions; performing label collision detection on the label information according to the first initial position, and determining a first target position of the label information; performing angle overlap detection on the lead line according to the second initial position, and determining a second target position of the lead line; and displaying the data items according to the first target position and the second target position. The above method can avoid the label information of the multi-layer pie chart from being hidden or stacked, thereby improving the display amount of the label information, and the lead line supports the display of the label information of the multi-layer pie chart well.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of Internet, in particular to a label information processing method and device of multi-layer pie chart and a terminal. BACKGROUND

[0002] The label information of a pie chart is a collection of texts describing the information contained in each item of data in the pie chart, which can intuitively show the data information contained in the pie chart, and the display of the label information of the pie chart can help users quickly understand the data distribution, data type and proportional relationship in the pie chart.

[0003] In related technologies, a fixed number of card slots are generally set at fixed positions around the pie chart, and the card slots are used to display the label information of the pie chart. According to the position of the sector area corresponding to the label information of the pie chart and the radius of the pie chart, the label information is mapped to the corresponding card slot, and the label information is displayed in the card slot.

[0004] The problem of related technologies is that, since the positions and the number of the card slots are fixed, when the label information of the pie chart is relatively large, multiple label information is mapped to one card slot, and the excess label information in the card slot is hidden, resulting in incomplete display of the label information of the pie chart. SUMMARY

[0005] Embodiments of the present disclosure provide a label information processing method, device and terminal of multi-layer pie chart, which supports the display of the label information of the multi-layer pie chart and can avoid the hiding or stacking of the label information, thereby improving the display amount of the label information of the pie chart. The technical solution is as follows:

[0006] In a first aspect, a label information processing method of multi-layer pie chart is provided, and the method comprises:

[0007] Obtaining a multi-layer pie chart to be processed, the multi-layer pie chart being generated by a data visualization application;

[0008] Obtaining at least two data items corresponding to the multi-layer pie chart, the data items including data proportion and label information, and being used to display a sector area and corresponding label information;

[0009] According to the data proportion included in the data items, determining a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information, the lead line being used to lead out from the sector area corresponding to the data items to the label information included in the data items;

[0010] According to the first initial position of the label information, performing label collision detection on the label information to determine a first target position of the label information;

[0011] According to the second initial position of the lead, angle overlap detection is performed on the lead to determine a second target position of the lead;

[0012] According to the first target position and the second target position, the data item is displayed.

[0013] In a possible implementation, the first target position of the label information is determined according to the first initial position of the label information, including:

[0014] A first display interval of the label information is obtained, the first display interval being a distance between the label information and adjacent label information when the label information and the adjacent label information are displayed separately;

[0015] The first target position of the label information is determined according to the first display interval and the first initial position of the label information.

[0016] In another possible implementation, the first target position of the label information is determined according to the first display interval and the first initial position of the label information, including:

[0017] A quadrant in which the label information is located is determined according to the first initial position of the label information, with a position of a center of the multi-layer pie chart as a coordinate origin;

[0018] A group in which the label information is located is determined according to the quadrant in which the label information is located, the group in which the label information is located being a first group or a second group, label information in the first group being used to be displayed on a left side of the multi-layer pie chart, and label information in the second group being used to be displayed on a right side of the multi-layer pie chart;

[0019] A vertical coordinate of the label information is determined according to the first initial position of the label information;

[0020] The first target position of the label information is determined according to the first display interval of the label information, the vertical coordinate, and the group in which the label information is located.

[0021] In another possible implementation, the first target position of the label information is determined according to the first display interval of the label information, the vertical coordinate, and the group in which the label information is located, including:

[0022] A vertical coordinate of a previous label information of the group in which the label information is located is obtained;

[0023] A difference between the vertical coordinate of the label information and the vertical coordinate of the previous label information is determined;

[0024] In response to the difference being less than the first display interval, a difference between the vertical coordinate of the last label information and the first display interval is determined as the first target position of the label information.

[0025] In another possible implementation, the angle overlap detection on the lead line according to the second initial position of the lead line, and the determination of the second target position of the lead line, include:

[0026] The first display angle of the lead line is obtained, the first display angle being an included angle between a line connecting a starting point of the lead line and a center of the multi-layer pie chart when the lead line is displayed separately from an adjacent lead line;

[0027] The second target position of the lead line is determined according to the first display angle and the second initial position of the lead line.

[0028] In another possible implementation, the second initial position includes a starting point, and the determination of the second target position of the lead line according to the first display angle and the second initial position of the lead line, includes:

[0029] A first included angle between a first line and a horizontal axis is determined with a position of the center of the multi-layer pie chart as a coordinate origin, the first line being a line connecting the starting point of the lead line and the coordinate origin, and a second included angle between a second line and the horizontal axis is determined, the second line being a line connecting a starting point of a last lead line and the coordinate origin, the last lead line being a lead line adjacent to the lead line in a clockwise direction;

[0030] In response to a difference between the first included angle and the second included angle being less than the first display angle, the starting point of the lead line is updated in a counterclockwise direction of the starting point of the lead line according to the second included angle and the first display angle, to obtain the second target position of the lead line.

[0031] In another possible implementation, after the second target position of the lead line is obtained by updating the starting point of the lead line in the counterclockwise direction of the starting point of the lead line according to the second included angle and the first display angle, the method further includes:

[0032] A termination angle of a sector region corresponding to the lead line is obtained, and in response to the termination angle being less than the first included angle, the second target position of the lead line is corrected.

[0033] In another possible implementation, the second initial position includes a starting point, a turning point and an ending point, and the determination of the first initial position for displaying label information included in the data item and the second initial position of the lead line for displaying the label information according to the data proportion included in the data item, includes:

[0034] determining, according to the data proportion included in the data item, a start angle and an end angle of the sector region corresponding to the data item, taking the position of the center of the multi-layer pie chart as a coordinate origin;

[0035] determining, according to the start angle and the end angle of the sector region corresponding to the data item, an intermediate angle corresponding to the data item;

[0036] obtaining a radius of the layer pie chart corresponding to the data item, and determining the horizontal coordinate and the vertical coordinate of the start point of the lead line of the label information included in the data item according to the radius of the layer pie chart corresponding to the data item and the intermediate angle corresponding to the data item;

[0037] obtaining a second display interval and a radius of the outermost layer pie chart in the multi-layer pie chart, the second display interval being the distance between the turning point of the lead line and the outermost layer pie chart when the lead line is displayed in a separate manner, and determining the horizontal coordinate and the vertical coordinate of the turning point of the lead line of the label information included in the data item according to the second display interval, the radius of the outermost layer pie chart and the intermediate angle corresponding to the data item;

[0038] obtaining a third display interval, and determining the horizontal coordinate of the end point of the lead line of the label information included in the data item according to the radius of the outermost layer pie chart and the third display interval;

[0039] taking the vertical coordinate of the turning point of the lead line of the label information included in the data item as the vertical coordinate of the end point of the lead line of the label information included in the data item;

[0040] taking the horizontal coordinate of the end point of the lead line of the label information included in the data item as the horizontal coordinate of the label information included in the data item, and taking the vertical coordinate of the end point of the lead line of the label information included in the data item as the vertical coordinate of the label information included in the data item.

[0041] In another possible implementation, the determining, according to the data proportion included in the data item, the start angle and the end angle of the sector region corresponding to the data item comprises:

[0042] for any layer pie chart in the multi-layer pie chart, selecting any data item from the data item corresponding to the layer pie chart as a current data item, determining a preset angle as the start angle of the sector region corresponding to the current data item, and determining the end angle of the sector region corresponding to the current data item according to the data proportion included in the current data item and the start angle of the sector region corresponding to the current data item;

[0043] determining a termination angle of a sector region corresponding to the next data item according to a data proportion included in the next data item and the start angle of the sector region corresponding to the next data item;

[0044] taking the termination angle of the sector region corresponding to the next data item as a start angle of a sector region corresponding to a next data item, and taking the termination angle of the sector region corresponding to the next data item as the start angle of the sector region corresponding to the next data item, and so on, to obtain the start angle and the termination angle of the sector region corresponding to each data item.

[0045] In another possible implementation, the displaying the data item according to the first target position and the second target position comprises:

[0046] determining a visible region corresponding to the multi-layer pie chart, the visible region being used to display the label information and a lead line of the label information;

[0047] in response to the visible region including the first target position and the second target position, displaying the label information at the first target position and displaying the lead line at the second target position.

[0048] In a second aspect, a label information processing apparatus of a multi-layer pie chart is provided, and the apparatus comprises:

[0049] a multi-layer pie chart obtaining module, configured to obtain a multi-layer pie chart to be processed, the multi-layer pie chart being generated by a data visualization application;

[0050] a data item obtaining module, configured to obtain at least two data items corresponding to the multi-layer pie chart, the data item including a data proportion and label information, and being used to display a sector region and corresponding label information;

[0051] an initial position determining module, configured to determine a first initial position for displaying the label information included in the data item and a second initial position for displaying a lead line of the label information according to the data proportion included in the data item, the lead line being used to lead out from a sector region corresponding to the data item to the label information included in the data item;

[0052] a target position determining module, configured to perform label collision detection on the label information according to the first initial position of the label information, to determine a first target position of the label information;

[0053] the target position determining module is further configured to perform angle overlap detection on the lead line according to the second initial position of the lead line, to determine a second target position of the lead line;

[0054] The data item display module is configured to display the data item according to the first target position and the second target position.

[0055] In a possible implementation, the target position determination module is further configured to acquire a first display interval of the label information, the first display interval being a distance between the label information and adjacent label information when the label information and the adjacent label information are displayed separately; and determine the first target position of the label information according to the first display interval and a first initial position of the label information.

[0056] In another possible implementation, the target position determination module is further configured to take a position of a center of the multi-layer pie chart as a coordinate origin, determine a quadrant in which the label information is located according to the first initial position of the label information, determine a group in which the label information is located according to the quadrant in which the label information is located, the group in which the label information is located being a first group or a second group, the label information in the first group being used to be displayed on a left side of the multi-layer pie chart, and the label information in the second group being used to be displayed on a right side of the multi-layer pie chart, determine a vertical coordinate of the label information according to the first initial position of the label information, and determine the first target position of the label information according to the first display interval of the label information, the vertical coordinate of the label information, and the group in which the label information is located.

[0057] In another possible implementation, the target position determination module is further configured to acquire a vertical coordinate of a previous label information of the group in which the label information is located, determine a difference between the vertical coordinate of the label information and the vertical coordinate of the previous label information, and determine, in response to the difference being less than the first display interval, the difference between the vertical coordinate of the previous label information and the first display interval as the first target position of the label information.

[0058] In another possible implementation, the target position determination module is further configured to acquire a first display angle of the lead, the first display angle being an included angle between a line connecting a starting point of the lead and the center of the multi-layer pie chart and a line connecting the starting point of the lead and a starting point of an adjacent lead when the lead and the adjacent lead are displayed separately, and determine the second target position of the lead according to the first display angle and a second initial position of the lead.

[0059] In another possible implementation, the second initial position includes a starting point,

[0060] The target position determining module is further configured to take the position of the center of the multi-layer pie chart as a coordinate origin, determine a first included angle between a first line and a horizontal axis, the first line being a line connecting a starting point of the lead line and the coordinate origin, and determine a second included angle between a second line and the horizontal axis, the second line being a line connecting a starting point of a previous lead line and the coordinate origin, the previous lead line being a lead line adjacent to the lead line in a clockwise direction; in response to a difference between the first included angle and the second included angle being less than the first display angle, update the starting point of the lead line in a counterclockwise direction of the starting point of the lead line according to the second included angle and the first display angle, to obtain a second target position of the lead line.

[0061] In another possible implementation, the target position determining module is further configured to obtain a terminal angle of a sector region corresponding to the lead line, and correct the second target position of the lead line in response to the terminal angle being less than the first included angle.

[0062] In another possible implementation, the second initial position includes a starting point, a turning point, and an ending point,

[0063] The initial position determining module is further configured to take the position of the center of the multi-layer pie chart as a coordinate origin, determine a starting angle and a terminal angle of a sector region corresponding to the data item according to a data proportion included in the data item, determine an intermediate angle corresponding to the data item according to the starting angle and the terminal angle of the sector region corresponding to the data item, obtain a radius of a layer pie chart corresponding to the data item, and determine a horizontal coordinate and a vertical coordinate of a starting point of a lead line of label information included in the data item according to the radius of the layer pie chart corresponding to the data item and the intermediate angle corresponding to the data item; obtain a second display interval and a radius of an outermost layer pie chart in the multi-layer pie chart, the second display interval being a distance between a turning point of the lead line and the outermost layer pie chart when the lead line is displayed in a separate manner, and determine a horizontal coordinate and a vertical coordinate of the turning point of the lead line of the label information included in the data item according to the second display interval, the radius of the outermost layer pie chart, and the intermediate angle corresponding to the data item; obtain a third display interval, and determine a horizontal coordinate of an ending point of the lead line of the label information included in the data item according to the radius of the outermost layer pie chart and the third display interval; take the vertical coordinate of the turning point of the lead line of the label information included in the data item as a vertical coordinate of the ending point of the lead line of the label information, and take the horizontal coordinate of the ending point of the lead line of the label information included in the data item as a horizontal coordinate of the label information, and take the vertical coordinate of the ending point of the lead line of the label information included in the data item as a vertical coordinate of the label information.

[0064] In a possible implementation, the initial position determining module is further configured to, for any one of the multiple-layer pie charts, select any one of data items corresponding to the layer pie chart as a current data item, determine a preset angle as a start angle of a sector area corresponding to the current data item, determine a stop angle of the sector area corresponding to the current data item according to a data proportion included in the current data item and the start angle of the sector area corresponding to the current data item, take the stop angle of the sector area corresponding to the current data item as a start angle of a sector area corresponding to a next data item, determine a stop angle of the sector area corresponding to the next data item according to a data proportion included in the next data item and the start angle of the sector area corresponding to the next data item, take the stop angle of the sector area corresponding to the next data item as a start angle of a sector area corresponding to a data item after the next data item, and so on, to obtain the start angle and the stop angle of the sector area corresponding to each data item.

[0065] In a possible implementation, the data item displaying module is further configured to determine a visible area corresponding to the multiple-layer pie chart, the visible area being used to display the label information and a lead line of the label information, and in response to the visible area including the first target position and the second target position, display the label information at the first target position and display the lead line at the second target position.

[0066] In a third aspect, a terminal is provided, which includes a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement operations performed in the label information processing method of the multiple-layer pie chart according to any one of the possible implementation manners.

[0067] In a fourth aspect, a computer readable storage medium is provided, which stores at least one instruction, which is loaded and executed by a processor to implement operations performed by a terminal in the label information processing method of the multiple-layer pie chart according to any one of the possible implementation manners.

[0068] The technical scheme provided by the embodiments of the present disclosure has the following beneficial effects:

[0069] In the embodiments of the present disclosure, a multi-layer pie chart to be processed is acquired, the multi-layer pie chart is generated by a data visualization application, at least two data items corresponding to the multi-layer pie chart are acquired, the data items include data proportions and label information, the label information is used to display a sector area and corresponding label information, a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information are determined according to the data proportions included in the data items, the lead line is used to lead out from the sector area corresponding to the data items to the label information included in the data items, the first target position of the label is determined by performing label collision detection on the label according to the first initial position of the label, the label of the multi-layer pie chart can be prevented from being hidden or stacked, so that the label display amount of the pie chart can be improved, the second target position of the lead line is determined by performing angle overlap detection on the lead line according to the second initial position of the lead line, the lead line of the label can be prevented from being stacked, the data items are displayed according to the first target position and the second target position, and the lead line is used to lead out from the sector area corresponding to the data items to the label information corresponding to the data items, the corresponding relationship between the label information and the data items of the multi-layer pie chart can be clearly displayed through the lead line, and the display of the label information of the multi-layer pie chart is well supported. BRIEF DESCRIPTION OF DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative effort.

[0071] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present disclosure;

[0072] Figure 2 is a flowchart of a label information processing method of a multi-layer pie chart provided by an embodiment of the present disclosure;

[0073] Figure 3 is a flowchart of a label information processing method of a multi-layer pie chart provided by an embodiment of the present disclosure;

[0074] Figure 4 is a flowchart of determining an angle of a sector area provided by an embodiment of the present disclosure;

[0075] Figure 5 is a flowchart of adjusting coordinates of label information provided by an embodiment of the present disclosure;

[0076] Figure 6 is a flowchart of adjusting an angle of a lead line provided by an embodiment of the present disclosure;

[0077] Figure 7is a flowchart provided by an embodiment of the present disclosure for determining whether label information is in a visible area;

[0078] Figure 8 is a schematic diagram of a position relationship between label information and a lead provided by an embodiment of the present disclosure;

[0079] Figure 9 is a schematic diagram of a position relationship between label information and a lead provided by an embodiment of the present disclosure;

[0080] Figure 10 is a schematic diagram of a position relationship between label information and a lead provided by an embodiment of the present disclosure;

[0081] Figure 11 is a block diagram of a label information processing device of a multi-layer pie chart provided by an embodiment of the present disclosure;

[0082] Figure 12 is a structural schematic diagram of a terminal provided by an embodiment of the present disclosure;

[0083] Figure 13 is a structural schematic diagram of a server provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the embodiments of the present disclosure will be further described in detail below with reference to the drawings.

[0085] First, the professional terms involved in the specification are explained:

[0086] Pie chart: or pie chart, is a circular statistical chart divided into several sectors, used to describe the relative relationship between quantity, frequency or percentage.

[0087] Canvas (canvas): The canvas element is part of HTML5 (Hyper Text Markup Language, Hyper Text Markup Language), which allows scripting languages (scripting languages) to dynamically render bitmap images.

[0088] Radian: radian, also known as radian, is the unit of plane angle. The radian of a complete circle is 2π.

[0089] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present disclosure. See Figure 1The implementation environment includes a terminal 101 and a server 102. The terminal 101 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The server 102 can be a stand-alone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application. In addition, the terminal 101 can install a target application provided by the server 102, and the user corresponding to the terminal 101 can realize functions such as data transmission and message interaction through the target application.

[0090] The target application can be any application installed on the terminal 101, and the target application can be a target application in the operating system of the terminal 101, or a target application provided by a third party. For example, the target application can be a shopping application, a financial application, a data visualization application, a data calculation application, or a data analysis application, etc. The server 102 can be a background server corresponding to the target application. Correspondingly, the server 102 can be a shopping server, a financial server, a data visualization server, a data calculation server, or a data analysis server, etc.

[0091] The terminal 101 can display a multi-layer pie chart and label information of the multi-layer pie chart on the interface according to the data items corresponding to the multi-layer pie chart, and the terminal 101 can also display a lead line of the label information, and the lead line leads the sector area corresponding to the data item to the label information included in the data item, so as to clearly show the correspondence between the label information and the data item of the multi-layer pie chart.

[0092] Further, the terminal 101 can obtain a multi-layer pie chart to be processed, and the multi-layer pie chart is generated by a data visualization application. Then, the terminal 101 can obtain at least two data items corresponding to the multi-layer pie chart, and the data item includes a data proportion and label information, for displaying a sector area and corresponding label information. The terminal 101 determines a first initial position for displaying the label information included in the data item and a second initial position for displaying a lead line of the label information according to the data proportion included in the data item, and the lead line is used to lead from the sector area corresponding to the data item to the label information included in the data item. Then, the terminal 101 performs label collision detection on the label information according to the first initial position of the label information to determine a first target position of the label information, and performs angle overlap detection on the lead line according to the second initial position of the lead line to determine a second target position of the lead line. Then, the terminal 101 displays the data item according to the first target position and the second target position.

[0093] Further, the terminal 101 can perform label collision detection on the label information according to the first initial position of the label information, and the implementation manner of determining the first target position of the label information can be: the terminal 101 acquires the first display interval of the label information, the first display interval is the distance when the label information is displayed separately from the adjacent label information, and the terminal 101 determines the first target position of the label information according to the first display interval and the first initial position of the label information.

[0094] The terminal 101 can perform angle overlap detection on the lead according to the second initial position of the lead, and the implementation manner of determining the second target position of the lead can be: the terminal 101 acquires the first display angle of the lead, the first display angle is the included angle between the lead and the line connecting the center of the multi-layer pie chart and the starting point of the lead when the lead is displayed separately from the adjacent lead, and the second target position of the lead is determined according to the first display angle and the second initial position of the lead.

[0095] In the above embodiment, the terminal 101 can also send the data items to the server 102 after acquiring the at least two data items corresponding to the multi-layer pie chart, and the server 102 can determine the first target position of the label information and the second target position of the lead, and then the terminal 101 receives the first target position and the second target position of the lead returned by the server 102, and displays the data items according to the first target position and the second target position.

[0096] It should be noted that the label information processing method of the multi-layer pie chart in the present disclosure can be applied in the field of big data in cloud technology. Big data refers to a collection of data that cannot be captured, managed and processed within a certain time range by conventional software tools, and is a massive, high-growth and diversified information asset that requires new processing modes to have stronger decision-making, insight discovery and process optimization capabilities. With the advent of the cloud era, big data has attracted more and more attention, and big data requires special technology to effectively process large amounts of data over time. The technologies suitable for big data include large-scale parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet and scalable storage systems. The label information processing method of the multi-layer pie chart provided by the present disclosure can be applied in the above-mentioned various technologies, for example, when used in data mining technology, the method of the present disclosure is used, that is, the data is counted in the form of a multi-layer pie chart, and the distribution of the data, the type of the data, the proportional relationship of the data, the internal meaning and the connection of the data are displayed through the display method of the label information in the present disclosure, so as to mine the required knowledge and information. For another example, when the pie chart information is obtained by the server or the terminal in the Internet, the pie chart information can be processed by the method of the present disclosure to clearly and completely display the pie chart information. The above-mentioned application fields and application methods are only exemplary, and the present disclosure does not limit the same.

[0097] Figure 2 is a flowchart of a label information processing method of a multi-layer pie chart provided by an embodiment of the present disclosure. Referring to Figure 2 , the embodiment includes:

[0098] 201, obtaining a multi-layer pie chart to be processed, the multi-layer pie chart being generated by a data visualization application.

[0099] 202, obtaining at least two data items corresponding to the multi-layer pie chart, the data items including data proportions and label information, and the data items being used to display a sector area and corresponding label information.

[0100] 203, determining, according to the data proportions included in the data items, a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information, the lead line being used to lead out from the sector area corresponding to the data items to the label information included in the data items.

[0101] 204, performing label collision detection on the label information according to the first initial position of the label information to determine a first target position of the label information.

[0102] 205, performing angle overlap detection on the lead line according to the second initial position of the lead line to determine a second target position of the lead line.

[0103] 206. display the data item according to the first target position and the second target position.

[0104] In a possible implementation, the first target position of the label information is determined according to the first initial position of the label information, and the first target position of the label information is determined by performing label collision detection on the label information.

[0105] The first display interval of the label information is obtained, and the first display interval is a distance between the label information and adjacent label information when the label information and the adjacent label information are displayed separately.

[0106] The first target position of the label information is determined according to the first display interval and the first initial position of the label information.

[0107] In another possible implementation, the first target position of the label information is determined according to the first display interval and the first initial position of the label information, and the first target position of the label information is determined by:

[0108] The quadrant in which the label information is located is determined according to the first initial position of the label information, taking the position of the center of the multi-layer pie chart as a coordinate origin.

[0109] The group in which the label information is located is determined according to the quadrant in which the label information is located, and the group in which the label information is located is a first group or a second group, the label information in the first group is used to be displayed on the left side of the multi-layer pie chart, and the label information in the second group is used to be displayed on the right side of the multi-layer pie chart.

[0110] The ordinate of the label information is determined according to the first initial position of the label information.

[0111] The first target position of the label information is determined according to the first display interval, the ordinate, and the group in which the label information is located.

[0112] In another possible implementation, the first target position of the label information is determined according to the first display interval, the ordinate, and the group in which the label information is located, and the first target position of the label information is determined by:

[0113] The ordinate of the previous label information in the group in which the label information is located is obtained.

[0114] A difference between the ordinate of the label information and the ordinate of the previous label information is determined.

[0115] In response to the difference being less than the first display interval, the first target position of the label information is determined as a difference between the ordinate of the previous label information and the first display interval.

[0116] In another possible implementation, the second target position of the lead is determined according to the second initial position of the lead, and the second target position of the lead is determined by performing angle overlap detection on the lead.

[0117] The first display angle of the lead line is obtained, and the first display angle is an included angle between a line connecting a starting point of the lead line and a center of the multi-layer pie chart when the lead line is displayed separately from adjacent lead lines.

[0118] According to the first display angle and the second initial position of the lead line, the second target position of the lead line is determined.

[0119] In another possible implementation, the second initial position includes the starting point, and the second target position of the lead line is determined according to the first display angle and the second initial position of the lead line, including:

[0120] The first included angle of the first connecting line with the horizontal axis is determined with the position of the center of the multi-layer pie chart as a coordinate origin, the first connecting line is a connecting line between the starting point of the lead line and the coordinate origin, and the second included angle of the second connecting line with the horizontal axis is determined, the second connecting line is a connecting line between the starting point of the last lead line and the coordinate origin, and the last lead line is a lead line adjacent to the lead line in a clockwise direction.

[0121] In response to a difference between the first included angle and the second included angle being less than the first display angle, the starting point of the lead line is updated in a counterclockwise direction of the starting point according to the second included angle and the first display angle, to obtain the second target position of the lead line.

[0122] In another possible implementation, after the starting point of the lead line is updated in the counterclockwise direction according to the second included angle and the first display angle to obtain the second target position of the lead line, the method further includes:

[0123] The termination angle of the sector area corresponding to the lead line is obtained, and the second target position of the lead line is corrected in response to the termination angle being less than the first included angle.

[0124] In another possible implementation, the second initial position includes the starting point, the turning point and the ending point, and the first initial position of the label information for displaying the data item and the second initial position of the lead line for displaying the label information are determined according to the data proportion included in the data item, including:

[0125] The starting angle and the termination angle of the sector area corresponding to the data item are determined according to the data proportion included in the data item, with the position of the center of the multi-layer pie chart as a coordinate origin.

[0126] The intermediate angle corresponding to the data item is determined according to the starting angle and the termination angle of the sector area corresponding to the data item.

[0127] The radius of the layer of pie chart corresponding to the data item is obtained, and the horizontal coordinate and the vertical coordinate of the starting point of the lead line of the label information included in the data item are determined according to the radius of the layer of pie chart corresponding to the data item and the intermediate angle corresponding to the data item.

[0128] obtaining a second display interval and a radius of an outermost pie chart in the multi-layer pie chart, the second display interval being a distance between a turning point of a lead line and the outermost pie chart when the lead line is displayed in a separated manner, and determining a horizontal coordinate and a vertical coordinate of the turning point of the lead line of the label information included by the data item according to the second display interval, the radius of the outermost pie chart and a middle angle corresponding to the data item;

[0129] obtaining a third display interval, and determining a horizontal coordinate of an end point of the lead line of the label information included by the data item according to the radius of the outermost pie chart and the third display interval;

[0130] taking the vertical coordinate of the turning point of the lead line of the label information included by the data item as the vertical coordinate of the end point of the lead line of the label information included by the data item;

[0131] taking the horizontal coordinate of the end point of the lead line of the label information included by the data item as the horizontal coordinate of the label information included by the data item, and taking the vertical coordinate of the end point of the lead line of the label information included by the data item as the vertical coordinate of the label information included by the data item.

[0132] In another possible implementation, the starting angle and the ending angle of the sector region corresponding to the data item are determined according to a data proportion included by the data item, including:

[0133] For any layer pie chart in the multi-layer pie chart, any data item in the data item corresponding to the layer pie chart is selected as a current data item, a preset angle is determined as a starting angle of a sector region corresponding to the current data item, and an ending angle of the sector region corresponding to the current data item is determined according to a data proportion included by the current data item and the starting angle of the sector region corresponding to the current data item;

[0134] the ending angle of the sector region corresponding to the current data item is taken as a starting angle of a sector region corresponding to a next data item, and an ending angle of the sector region corresponding to the next data item is determined according to a data proportion included by the next data item and the starting angle of the sector region corresponding to the next data item;

[0135] the ending angle of the sector region corresponding to the next data item is taken as a starting angle of a sector region corresponding to a next data item, and an ending angle of the sector region corresponding to the next data item is determined according to a data proportion included by the next data item and the starting angle of the sector region corresponding to the next data item;

[0136] In another possible implementation, the data item is displayed according to the first target position and the second target position, including:

[0137] determining a visible region corresponding to the multi-layer pie chart, the visible region being used to display the label information and the lead line of the label information;

[0138] in response to the visible region including the first target position and the second target position, displaying the label information at the first target position and displaying the lead line at the second target position.

[0139] In the embodiment of the present disclosure, a multi-layer pie chart to be processed is acquired, the multi-layer pie chart is generated by a data visualization application, at least two data items corresponding to the multi-layer pie chart are acquired, the data items include data proportions and label information, the label information is used to display a sector area and corresponding label information, a first initial position for displaying the label information included in the data items and a second initial position of a lead line for displaying the label information are determined according to the data proportions included in the data items, the lead line is used to lead out from the sector area corresponding to the data items to the label information included in the data items, the first target position of the label is determined by performing label collision detection on the label according to the first initial position of the label, the label of the multi-layer pie chart can be prevented from being hidden or stacked, so that the label display amount of the pie chart can be improved, the second target position of the lead line is determined by performing angle overlap detection on the lead line according to the second initial position of the lead line, the lead line of the label can be prevented from being stacked, the data items are displayed according to the first target position and the second target position, and the lead line is used to lead out from the sector area corresponding to the data items to the label information corresponding to the data items, the corresponding relationship between the label information and the data items of the multi-layer pie chart can be clearly displayed through the lead line, and the display of the label information of the multi-layer pie chart is well supported.

[0140] Figure 3 is a flowchart of a label information processing method of a multi-layer pie chart provided by the embodiment of the present disclosure. Referring to Figure 3 , the embodiment includes:

[0141] 301. A terminal acquires a multi-layer pie chart to be processed, the multi-layer pie chart is generated by a data visualization application.

[0142] The multi-layer pie chart refers to a pie chart having multiple levels and a containing relationship between the levels. The multi-layer pie chart is used to indicate the statistical relationship of data. The number of layers of the multi-layer pie chart can be any number, for example, 2 layers, 3 layers, or 4 layers, and the present disclosure does not limit this. One multi-layer pie chart can correspond to multiple label information, and the label information is used to explain the data in the multi-layer pie chart. Accordingly, the multi-layer pie chart to be processed in the present disclosure refers to a multi-layer pie chart that has not displayed label information.

[0143] The data visualization application can also be referred to as a data visualization tool, which is used to create various charts, such as a multi-layer pie chart, a column chart, a line chart, etc., and the data visualization application can automatically generate charts according to data. In addition, the information of the generated chart can also be directly acquired through the data visualization application. In the embodiment of the present disclosure, the data visualization application is taken as BizCharts (a kind of data visualization application) for example, and the description is made, of course, the data visualization application can also be other, and the present disclosure does not limit this.

[0144] There are two implementation manners of the terminal obtaining the multi-layer pie chart to be processed.

[0145] Firstly, the terminal directly obtains the multi-layer pie chart generated by the data visualization application.

[0146] In the case that the chart generated by the data visualization application is stored in the terminal, the implementation manner of this step can be that the terminal directly obtains the multi-layer pie chart to be processed created by the data visualization application locally. In the case that the chart generated by the data visualization application is stored in the server, the implementation manner of this step can be that the terminal sends a multi-layer pie chart obtaining request to the server, the obtaining request carrying an identifier of the multi-layer pie chart to be processed, the server obtains the multi-layer pie chart to be processed from a chart library according to the identifier, the chart library being used to store the chart generated by the data visualization application, and then the server sends the multi-layer pie chart to the terminal, and the terminal receives the multi-layer pie chart.

[0147] Secondly, the terminal obtains initial data for drawing the multi-layer pie chart, and generates the multi-layer pie chart through the data visualization application. This step includes the following steps (1) and (2).

[0148] (1) The terminal obtains initial data for drawing the multi-layer pie chart.

[0149] The terminal can display an input interface of the initial data on the interface, and obtain the initial data input by the user in the input interface. Alternatively, in the case that the terminal stores the initial data for drawing the multi-layer pie chart, the terminal can directly call the initial data. Alternatively, in the case that the server stores the initial data for drawing the multi-layer pie chart, the terminal can also send an initial data obtaining request of the multi-layer pie chart to the server in response to receiving an obtaining operation of the initial data of the multi-layer pie chart, and then receive the initial data sent by the server.

[0150] (2) The terminal generates the multi-layer pie chart to be processed through the data visualization application according to the initial data.

[0151] The implementation manner of this step is that the terminal calls the data visualization application to process the initial data, and obtains the multi-layer pie chart to be processed.

[0152] 302. The terminal obtains at least two data items corresponding to the multi-layer pie chart, the data items including data proportions and label information, and being used to display a sector area and corresponding label information.

[0153] The multi-layer pie chart can correspond to multiple data items, each data item being used to draw a sector area in the multi-layer pie chart, and the data item can include label information, the label information being used to make an explanation for the data item corresponding to the sector area.

[0154] The implementation manner of the terminal obtaining the at least two data items corresponding to the multi-layer pie chart can be that the terminal generates the at least two data items corresponding to the multi-layer pie chart through a data visualization application on the terminal.

[0155] In the embodiments of the present disclosure, BizCharts is taken as an example, and the implementation manner of the step is that, for the obtained multi-layer pie chart to be processed, the terminal registers an onGetG2Instance event through BizCharts, obtains the at least two data items corresponding to the multi-layer pie chart, each data item includes a percentage corresponding to the data item, and each data item can further include a name (name) and a value (key) corresponding to the data item, and the terminal generates label information of the data item according to the percentage, the name and the value corresponding to the data item.

[0156] The implementation manner of the terminal obtaining the at least two data items corresponding to the multi-layer pie chart through registering the onGetG2Instance event is that the terminal obtains a Views array of the multi-layer pie chart by registering the onGetG2Instance event, the Views array includes a plurality of View arrays, each View array corresponds to a layer of pie chart, and the terminal traverses the Views array from the outer layer to the inner layer to obtain a dataset of each View array corresponding to a layer of pie chart, each dataset includes a data item.

[0157] 303、The terminal determines a first initial position for displaying label information included in the data item and a second initial position for displaying a lead line of the label information according to the data proportion included in the data item, and the lead line is used to lead out from a sector area corresponding to the data item to the label information included in the data item.

[0158] The second initial position includes a starting point, a turning point and an ending point, and the terminal determines the second initial position of the lead line of the label information included in the data item according to the data proportion included in the data item, including the following steps (1)-(6):

[0159] (1) The terminal takes the position of the center of the multi-layer pie chart as a coordinate origin, and determines a starting angle and a terminal angle of a sector area corresponding to the data item according to the data proportion included in the data item.

[0160] The position of the center of the multi-layer pie chart can be obtained by registering the onGetG2Instance event, and the terminal determines the starting angle and the terminal angle of the sector area corresponding to the data item according to the data proportion included in the data item, including the following steps (A)-(C):

[0161] (A) For any one pie chart in the multi-layer pie chart, the terminal selects any one data item from the data item corresponding to the pie chart as a current data item, determines a preset angle as a starting angle of a sector area corresponding to the current data item, and determines a terminal angle of the sector area corresponding to the current data item according to a data proportion included in the current data item and the starting angle of the sector area corresponding to the current data item.

[0162] The above method can be implemented by the following formula (1):

[0163] (1)

[0164] Wherein, the maxAngle is the terminal angle of the current data item, the angle is the preset angle, and the percent is the data proportion included in the current data item. The preset angle can be set as needed, for example, the preset angle can be -π / 2, 0 or π / 2, of course, it can also be set as other, the present disclosure does not make limitation to this.

[0165] (B) The terminal determines a terminal angle of a sector area corresponding to a next data item according to a data proportion included in the next data item and a starting angle of the sector area corresponding to the next data item, taking the terminal angle of the sector area corresponding to the current data item as the starting angle of the sector area corresponding to the next data item.

[0166] Wherein, the terminal determines the terminal angle of the sector area corresponding to the next data item according to the data proportion included in the next data item and the starting angle of the sector area corresponding to the next data item, and the implementation manner of the terminal determining the terminal angle of the sector area corresponding to the current data item according to the data proportion included in the current data item and the starting angle of the sector area corresponding to the current data item is the same, which will not be repeated here.

[0167] (C) The terminal determines a terminal angle of a sector area corresponding to a next data item as a starting angle of a sector area corresponding to a next data item, and so on, until the starting angle and the terminal angle of the sector area corresponding to each data item of the pie chart are obtained.

[0168] Reference Figure 4A flowchart for obtaining the start angle and the end angle of the sector corresponding to the data item. Taking a preset angle angle=-π / 2 as an example, i is an integer, used to control the number of times of the loop. For the n data items corresponding to each layer of the pie chart, when i=0, that is, in the first loop, any data item is selected as the current data item, and the start angle and the end angle of the current data item are calculated, wherein the start angle of the current data item is the preset angle. Then, the end angle of the current data item is initialized as the start angle of the next data item. Then, i is increased by 1 to obtain i=1, and when i=1, that is, in the second loop, the end angle of the next data item is calculated, and the end angle of the next data item is initialized as the start angle of the next data item. In this way, when i=n-1, that is, in the last loop, the start angle and the end angle of the n data items corresponding to the layer of the pie chart can be obtained, and when i=n, the loop condition is not met, and the loop ends.

[0169] (2) The terminal determines the intermediate angle corresponding to the data item according to the start angle and the end angle of the sector corresponding to the data item.

[0170] The implementation manner of this step is that the terminal determines the average value of the start angle and the end angle of the data item, and takes the average value as the intermediate angle corresponding to the data item.

[0171] (3) The terminal obtains the radius of the layer of the pie chart corresponding to the data item, and determines the horizontal coordinate and the vertical coordinate of the start point of the lead line of the label information included by the data item according to the radius of the layer of the pie chart corresponding to the data item and the intermediate angle corresponding to the data item.

[0172] The above method can be implemented by the following formula (2):

[0173] (2)

[0174] Wherein, edgepointX is the horizontal coordinate of the start point, edgepointY is the vertical coordinate of the start point, is the horizontal coordinate of the position of the center of the multi-layer pie chart, is the vertical coordinate of the position of the center of the multi-layer pie chart, r is the radius of the layer of the pie chart corresponding to the data item, middleAngle is the intermediate angle corresponding to the data item, and π=180 degrees under the radian system.

[0175] (4) The terminal obtains the second display interval and the radius of the outermost layer of the pie chart in the multi-layer pie chart, the second display interval is the distance between the turning point of the lead line and the outermost layer of the pie chart when the lead line is displayed in sections, and determines the horizontal coordinate and the vertical coordinate of the turning point of the lead line of the label information included by the data item according to the second display interval, the radius of the outermost layer of the pie chart and the intermediate angle corresponding to the data item.

[0176] The above method can be realized by the following formula (3):

[0177] (3)

[0178] wherein turningpointX is the abscissa of the turning point, turningpointY is the ordinate of the turning point, is the abscissa of the position of the center of the multi-layer pie chart, is the ordinate of the position of the center of the multi-layer pie chart, and R is the radius of the outermost pie chart, is the second display interval, middleAngle is the middle angle corresponding to the data item, and π=180 degrees under the radian system. It should be noted that the second display interval can be set to any value as needed, for example, 20, and the present disclosure does not limit this.

[0179] (5) The terminal obtains a third display interval, and determines the abscissa of the end point of the lead of the label information included by the data item according to the radius of the outermost pie chart and the third display interval.

[0180] The above method can be realized by the following formula (4):

[0181] (4)

[0182] wherein endpointX is the abscissa of the end point, is the abscissa of the position of the center of the multi-layer pie chart, is the ordinate of the position of the center of the multi-layer pie chart, and R is the radius of the outermost pie chart, is the third display interval, π=180 degrees under the radian system, and it should be noted that the third display interval can be set to any value as needed, for example, 20, 25, 30, etc., and the present disclosure does not limit this.

[0183] (6) The terminal takes the ordinate of the turning point of the lead of the label information included by the data item as the ordinate of the end point of the lead of the label information included by the data item.

[0184] The above method can be realized by the following formula (5):

[0185] (5)

[0186] wherein endpointY is the ordinate of the end point, and turningpointY is the ordinate of the turning point.

[0187] The terminal determines the first initial position of the label information included in the data item according to the proportion of data included in the data item, and the implementation manner is that the terminal takes the horizontal coordinate of the end point of the lead line of the label information included in the data item as the horizontal coordinate of the label information included in the data item, and takes the vertical coordinate of the end point of the lead line of the label information included in the data item as the vertical coordinate of the label information included in the data item.

[0188] In the embodiment of the present disclosure, the coordinates of the end point of the lead line of the label information included in the data item are taken as the coordinates of the label information included in the data item, so that the lead line can directly lead to the label information, the corresponding relationship between the data item and the label information can be clearly indicated, and the method is simple and easy to implement.

[0189] 304. The terminal performs label collision detection on the label information according to the first initial position of the label information, and determines a first target position of the label information.

[0190] The implementation manner of this step is that the terminal obtains a first display interval of the label information, the first display interval is the distance between the label information and adjacent label information when the label information is displayed separately, and the first target position of the label information is determined according to the first display interval and the first initial position of the label information.

[0191] The first initial position is a position relative to the center of the multi-layer pie chart, and the first display interval can be set to any value as needed, for example, the first display interval can be set to 5, 10, 15, 20, etc., and the present disclosure does not limit this.

[0192] In a possible implementation manner, the first display interval and the font size of the Chinese text of the label information have a corresponding relationship, for example, different font sizes can correspond to different first display intervals, and correspondingly, the implementation manner of the terminal obtaining the first display interval of the label information is that the terminal obtains the font size of the Chinese text of the label information, and obtains the first display interval matched with the font size from the corresponding relationship between the first display interval and the font size of the Chinese text of the label information.

[0193] In the embodiment of the present disclosure, by setting the corresponding relationship between the first display interval and the font size of the Chinese text of the label information, the first display interval matched with the font size is obtained from the corresponding relationship between the first display interval and the font size of the Chinese text of the label information according to the font size of the Chinese text of the label information, which realizes dynamic adjustment of the first display interval according to the font size, and can improve the display effect of the label information of the multi-layer pie chart.

[0194] The implementation steps of the terminal determining the first target position of the label information according to the first display interval and the first initial position of the label information include the following steps (1)-(4):

[0195] (1) The terminal takes the position of the center of the multi-layer pie chart as the coordinate origin, and determines the quadrant in which the label information is located according to the first initial position of the label information.

[0196] In a possible implementation, the step is implemented in the following manner: the terminal obtains the included angle between the line connecting the starting point in the first initial position of the label information and the coordinate origin and the horizontal axis, that is, the middle angle of the sector corresponding to the label information, and determines the quadrant of the label information according to the middle angle.

[0197] The above method can be implemented by the following formula (6):

[0198] (6)

[0199] where middleAngle is the middle angle of the sector corresponding to the label information, and k is an arbitrary integer, and π=180 degrees in radian.

[0200] (2) The terminal determines the group in which the label information is located according to the quadrant in which the label information is located, and the group in which the label information is located is the first group or the second group, the label information in the first group is used to be displayed on the left side of the multi-layer pie chart, and the label information in the second group is used to be displayed on the right side of the multi-layer pie chart.

[0201] The implementation of the step is that the terminal divides the label information in the second quadrant and the third quadrant into the first group, and divides the label information in the first quadrant and the fourth quadrant into the second group.

[0202] It should be noted that, since the middle angle of the label information corresponding to the label information may be equal to the angle of the coordinate axis, in this case, the label information does not belong to any quadrant, but in this step, the label information is also divided into the first group and the second group, and the division method can be implemented by the following formula (7):

[0203] (7)

[0204] where middleAngle is the middle angle of the sector corresponding to the label information, and k is an arbitrary integer, and π=180 degrees in radian.

[0205] With reference to Figure 4 , the terminal determines whether the label information included in the current data item belongs to the second quadrant or the third quadrant according to the middle angle of the current data item, and if so, divides the label information into the first group, and if not, divides the label information into the second group. Then, whether the label information included in the next data item belongs to the second quadrant or the third quadrant is determined according to the middle angle of the next data item, and so on, until all the data items are divided into the corresponding groups.

[0206] (3) The terminal determines the vertical coordinate of the label information according to the first initial position of the label information.

[0207] (4) The terminal determines the first target position of the label information according to the first display interval of the label information, the vertical coordinate, and the group in which the label information is located.

[0208] The implementation of this step is that the terminal obtains the vertical coordinate of the last label information in the group in which the label information is located, determines the difference between the vertical coordinate of the label information and the vertical coordinate of the last label information, and in response to the difference being less than the first display interval, determines the difference between the vertical coordinate of the last label information and the first display interval as the first target position of the label information.

[0209] In this case, before obtaining the coordinate value of the vertical coordinate of the last label information in the group in which the label information is located, the terminal sorts the label information in the first group and the second group in the group according to the vertical coordinate in descending order, and the last label information is the label information arranged before the label information.

[0210] It should be noted that in this disclosure, the determination method of the first target position is exemplarily described in descending order, and of course, the label information in the first group and the second group in the group can also be sorted in ascending order of the vertical coordinate. The disclosure does not limit this. When the label information in the first group and the second group in the group is sorted in ascending order of the vertical coordinate, the above step, in response to the difference being less than the first display interval, determining the difference between the vertical coordinate of the last label information and the first display interval as the first target position of the label information, is replaced by: in response to the difference being less than the first display interval, determining the sum of the vertical coordinate of the last label information and the first display interval as the first target position of the label information.

[0211] In the embodiment of the disclosure, by determining the difference between the vertical coordinate of the last label information and the first display interval as the first target position of the label information when the difference between the vertical coordinate of the label information and the vertical coordinate of the last label information in the group is less than the first display interval, the problem of overlapping label information can be avoided when there are many label information in the multi-layer pie chart, so that the display effect of the label information can be improved, and the data distribution of the pie chart can be more intuitively displayed.

[0212] It should be noted that in addition to the first label information in each group, the first target position of each label information in the group can be determined according to the above method. For the first label information in each group, the first initial position of the label information can be used as the first target position of the label information. In addition, the horizontal coordinate in the first target position of each label information is the same as the horizontal coordinate in the first initial position.

[0213] Reference Figure 5 , the first display interval is taken as 20 for example, i is an integer, used to control the number of cycles. For each group of corresponding m label information, when i = 0, that is, the first cycle, the label information ranked first is selected as the current label information, the difference between the vertical coordinate of the next label information and the vertical coordinate of the current label information is calculated, if the difference is less than the first display interval, the vertical coordinate of the next label information is updated, then i is increased to 1, when i = 1, that is, the second cycle, the next label information is taken as the current label information, and so on, when i = m-2, that is, the last cycle, the starting angle and the ending angle of the m data items corresponding to the group can be obtained, when i = m-1, the cycle condition is not met, and the cycle ends.

[0214] 305、The terminal performs angle overlap detection on the lead according to the second initial position of the lead to determine a second target position of the lead.

[0215] The implementation manner of this step is that the terminal obtains a first display angle of the lead, the first display angle is an included angle between a connecting line between a starting point of the lead and a center of the multi-layer pie chart when the lead is displayed separately from the adjacent lead, and a second target position of the lead is determined according to the first display angle and the second initial position of the lead.

[0216] The second initial position includes the starting point. The first display angle can be set to any value as needed, for example, the first display angle can be set to 1 radian, 2 radians, 3 radians, 4 radians, etc., and the present disclosure does not limit this.

[0217] The implementation steps of determining the second target position of the lead according to the first display angle and the second initial position of the lead by the terminal include the following steps (1)-(3):

[0218] (1) The terminal takes the position of the center of the multi-layer pie chart as a coordinate origin, determines a first included angle of a first connecting line with a horizontal axis, the first connecting line is a connecting line between the starting point of the lead and the coordinate origin, and determines a second included angle of a second connecting line with the horizontal axis, the second connecting line is a connecting line between the starting point of the previous lead and the coordinate origin, the previous lead is the lead adjacent to the lead in the clockwise direction.

[0219] It can be understood that the first included angle of the first connecting line corresponding to the lead with the horizontal axis is the middle angle of the data item corresponding to the lead, and the second included angle of the second connecting line corresponding to the previous lead with the horizontal axis is the middle angle of the data item corresponding to the previous lead, therefore, the implementation manner of this step is that the terminal obtains the middle angle of the data item corresponding to the lead and the middle angle of the data item corresponding to the previous lead.

[0220] It should be noted that, in the embodiments of the present disclosure, the determination method of the second target position of the lead line is illustrated by taking the last lead line in the clockwise direction as an example. Of course, the last lead line can also be the adjacent lead line in the counterclockwise direction, and the present disclosure does not limit this.

[0221] (2) The terminal updates the starting point of the lead line in the counterclockwise direction of the starting point of the lead line according to the second angle and the first display angle, to obtain the second target position of the lead line, in response to the difference between the first angle and the second angle being less than the first display angle.

[0222] It should be noted that, if the last lead line is the adjacent lead line of the lead line in the clockwise direction, the first angle between the connecting line of the updated starting point of the lead line and the coordinate origin and the horizontal axis is equal to the sum of the second angle and the first display angle. If the last lead line is the adjacent lead line of the lead line in the counterclockwise direction, the first angle between the connecting line of the updated starting point of the lead line and the coordinate origin and the horizontal axis is equal to the difference between the second angle and the first display angle.

[0223] The implementation manner of the step is that the terminal updates the intermediate angle of the data item corresponding to the lead line to the sum of the intermediate angle of the last lead line and the first display angle, and then re-determines the starting point of the lead line according to the updated intermediate angle of the lead line, in response to the difference between the intermediate angle of the data item corresponding to the lead line and the intermediate angle of the data item corresponding to the last lead line being less than the first display angle, wherein the last lead line is the adjacent lead line of the lead line in the clockwise direction, or the terminal updates the intermediate angle of the data item corresponding to the lead line to the difference between the intermediate angle of the last lead line and the first display angle, and then re-determines the starting point of the lead line according to the updated intermediate angle of the lead line, in response to the difference between the intermediate angle of the data item corresponding to the last lead line and the intermediate angle of the data item corresponding to the lead line being less than the first display angle, wherein the last lead line is the adjacent lead line of the lead line in the counterclockwise direction.

[0224] The implementation manner of the terminal for re-determining the starting point of the lead line according to the updated intermediate angle of the lead line is the same as the implementation manner of the terminal for determining the starting point of the lead line in step 302, and details are not repeated here.

[0225] It should be noted that after the terminal re-determines the starting point of the lead line, the terminal also needs to re-determine the turning point of the lead line according to the updated intermediate angle of the lead line. The implementation manner of the terminal for re-determining the turning point of the lead line according to the updated intermediate angle of the lead line is the same as the implementation manner of the terminal for determining the turning point of the lead line in step 302, and details are not repeated here.

[0226] It should be noted that the terminal takes the first target position of the label information as an updated end point of the lead line corresponding to the label information, and determines the second target position of the lead line according to the updated start point, the updated turning point and the updated end point.

[0227] In the embodiment of the present disclosure, in response to the difference between the first included angle and the second included angle being less than the first display angle, the terminal updates the start point of the lead line in the counterclockwise direction of the start point of the lead line according to the second included angle and the first display angle to obtain the second target position of the lead line, which can prevent the lead line from being too concentrated and cause the problem that the corresponding sector area or the corresponding label information of the lead line cannot be distinguished, thereby improving the display effect of the label information of the multi-layer pie chart.

[0228] (3) The terminal acquires a termination angle of the sector area corresponding to the lead line, and corrects the second target position of the lead line in response to the termination angle being less than the first included angle.

[0229] The implementation manner of the terminal for correcting the second target position of the lead line is that the terminal takes the termination angle of the sector area corresponding to the lead line as a corrected intermediate angle corresponding to the lead line, re-determines the start point and the turning point of the lead line according to the corrected intermediate angle, and then takes the first target position of the label information corresponding to the lead line as an end point of the lead line, and determines the second target position of the lead line according to the start point, the turning point and the end point.

[0230] In the embodiment of the present disclosure, by correcting the second target position of the lead line, it can be ensured that the start point of the lead line falls on the arc of the sector area corresponding to the lead line, thereby ensuring the accuracy of the lead line annotation.

[0231] Reference Figure 6 The flowchart for the terminal to determine the second target position of the lead line is shown in FIG. 6. Taking 1 radian as the first display angle for example, i is an integer, which is used to control the number of loops. For L lead lines corresponding to the multi-layer pie chart, when i = 0, i.e. in the first loop, the current lead line is selected, the difference between the intermediate angle of the next lead line and the intermediate angle of the current lead line is calculated, if the difference is less than the first display angle, the intermediate angle of the next lead line is updated, then i is increased to 1, i.e. i = 1, in the second loop, the next lead line is taken as the current lead line, and so on, when i = L-2, i.e. in the last loop, the intermediate angles of the L lead lines corresponding to the multi-layer pie chart are obtained, and when i = L-1, the loop condition is not met, and the loop ends.

[0232] 306、The terminal determines a visible area corresponding to the multi-layer pie chart, and the visible area is used to display the label information and the lead line of the label information.

[0233] The implementation manner in which the terminal determines the visible area corresponding to the multi-layer pie chart is that the terminal registers an onGetG2Instance event, and obtains a region corresponding to a Canvas (a drawing canvas), and the region is the visible area. The region corresponding to the Canvas can be represented by the height and the width of the Canvas.

[0234] After determining the visible area, the terminal further determines whether the visible area includes a first target position of label information and a second target position of a lead line of the label. The terminal performs step 306 in response to the visible area including the first target position and the second target position. The implementation manner in which the terminal determines whether the visible area includes the first target position of the label information is that if the horizontal coordinate and the vertical coordinate in the first target position of the label information satisfy the following formula (8) respectively, it is determined that the visible area includes the first target position.

[0235] (8)

[0236] In the formula (8), endpointX is the horizontal coordinate in the first target position of the label information, endpointY is the vertical coordinate in the first target position of the label information, W is the width of the Canvas, and H is the height of the Canvas.

[0237] It should be noted that if the first target position of the label information is in the visible area, the second target position of the lead line of the label information is also in the visible area.

[0238] It should be further noted that for the label information whose first target position is not in the visible area, the first target position or the visible area can be adjusted to make the label information in the visible area, and the disclosure does not limit this.

[0239] In the embodiment of the disclosure, the terminal determines whether the visible area includes the first target position of the label information and the second target position of the lead line of the label information, displays the corresponding label information at the first target position and displays the corresponding lead line at the second target position in response to the visible area including the first target position and the second target position, and adjusts the first target position or the visible area to make the label information and the lead line in the visible area if the visible area does not include the first target position, so that the label information can be completely displayed, thereby improving the display effect of the label information of the multi-layer pie chart.

[0240] Reference Figure 7A flowchart for determining whether the label information is in the visible area. Wherein, i is an integer, used to control the number of times of the loop. For L label information corresponding to the multi-layer pie chart, when i = 0, that is, the first loop, it is determined whether the first target position corresponding to the current label information is in the visible area, if yes, the label information and the corresponding lead are drawn, then i is increased by 1 to obtain i = 1, when i = 1, that is, the second loop, the next label information is taken as the current label information, and so on. When i = L-1, that is, after the last loop, that is, after judging whether the L label information of the multi-layer pie chart is in the visible area, when i = L, the loop condition is not satisfied, and the loop ends.

[0241] 307、The terminal displays the data item according to the first target position and the second target position.

[0242] The implementation manner of the step can be that the terminal displays the label information at the first target position and displays the lead at the second target position.

[0243] Further, the terminal draws a polyline as the lead according to the starting point, the turning point and the end point in the second target position, and displays the corresponding label information at the end point of the polyline, that is, at the first target position.

[0244] In a possible implementation manner, if the first target position of the label information is located on the left side of the multi-layer pie chart, the label information is displayed in a right alignment manner, and if the first target position of the label information is located on the right side of the multi-layer pie chart, the label information is displayed in a left alignment manner. In this way, the display of the pie chart label information is clearer and more orderly, and the display effect of the label information is improved.

[0245] Reference Figure 8 A schematic diagram of the positional relationship between the label information and the lead when the label information of the multi-layer pie chart is displayed according to the first initial position and the lead is displayed according to the second initial position. As can be seen, because the label information of the multi-layer pie chart is relatively large, part of the label information overlaps, and the display effect of the label information is poor. Figure 9 A schematic diagram of the positional relationship between the label information and the lead when the label information of the multi-layer pie chart is displayed according to the first target position and the lead is displayed according to the second target position. As can be seen, in the case that the label information of the multi-layer pie chart is relatively large, no label information overlaps, and the display effect of the label information is good.

[0246] In summary, the label information display method in the present disclosure can be understood as follows: the terminal determines the middle angle of the sector area corresponding to the data item according to the data proportion of the data item corresponding to the multi-layer pie chart, and then determines the four-tuple information of the label information according to the middle angle and the label information included by the data item, wherein the four-tuple information of the label information includes the starting point of the lead line corresponding to the label information, the turning point of the lead line, the end point of the lead line (the position of the label information), and the label information itself. Then, the four-tuple information of the label information is subjected to collision detection and angle overlap detection of the label information, that is, whether the label information overlaps is determined according to the position of the label information, and whether the lead line overlaps is determined according to the middle angle. In the case of determining that the label information overlaps, the end point of the lead line in the four-tuple information of the label information is adjusted, and in the case of determining that the lead line overlaps, the starting point and the turning point of the lead line in the four-tuple information of the label information are adjusted. Then, the label information and the lead line of the multi-layer pie chart are drawn according to the adjusted four-tuple information of the label information.

[0247] It should be noted that the lead line in the embodiment of the present disclosure is taken as an example of a broken line, that is, the lead line includes a starting point, a turning point and an end point. In a possible implementation, the lead line can also be a line segment. For example, the starting point and the turning point in the second initial position of the lead line can be taken as the starting point and the end point of the line segment respectively, the third initial position of the lead line is determined according to the starting point and the end point, and the end point is taken as the fourth initial position of the label information corresponding to the lead line. Then, the terminal can adjust the starting point and the end point of the lead line in the third initial position in the case that the middle angle of the adjacent lead line is less than the first display angle, to obtain the third target position of the lead line and the fourth target position of the label information, display the corresponding lead line at the third target position, and display the corresponding label information at the fourth target position. Moreover, the terminal can display the label information horizontally at the fourth target position or display the label information along the extension direction of the lead line, so as to avoid the overlap of the label information. This method of displaying the label information and the lead line can avoid the overlap of the label information and the lead line, and is simple and easy to implement. Figure 10 For displaying the label information of the multi-layer pie chart according to the fourth target position and displaying the lead line according to the third target position, the positional relationship between the label information and the lead line is shown in the schematic view.

[0248] In the embodiment of the present disclosure, a multi-layer pie chart to be processed is acquired, the multi-layer pie chart is generated by a data visualization application, at least two data items corresponding to the multi-layer pie chart are acquired, the data items include data proportions and label information, and are used to display a sector area and corresponding label information. According to the data proportions included in the data items, a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information are determined. The lead line is used to lead out from the sector area corresponding to the data items to the label information included in the data items. Through label collision detection on the labels according to the first initial positions of the labels, first target positions of the labels are determined, which can avoid the labels of the multi-layer pie chart from being hidden or stacked, thereby improving the label display amount of the pie chart. Through angle overlap detection on the lead lines according to the second initial positions of the lead lines, second target positions of the lead lines are determined, which can avoid the lead lines of the labels from being stacked. Through display of the data items according to the first target positions and the second target positions, and the lead lines used to lead out from the sector area corresponding to the data items to the label information corresponding to the data items, the corresponding relationship between the label information and the data items of the multi-layer pie chart can be clearly displayed through the lead lines, and the display of the label information of the multi-layer pie chart is well supported.

[0249] Figure 11 is a block diagram of a label information processing device of a multi-layer pie chart provided by the embodiment of the present disclosure. Referring to Figure 11 , the embodiment includes:

[0250] The multi-layer pie chart acquisition module 1101 is configured to acquire a multi-layer pie chart to be processed, and the multi-layer pie chart is generated by a data visualization application.

[0251] The data item acquisition module 1102 is configured to acquire at least two data items corresponding to the multi-layer pie chart, and the data items include data proportions and label information, and are used to display a sector area and corresponding label information.

[0252] The initial position determination module 1103 is configured to determine, according to the data proportions included in the data items, a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information, and the lead line is used to lead out from the sector area corresponding to the data items to the label information included in the data items.

[0253] The target position determination module 1104 is configured to perform label collision detection on the label information according to the first initial positions of the label information, and determine first target positions of the label information.

[0254] The target position determination module 1104 is further configured to perform angle overlap detection on the lead lines according to the second initial positions of the lead lines, and determine second target positions of the lead lines.

[0255] The data item display module 1105 is configured to display the data item according to the first target position and the second target position.

[0256] In a possible implementation, the target position determination module 1104 is further configured to obtain a first display interval of the label information, the first display interval being a distance between the label information and adjacent label information when the label information and the adjacent label information are displayed separately; and determine the first target position of the label information according to the first display interval and a first initial position of the label information.

[0257] In another possible implementation, the target position determination module 1104 is further configured to take a position of a center of the multi-layer pie chart as a coordinate origin, determine a quadrant in which the label information is located according to the first initial position of the label information, determine a group in which the label information is located according to the quadrant in which the label information is located, the group in which the label information is located being a first group or a second group, the label information in the first group being used to be displayed on a left side of the multi-layer pie chart, and the label information in the second group being used to be displayed on a right side of the multi-layer pie chart, determine a vertical coordinate of the label information according to the first initial position of the label information, and determine the first target position of the label information according to the first display interval of the label information, the vertical coordinate of the label information, and the group in which the label information is located.

[0258] In another possible implementation, the target position determination module 1104 is further configured to obtain a vertical coordinate of a previous label information of the group in which the label information is located, determine a difference between the vertical coordinate of the label information and the vertical coordinate of the previous label information, and determine, in response to the difference being less than the first display interval, the first target position of the label information as a difference between the vertical coordinate of the previous label information and the first display interval.

[0259] In another possible implementation, the target position determination module 1104 is further configured to obtain a first display angle of the lead, the first display angle being an included angle between a line connecting a starting point of the lead and the center of the multi-layer pie chart and a horizontal axis when the lead and adjacent lead are displayed separately, and determine the second target position of the lead according to the first display angle and a second initial position of the lead.

[0260] In another possible implementation, the second initial position includes the starting point,

[0261] The target position determination module 1104 is further configured to take the position of the center of the multi-layer pie chart as the coordinate origin, determine a first included angle between a first line and the horizontal axis, the first line being a line connecting the starting point of the lead and the coordinate origin, determine a second included angle between a second line and the horizontal axis, the second line being a line connecting a starting point of a previous lead and the coordinate origin, the previous lead being a lead adjacent to the lead in a clockwise direction, and in response to a difference between the first included angle and the second included angle being less than the first display angle, update the starting point of the lead in a counterclockwise direction of the starting point of the lead according to the second included angle and the first display angle, to obtain the second target position of the lead.

[0262] In another possible implementation, the target position determining module 1104 is further configured to acquire a termination angle of the sector area corresponding to the lead, and correct the second target position of the lead in response to the termination angle being less than the first included angle.

[0263] In another possible implementation, the second initial position includes a start point, a turning point and an end point,

[0264] The initial position determining module 1103 is further configured to take the position of the center of the multi-layer pie chart as a coordinate origin, determine a start angle and a termination angle of a sector area corresponding to a data item according to a data proportion included in the data item, determine a middle angle corresponding to the data item according to the start angle and the termination angle of the sector area corresponding to the data item, acquire a radius of a layer pie chart corresponding to the data item, and determine the horizontal coordinate and the vertical coordinate of the start point of the lead of the label information included in the data item according to the radius of the layer pie chart corresponding to the data item and the middle angle corresponding to the data item; acquire a second display interval and a radius of an outermost layer pie chart in the multi-layer pie chart, the second display interval being the distance between the turning point of the lead and the outermost layer pie chart when the lead is displayed in a separate manner, determine the horizontal coordinate and the vertical coordinate of the turning point of the lead of the label information included in the data item according to the second display interval, the radius of the outermost layer pie chart and the middle angle corresponding to the data item, acquire a third display interval, determine the horizontal coordinate of the end point of the lead of the label information included in the data item according to the radius of the outermost layer pie chart and the third display interval, take the vertical coordinate of the turning point of the lead of the label information as the vertical coordinate of the end point of the lead of the label information, and take the horizontal coordinate of the end point of the lead of the label information as the horizontal coordinate of the label information, and take the vertical coordinate of the end point of the lead of the label information as the vertical coordinate of the label information.

[0265] In another possible implementation, the initial position determining module 1103 is further configured to, for any layer pie chart in the multi-layer pie chart, select any data item from the data items corresponding to the layer pie chart as a current data item, determine a preset angle as the start angle of a sector area corresponding to the current data item, determine the termination angle of the sector area corresponding to the current data item according to the data proportion included in the current data item and the start angle of the sector area corresponding to the current data item, take the termination angle of the sector area corresponding to the current data item as the start angle of a sector area corresponding to a next data item, determine the termination angle of the sector area corresponding to the next data item according to the data proportion included in the next data item and the start angle of the sector area corresponding to the next data item, take the termination angle of the sector area corresponding to the next data item as the start angle of a sector area corresponding to a further next data item, and so on and so forth, to obtain the start angle and the termination angle of the sector area corresponding to each data item.

[0266] In another possible implementation, the data item display module 1105 is further configured to determine a visible region corresponding to the multi-layer pie chart, the visible region being used to display the label information and a lead line of the label information; and in response to the visible region including the first target position and the second target position, display the label information at the first target position and display the lead line at the second target position.

[0267] In the embodiments of the present disclosure, a multi-layer pie chart to be processed is obtained, the multi-layer pie chart being generated by a data visualization application, at least two data items corresponding to the multi-layer pie chart are obtained, the data items including data proportions and label information, the data items being used to display a sector region and corresponding label information, a first initial position for displaying the label information included in the data items and a second initial position for displaying a lead line of the label information are determined according to the data proportions included in the data items, the lead line being used to lead out from the sector region corresponding to the data items to the label information included in the data items, the first target position of the label is determined by performing label collision detection on the label according to the first initial position of the label, which can avoid the label of the multi-layer pie chart from being hidden or stacked, thereby improving the label display amount of the pie chart, the second target position of the lead line is determined by performing angle overlap detection on the lead line according to the second initial position of the lead line, which can avoid the lead line of the label from being stacked, and the data items are displayed according to the first target position and the second target position, and the lead line is used to lead out from the sector region corresponding to the data items to the label information corresponding to the data items, which can clearly display the corresponding relationship between the label information and the data items of the multi-layer pie chart through the lead line, and well supports the display of the label information of the multi-layer pie chart.

[0268] All the optional technical solutions described above can be combined to form optional embodiments of the present disclosure, which will not be described here again.

[0269] It should be noted that the multi-layer pie chart label information processing apparatus provided in the above embodiments is only used as an example for the division of the above functional modules when the multi-layer pie chart label information processing apparatus processes the label information of the multi-layer pie chart, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the multi-layer pie chart label information processing apparatus and the multi-layer pie chart label information processing method provided in the above embodiments belong to the same concept, and the specific implementation process is described in detail in the method embodiments, which will not be described here again.

[0270] Figure 12A structure block diagram of a terminal 1200 according to an example embodiment of the present disclosure is shown. The terminal 1200 can be a smartphone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer, or a desktop computer. The terminal 1200 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0271] Generally, the terminal 1200 includes a processor 1201 and a memory 1202.

[0272] The processor 1201 can include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 1201 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 1201 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1201 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed on a display screen. In some embodiments, the processor 1201 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.

[0273] The memory 1202 can include one or more computer-readable storage media, which can be non-transitory. The memory 1202 can also include a high-speed random access memory, and a non-volatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one instruction for being executed by the processor 1201 to implement the label information processing method of the multi-layer pie chart provided by the method embodiments in the present application.

[0274] In some embodiments, terminal 1200 can also optionally include a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202 and the peripheral device interface 1203 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1203 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 1204, a touch display screen 1205, a camera component 1206, an audio circuit 1207, a positioning component 1208 and a power supply 1209.

[0275] The peripheral device interface 1203 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202 and the peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202 and the peripheral device interface 1203 can be implemented on a separate chip or circuit board, and the present embodiments are not limited thereto.

[0276] The radio frequency circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1204 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 1204 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area networks and / or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 1204 can also include NFC (Near Field Communication) related circuitry, which is not limited by the present application.

[0277] The display screen 1205 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 1205 is a touch display screen, the display screen 1205 is further configured to capture touch signals on or above the surface of the display screen 1205. The touch signals can be input to the processor 1201 as control signals for processing. In this case, the display screen 1205 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 1205 can be one, arranged on the front panel of the terminal 1200; in other embodiments, the display screen 1205 can be at least two, arranged on different surfaces of the terminal 1200 or in a folding design; in still other embodiments, the display screen 1205 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal 1200. Even, the display screen 1205 can also be arranged in an irregular shape, i.e., a special-shaped screen. The display screen 1205 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0278] The camera assembly 1206 is configured to capture images or videos. Optionally, the camera assembly 1206 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the rear camera is at least two, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function by fusing the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function by fusing the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 1206 can further include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0279] The audio circuit 1207 can include a microphone and a speaker. The microphone is used to collect sound waves of a user and an environment, and convert the sound waves into an electrical signal input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 1200. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert an electrical signal from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can the electrical signal be converted into a sound wave audible to humans, but also can be converted into a sound wave inaudible to humans for ranging purposes. In some embodiments, the audio circuit 1207 can also include a headphone jack.

[0280] The positioning component 1208 is used to position the current geographic position of the terminal 1200 to realize navigation or LBS (Location Based Service, location-based service).

[0281] The power supply 1209 is used to supply power to various components in the terminal 1200. The power supply 1209 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 1209 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0282] In some embodiments, the terminal 1200 also includes one or more sensors 1210. The one or more sensors 1210 include but are not limited to: an acceleration sensor 1211, a gyroscope sensor 1212, a pressure sensor 1213, a fingerprint sensor 1214, an optical sensor 1215, and a proximity sensor 1216.

[0283] The acceleration sensor 1211 can detect the acceleration magnitude in three coordinate axes of the coordinate system established by the terminal 1200. For example, the acceleration sensor 1211 can be used to detect the components of gravitational acceleration in three coordinate axes. The processor 1201 can control the touch display 1205 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1211. The acceleration sensor 1211 can also be used for game or user motion data collection.

[0284] The gyroscope sensor 1212 can detect the body direction and rotation angle of the terminal 1200, and can collect 3D motions of a user on the terminal 1200 in cooperation with the acceleration sensor 1211. The processor 1201 can implement the following functions according to the data collected by the gyroscope sensor 1212: motion sensing (e.g., changing a UI according to a tilt operation of the user), image stabilization when shooting, game control, and inertial navigation.

[0285] The pressure sensor 1213 can be disposed on the side frame of the terminal 1200 and / or the lower layer of the touch display screen 1205. When the pressure sensor 1213 is disposed on the side frame of the terminal 1200, the grip signal of the user on the terminal 1200 can be detected, and the left-hand / right-hand recognition or shortcut operation can be performed by the processor 1201 according to the grip signal collected by the pressure sensor 1213. When the pressure sensor 1213 is disposed on the lower layer of the touch display screen 1205, the operable control on the UI interface can be controlled by the processor 1201 according to the pressure operation of the user on the touch display screen 1205. The operable control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0286] The fingerprint sensor 1214 is used to collect the fingerprint of the user, and the identity of the user can be recognized by the processor 1201 according to the fingerprint collected by the fingerprint sensor 1214, or by the fingerprint sensor 1214 according to the collected fingerprint. When the identity of the user is recognized as a trusted identity, the processor 1201 authorizes the user to perform a related sensitive operation, which includes unlocking the screen, viewing encrypted information, downloading software, payment, and changing settings, etc. The fingerprint sensor 1214 can be disposed on the front, back, or side of the terminal 1200. When the physical button or the manufacturer's logo is disposed on the terminal 1200, the fingerprint sensor 1214 can be integrated with the physical button or the manufacturer's logo.

[0287] The optical sensor 1215 is used to collect the ambient light intensity. In one embodiment, the processor 1201 can control the display brightness of the touch display screen 1205 according to the ambient light intensity collected by the optical sensor 1215. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1205 is increased, and when the ambient light intensity is low, the display brightness of the touch display screen 1205 is decreased. In another embodiment, the processor 1201 can also dynamically adjust the shooting parameter of the camera assembly 1206 according to the ambient light intensity collected by the optical sensor 1215.

[0288] The proximity sensor 1216, also referred to as a distance sensor, is usually arranged on the front panel of the terminal 1200. The proximity sensor 1216 is used to collect the distance between the user and the front of the terminal 1200. In one embodiment, when the proximity sensor 1216 detects that the distance between the user and the front of the terminal 1200 gradually decreases, the touch display screen 1205 is switched from the bright screen state to the sleep screen state under the control of the processor 1201; when the proximity sensor 1216 detects that the distance between the user and the front of the terminal 1200 gradually increases, the touch display screen 1205 is switched from the sleep screen state to the bright screen state under the control of the processor 1201.

[0289] Those skilled in the art can understand that the structure shown in the foregoing embodiments is not a limitation on the terminal 1200, and the terminal 1200 can include more or fewer components than those shown in the drawings, or combine certain components, or adopt a different arrangement of components. Figure 12 Those skilled in the art can understand that the structure shown in the foregoing embodiments is not a limitation on the terminal 1200, and the terminal 1200 can include more or fewer components than those shown in the drawings, or combine certain components, or adopt a different arrangement of components.

[0290] Figure 13 FIG. 13 is a structural schematic diagram of a server provided by an embodiment of the present disclosure. The server 1300 can have a large difference due to different configurations or performances, and can include one or more central processing units (CPUs) 1301 and one or more memories 1302. The memory 1302 stores at least one instruction, which is loaded and executed by the processor 1301 to implement the label information processing method of the multi-layer pie chart provided by the various method embodiments. Of course, the server can also have a wired or wireless network interface, a keyboard, an input and output interface, and other components for implementing device functions, which are not described here.

[0291] In an exemplary embodiment, a computer readable storage medium, such as a memory including instructions, is also provided, which can be executed by a processor in a terminal to complete the label information processing method of the multi-layer pie chart in the above embodiments. For example, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0292] Those of ordinary skill in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by a program instructing related hardware, and the program can be stored in a computer readable storage medium, such as a read-only memory, a magnetic disk or an optical disk.

[0293] The above merely describes optional embodiments of the present disclosure, and is not intended to limit the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for processing label information in a multi-layer pie chart, characterized in that, The method includes: Obtain a multi-layered pie chart to be processed, wherein the multi-layered pie chart is generated through a data visualization application; Obtain at least two data items corresponding to the multi-layer pie chart, wherein the data items include data percentage and label information, and are used to display a sector area and the corresponding label information; Based on the data proportions included in the data item, a first initial position for displaying the label information included in the data item and a second initial position for displaying the label information are determined. The starting point of the second initial position is located in the sector area corresponding to the data item in the multi-layer pie chart, and the ending point of the second initial position is located outside the multi-layer pie chart. The first initial position is located at the ending point of the second initial position. The lead is used to extend from the sector area corresponding to the data item to the label information included in the data item. Based on the first initial position of the label information, label collision detection is performed on the label information to determine the first target position of the label information; Based on the second initial position of the lead wire, the lead wire is subjected to angle overlap detection to determine the second target position of the lead wire; The data item is displayed based on the first target location and the second target location.

2. The method according to claim 1, characterized in that, The step of performing tag collision detection on the tag information based on the first initial position of the tag information to determine the first target position of the tag information includes: Obtain the first display spacing of the label information, where the first display spacing is the distance between the label information and adjacent label information when they are displayed separately; Based on the first display spacing and the first initial position of the label information, the first target position of the label information is determined.

3. The method according to claim 2, characterized in that, Determining the first target position of the label information based on the first display spacing and the first initial position of the label information includes: Using the center of the multi-layer pie chart as the origin of the coordinate system, the quadrant in which the label information is located is determined based on the first initial position of the label information. Based on the quadrant where the label information is located, the group in which the label information is located is determined. The group in which the label information is located is either the first group or the second group. The label information in the first group is used to be displayed on the left side of the multi-layer pie chart, and the label information in the second group is used to be displayed on the right side of the multi-layer pie chart. The vertical coordinate of the label information is determined based on the first initial position of the label information; The first target position of the label information is determined based on the first display spacing of the label information, the vertical coordinate, and the group in which the label information is located.

4. The method according to claim 3, characterized in that, Determining the first target position of the label information based on the first display spacing of the label information, the vertical coordinate, and the group in which the label information belongs includes: Obtain the ordinate of the previous tag information in the group containing the tag information; Determine the difference between the ordinate of the label information and the ordinate of the previous label information; In response to the difference being less than the first display spacing, the difference between the vertical coordinate of the previous label information and the first display spacing is determined as the first target position of the label information.

5. The method according to claim 1, characterized in that, The step of performing angle overlap detection on the lead wire based on its second initial position to determine the second target position of the lead wire includes: Obtain the first display angle of the lead wire, which is the angle between the starting point of the lead wire and the center of the multi-layer pie chart when the lead wire is displayed separately from adjacent lead wires; The second target position of the lead is determined based on the first display angle and the second initial position of the lead.

6. The method according to claim 5, characterized in that, The second initial position includes a starting point. Determining the second target position of the lead wire based on the first display angle and the second initial position of the lead wire includes: Using the center of the multi-layer pie chart as the origin of the coordinate system, determine the first angle between the first connecting line and the horizontal axis, where the first connecting line is the line connecting the starting point of the lead line to the origin of the coordinate system. Also, determine the second angle between the second connecting line and the horizontal axis, where the second connecting line is the line connecting the starting point of the previous lead line to the origin of the coordinate system, where the previous lead line is the lead line adjacent to the lead line in the clockwise direction. In response to the difference between the first included angle and the second included angle being less than the first display angle, the starting point of the lead is updated in a counterclockwise direction based on the second included angle and the first display angle to obtain the second target position of the lead.

7. The method according to claim 1, characterized in that, The second initial position includes a start point, a turning point, and an end point. Determining the first initial position for displaying the label information included in the data item and the second initial position for displaying the lead line of the label information, based on the data proportion included in the data item, includes: Using the center of the multi-layer pie chart as the origin of the coordinate system, the starting and ending angles of the sector area corresponding to each data item are determined based on the data percentage included in each data item. The intermediate angle corresponding to the data item is determined based on the starting angle and ending angle of the sector area corresponding to the data item. Obtain the radius of the pie chart corresponding to the data item, and determine the x and y coordinates of the starting point of the leader line of the label information included in the data item based on the radius of the pie chart corresponding to the data item and the midpoint angle of the data item. Obtain the second display spacing and the radius of the outermost pie chart in the multi-layer pie chart. The second display spacing is the distance between the turning point of the leader and the outermost pie chart when the leader is used for separation display. Based on the second display spacing, the radius of the outermost pie chart, and the median angle corresponding to the data item, determine the horizontal and vertical coordinates of the turning point of the leader of the label information included in the data item. Obtain the third display spacing, and determine the horizontal coordinate of the endpoint of the leader line of the label information included in the data item based on the radius of the outermost pie chart and the third display spacing; The ordinate of the turning point of the lead line of the tag information included in the data item is taken as the ordinate of the end point of the lead line of the tag information included in the data item. The x-coordinate of the endpoint of the leader line of the tag information included in the data item is taken as the x-coordinate of the tag information included in the data item, and the y-coordinate of the endpoint of the leader line of the tag information included in the data item is taken as the y-coordinate of the tag information included in the data item.

8. The method according to claim 7, characterized in that, The step of determining the start and end angles of the sector region corresponding to the data item based on the data percentage included in the data item includes: For any layer of the multi-layer pie chart, select any data item from the data items corresponding to any layer of the pie chart as the current data item, determine the preset angle as the starting angle of the sector area corresponding to the current data item, and determine the ending angle of the sector area corresponding to the current data item based on the data proportion included in the current data item and the starting angle of the sector area corresponding to the current data item. The ending angle of the sector region corresponding to the current data item is taken as the starting angle of the sector region corresponding to the next data item. The ending angle of the sector region corresponding to the next data item is determined based on the data proportion included in the next data item and the starting angle of the sector region corresponding to the next data item. The ending angle of the sector region corresponding to the next data item is taken as the starting angle of the sector region corresponding to the next data item, and so on, to obtain the starting angle and ending angle of the sector region corresponding to each data item.

9. A label information processing device for multi-layer pie charts, characterized in that, The device includes: A multi-layer pie chart acquisition module is used to acquire a multi-layer pie chart to be processed, wherein the multi-layer pie chart is generated through a data visualization application; The data item acquisition module is used to acquire at least two data items corresponding to the multi-layer pie chart. The data items include data percentage and label information, and are used to display a sector area and the corresponding label information. An initial position determination module is used to determine a first initial position for displaying the label information included in the data item and a second initial position for displaying the label information based on the data proportion included in the data item. The starting point of the second initial position is located in the fan-shaped area corresponding to the data item in the multi-layer pie chart, and the ending point of the second initial position is located outside the multi-layer pie chart. The first initial position is located at the ending point of the second initial position. The lead line is used to extend from the fan-shaped area corresponding to the data item to the label information corresponding to the data item. The target location determination module is used to perform tag collision detection on the tag information based on the first initial location of the tag information, and determine the first target location of the tag information; The target position determination module is further configured to perform angular overlap detection on the lead wire based on the second initial position of the lead wire, and determine the second target position of the lead wire; The data item display module is used to display the data item according to the first target position and the second target position.

10. A terminal, characterized in that, The terminal includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to perform the operation performed by the label information processing method for multi-layer pie charts as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to perform the operation of the label information processing method for multi-layer pie charts as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Pie chart label display method, system, readable storage medium and computer device

    CN109308203A

  • Label processing method and device, storage medium and computer equipment

    CN109800373A