CN105426368B - Information display method and device and electronic equipment - Google Patents

Information display method and device and electronic equipment Download PDF

Info

Publication number
CN105426368B
CN105426368B CN201410444603.0A CN201410444603A CN105426368B CN 105426368 B CN105426368 B CN 105426368B CN 201410444603 A CN201410444603 A CN 201410444603A CN 105426368 B CN105426368 B CN 105426368B
Authority
CN
China
Prior art keywords
frame
pie chart
data
description
target direction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410444603.0A
Other languages
Chinese (zh)
Other versions
CN105426368A (en
Inventor
陈曦
王拥军
李想
曾康乐
聂金瑞
郑雪勇
臧悦
张印泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410444603.0A priority Critical patent/CN105426368B/en
Publication of CN105426368A publication Critical patent/CN105426368A/en
Application granted granted Critical
Publication of CN105426368B publication Critical patent/CN105426368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an information display method, an information display device and electronic equipment, and belongs to the field of image processing. The method comprises the following steps: generating a pie chart containing n sector blocks and a description frame corresponding to each sector block according to the n items of data; adjusting the description frame to be far away from the target direction; displaying the pie chart and the description frame through a display component; the invention achieves the effect of regularly arranging the positions of the description frames, and reducing the number of the description frames positioned on one side of the target direction as much as possible, thereby saving the display space.

Description

Information display method and device and electronic equipment
Technical Field
The present invention relates to the field of image processing, and in particular, to an information display method and apparatus, and an electronic device.
Background
In statistics, a pie chart is used to represent the ratio of the magnitude of each item of data to the sum of the values of each item of data in a set of data.
Taking displaying a pie chart on a mobile phone as an example, as shown in fig. 1, when a set of data includes four items of data, the mobile phone calculates a ratio between a numerical value of each item of data and a data sum of the four items of data, then the mobile phone calculates a central angle of a sector 12 corresponding to the item of data in the pie chart 10 according to the ratio corresponding to each item of data, generates the pie chart 10 according to the respective central angles of the four sector 12, and adds 1 description frame 14 connected by straight lines to each sector 12 in the pie chart 10 for displaying.
In the process of implementing the embodiment of the invention, the inventor finds that the technology at least has the following problems: the display space of the mobile phone screen is limited, and when the distribution of the description frame 14 is scattered and random, the display space may be wasted or insufficient display may be caused.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide an information display method and apparatus, and an electronic device. The technical scheme is as follows:
according to a first aspect of embodiments of the present invention, there is provided an information display method, the method including:
generating a pie chart containing n sector blocks and a description frame corresponding to each sector block according to the n items of data;
adjusting the description frame to be far away from the target direction;
and displaying the pie chart and the description frame through a display component.
According to a second aspect of embodiments of the present invention, there is provided an information display apparatus, the apparatus including:
the generating module is used for generating a pie chart containing n sector blocks and a description frame corresponding to each sector block according to the n items of data;
the description frame adjusting module is used for adjusting the description frame to be far away from the target direction;
and the display module is used for displaying the pie chart and the description frame through a display component.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
generating a pie chart containing n sector blocks and a description frame corresponding to each sector block according to the n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the method achieves the effect of regularly arranging the positions of the description frames, and enables the description frames positioned on one side of the target direction to be as few as possible, thereby saving the display space.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a pie chart provided in the background art;
FIG. 2 is a flow chart of a method of displaying information according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for displaying information according to another embodiment of the present invention;
fig. 4 is a schematic coordinate diagram according to an information display method according to another embodiment of the present invention;
FIG. 5 is a diagram illustrating an information display method according to another embodiment of the present invention;
FIG. 6 is a diagram illustrating an information display method according to another embodiment of the present invention;
FIG. 7A is a schematic diagram of an information display method according to another embodiment of the present invention;
FIG. 7B is a diagram illustrating an information display method according to another embodiment of the present invention;
FIG. 7C is a diagram illustrating an information display method according to another embodiment of the present invention;
FIG. 8 is a diagram illustrating an information display method according to another embodiment of the present invention;
FIG. 9 is a schematic interface diagram of an information display method according to another embodiment of the present invention;
FIG. 10 is a flowchart of a method for displaying information according to another embodiment of the present invention;
FIG. 11 is a diagram illustrating an information display method according to another embodiment of the present invention;
fig. 12 is a block diagram showing the structure of an information display apparatus according to an embodiment of the present invention;
fig. 13 is a block diagram showing the structure of an information display apparatus according to an embodiment of the present invention;
fig. 14 is a block diagram of an electronic device provided by an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The information display method provided by each embodiment of the invention can be realized by electronic equipment with image processing and display functions. The electronic device may be a smartphone, a tablet computer, an e-book reader, a laptop portable computer, and the like.
For the sake of simplifying the description, the information display method is only exemplified below as being performed by an electronic device having a picture processing and display function, but this is not a limitation.
Referring to fig. 2, a flowchart of a method of displaying information according to an embodiment of the invention is shown. The method comprises the following steps:
step 202, generating a pie chart containing n sector blocks and a description frame corresponding to each sector block according to the n items of data;
step 204, adjusting the description frame to be far away from the target direction;
the target direction may be any one of an up direction, a down direction, a left direction, and a right direction of the electronic device. Since electronic devices are typically scrolling up and down, the target direction is illustrated as an up direction.
Step 206, displaying a pie chart and a description frame through a display component;
in summary, the information display method provided in this embodiment generates a pie chart including n sector blocks and a description frame corresponding to each sector block according to n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the method achieves the effect of regularly arranging the positions of the description frames, and enables the description frames positioned on one side of the target direction to be as few as possible, thereby saving the display space.
In particular implementations, the electronic device can adjust the description box in at least one of the following two ways. Firstly, the electronic equipment adjusts the sector block of the pie chart at one side of the target direction to be minimum; secondly, the electronic device adjusts the description frame belonging to one side of the target direction to be far away from the target direction, so that the purposes of saving the display space and improving the utilization rate of the space are achieved. An embodiment will be described below.
Referring to fig. 3, a flowchart of a method for displaying information according to another embodiment of the invention is shown. The method comprises the following steps:
step 301, generating a pie chart according to the proportion of each of the n items of data in the data sum, wherein each item of data corresponds to a sector block in the pie chart.
Before generating the pie chart, a rectangular plane coordinate system XOY shown in fig. 4 is first determined, in which the right half axis of the X axis is a positive half axis, the lower half axis of the Y axis is a positive half axis, and a concentric circle 41 and a concentric circle 42 are made with O as the center. It should be noted that, the plane rectangular coordinate system XOY may also be determined by taking the left half axis of the X axis as a positive half axis, and the upper half axis of the Y axis as a positive half axis, etc., and this embodiment is only described by taking the plane rectangular coordinate system XOY as the plane rectangular coordinate system shown in fig. 4, and does not limit the embodiment of the present invention.
The electronic equipment can sort the n items of data according to the proportion of each item of data in the total sum of the data and sequentially allocate a corresponding sector area to each item of data according to the sorting result. In order to ensure the display effect, it is reasonable that the data items are 2-4 items of data. Step 301 may include the following sub-steps:
the electronic equipment calculates the proportion of each item of data in the total sum of the data;
for example, if 4 items of data are included in total, where data a is 5, data B is 10, data C is 15, and data D is 20, the sum of the data is 50, and the ratio of data a is calculated to be 10%, the ratio of data B is 20%, the ratio of data C is 30%, and the ratio of data D is calculated to be 40%.
Secondly, the electronic equipment sorts the n items of data according to the proportion of each item of data in the total sum of the data;
the electronic device sorts the n items of data from small to large or from large to small according to the calculated proportion of each item of data in the total sum of data, and this embodiment exemplifies the sorting from small to large, and is not limited to this.
Thirdly, the electronic equipment calculates the central angle of the sector block corresponding to each item of data according to the proportion corresponding to each item of data;
for example, in 4 items of data in total, the proportion of the data a is 10%, the proportion of the data B is 20%, the proportion of the data C is 30%, and the proportion of the data D is 40%, which are obtained by calculation, the central angle of the sector block corresponding to the data a is 36 °, the central angle of the sector block corresponding to the data B is 72 °, the central angle of the sector block corresponding to the data C is 108 °, and the central angle of the sector block corresponding to the data D is 144 °
And fourthly, the electronic equipment divides the sector blocks according to the central angle obtained by calculation to generate a pie chart.
The electronic device divides the sector blocks in the order from small to large from the positive X-axis direction and clockwise according to the size of each item of data, and generates a pie chart as shown in fig. 5.
It should be noted that, in an actual implementation process, in order to ensure the sequentiality of the data, when the data cannot be sorted in some embodiments, the electronic device may respectively calculate the proportion of each item of data in the total sum of the data and allocate a corresponding sector area to each item of data according to the proportion, that is, step two may be omitted, and only substeps one, three, and four need to be performed.
In step 302, a description box is generated for each sector.
In order to clearly and intuitively display the data attribute name of each item of data and the proportion of each item of data in the data sum, a description box is required to be added at the sector block corresponding to each item of data for adding description characters, wherein the description characters can be the data attribute name of each item of data, the proportion of each item of data in the data sum, and the like.
As one possible implementation, the electronic device may generate a description box for each sector based on the centerline of each sector.
After the central line of the sector block extends for a preset length outside the pie chart, the electronic equipment adds a description frame at the tail end of the central line according to the data attribute names corresponding to the sector block.
Referring to fig. 6, after the electronic device extends the center line 62 of the sector 61 by a predetermined length outside the pie chart, a description frame 63 is added to the end of the center line 62 according to the data attribute name corresponding to the sector 61.
Step 303, adjusting the description frame to be away from the target direction.
In a specific implementation process, the electronic device may adjust the description frame away from the target direction in any one or two ways.
Firstly, the electronic equipment enables the sector area on one side of the target direction to be minimum through rotation operation according to the preset target direction.
And secondly, the electronic equipment adjusts the description frame belonging to one side of the target direction to be far away from the target direction.
For the first of these:
the target direction may be any one of an up direction, a down direction, a left direction, and a right direction of the electronic device. Since electronic devices are typically scrolling up and down, the target direction is illustrated as an up direction.
The term "one side of the target direction" refers to a space that divides the pie chart into two equal sides according to a straight line perpendicular to the target direction and belongs to one side of the target direction. If the target direction is the upper direction, the space belonging to one side of the upper direction is the 'target direction side' after dividing the pie chart into two equal sides according to a horizontal straight line.
The present embodiment is only illustrated with the target direction as the upper direction, and the present invention is not limited to the above embodiment, and the present step may include the following sub-steps:
1. the electronic equipment selects two sector blocks with the largest sum of central angles from every two adjacent sector blocks in the pie chart;
the electronic equipment obtains the central angle corresponding to each sector block in the pie chart, respectively calculates the sum of the central angles corresponding to two adjacent sector blocks, and selects the two sector blocks with the largest central angle sum.
It should be noted that the electronic device may also obtain two corresponding sector blocks by selecting two items of data with the largest sum of the proportions of two adjacent items of data, which is not limited in this embodiment.
2. The electronic equipment rotates the pie chart to enable the two fan-shaped blocks to be located on one side of the target direction, and the central line determined according to the two fan-shaped blocks is overlapped with the target direction.
As shown in fig. 7A, the pie chart 71 is divided into 4 sectors, and when the adjacent sectors 72 and 73 are two sectors having the largest sum of central angles among every two adjacent sectors, the central line determined from the sectors 72 and 73 coincides with the target direction by rotating the pie chart 71.
In addition, there is a possible case where, when the central angle of the largest sector in the pie chart is larger than the first angle, which may be 180 °, the electronic device may rotate the pie chart so that the largest sector is located on the side of the target direction and the center line of the largest sector coincides with the target direction, thereby minimizing the sectors on the side of the target direction.
As shown in fig. 7B, the central angle corresponding to the sector 74 is greater than 180 °, and the electronic device only needs to rotate the pie chart to locate the sector 74 at one side of the target direction, and the central line of the sector 74 coincides with the target direction, so that the sector located at one side of the target direction can be minimized.
For the second of these:
the electronic device adjusts the description frame on one side of the target direction to make the description frame far away from the target direction, so as to save the display space of the target direction, and the step may include the following substeps:
1. when the description frame is generated based on the center line of the sector block, the description frame corresponding to the sector block having an angle of less than 90 ° between the center line of the sector block and the target direction is determined as the description frame belonging to the target direction side.
As shown in fig. 7C, the description box 75 and the description box 76 are description boxes generated based on the center line of the sector, and the included angle between the center line of the sector corresponding to the description box 75 and the description box 76 and the target direction is less than 90 °, that is, the description box 75 and the description box 76 may be determined as description boxes belonging to one side of the target direction.
2. And bending a connecting line between the description frame and the pie chart which belong to one side of the target direction to the opposite direction of the target direction, wherein the included angle between the bent connecting line and the target direction is a second angle which is larger than 90 degrees.
Taking the second angle as 120 ° as an example, as shown in fig. 7C, the description frame 75 and the description frame 76 belong to one side of the target direction, a connecting line between the description frame 75 and the pie chart is bent in the opposite direction of the target, and an included angle between the bent connecting line and the target direction is 120 °; similarly, it will be described that the line between the frame 76 and the pie chart is bent in the opposite direction to the target, and the angle between the bent line and the target direction is 120 °.
It should be noted that the second angle may be preset according to the size of the screen, and the embodiment is described by taking the second angle as 120 ° as an example, and is not limited to the embodiment of the present invention.
In the implementation process, the description frames may overlap with each other, so the positions of the description frames need to be adjusted. This step may include the following substeps:
firstly, the electronic equipment selects a description frame to obtain the position of the current description frame;
secondly, the electronic equipment acquires the positions of two adjacent description frames of the current description frame;
if the current description frame and one of the description frames are mutually covered and separated from the other description frame, the electronic equipment finely adjusts the preset angle of the current description frame to the direction of the separated description frame according to the circumferential path;
the electronic equipment judges whether the current description frame and the two adjacent description frames are mutually covered or not according to the position relation of the current description frame and the two adjacent description frames. When the current description frame and one of the description frames are mutually covered and separated from the other description frame, the electronic equipment finely adjusts the current description frame to the direction of the description frame separated from the current description frame by a preset angle according to the circumferential path.
And fourthly, repeating the substeps one to three until all the description frames are not covered.
Then, the electronic device may display the pie chart as follows:
and step 304, initializing a circumscribed rectangle frame of the pie chart into a cutting frame.
The electronic equipment acquires a circumscribed rectangle of the pie chart, four edges of the circumscribed rectangle are respectively tangent to the circumference of the pie chart, and the circumscribed rectangle is initialized into a cutting frame.
Referring to FIG. 8, the electronic device initializes the circumscribed rectangle 82 of the pie chart 81 to a cropped border.
In step 305, it is determined whether each description box is located in a clipping border.
The electronic equipment acquires the vertical coordinates of the upper boundary and the lower boundary of the cutting frame and the horizontal coordinates of the left boundary and the right boundary. Then, the electronic equipment acquires the vertical coordinates of the upper boundary and the lower boundary of each description frame and the horizontal coordinates of the left boundary and the right boundary, and when the vertical coordinate of the upper boundary of each description frame is larger than the vertical coordinate of the upper boundary of the cutting frame, the vertical coordinate of the lower boundary of each description frame is smaller than the vertical coordinate of the lower boundary of the cutting frame, the vertical coordinate of the left boundary of each description frame is larger than the vertical coordinate of the left boundary of the cutting frame, and the vertical coordinate of the right boundary of each description frame is smaller than the vertical coordinates of the cutting frame and the boundary, the description frame is located in the cutting frame.
And step 306, when the description frame is positioned outside the clipping frame, enlarging the clipping frame according to the description frame.
When the description box is not clipped in the frame, the electronic equipment enlarges the clipped frame according to the description box.
Step 306 may include the following sub-steps:
the method comprises the steps that firstly, the electronic equipment obtains the minimum value of the vertical coordinate of the upper boundary and the horizontal coordinate of the left boundary of a description frame and a cutting frame, and the maximum value of the vertical coordinate of the lower boundary and the horizontal coordinate of the right boundary;
and secondly, expanding the cutting frame by the electronic equipment according to the minimum value of the upper boundary ordinate and the left boundary abscissa, and the maximum value of the lower boundary ordinate and the right boundary abscissa.
The electronic equipment determines the vertical coordinate of the upper boundary of the enlarged cutting frame according to the minimum value of the vertical coordinate of the upper boundary between the description frame and the cutting frame; the electronic equipment determines the left boundary abscissa of the enlarged clipping frame according to the minimum value of the left boundary abscissas of the description frame and the clipping frame; the electronic equipment determines the lower boundary ordinate of the enlarged clipping frame according to the maximum value of the lower boundary ordinate of the description frame and the clipping frame; and the electronic equipment determines the right boundary abscissa of the enlarged clipping frame according to the maximum value of the right boundary abscissas of the description frame and the clipping frame.
As shown in fig. 8, an enlarged cropping frame upper boundary 83 determined from the minimum value of the description frame and cropping frame upper boundary ordinate, an enlarged cropping frame left boundary 84 determined from the minimum value of the description frame and cropping frame left boundary abscissa, an enlarged cropping frame lower boundary 85 determined from the maximum value of the description frame and cropping frame lower boundary ordinate, and an enlarged cropping frame right boundary 86 determined from the maximum value of the description frame and cropping frame right boundary ordinate. The upper border 83, left border 84, lower border 85 and right border 86 form an enlarged crop frame.
And 307, cutting out the pie chart and the description frame according to the cutting frame when each description frame is positioned in the cutting frame.
As shown in fig. 8, the electronic device cuts out the pie chart and the description frame according to the cutting border 87, and the pie chart and the description frames are located in the cutting border 87.
Step 308, displaying the pie chart and the description box through the display component.
The electronic device displays the cut pie chart and the description frame through the display component, and the display effect is as shown in fig. 9. The display component can be a display card device or a display chip.
It should be noted that the electronic device may adjust the description frame to be away from the target direction by executing any one or two methods in step 303 to achieve the purposes of saving the display space and improving the utilization rate of the space.
In summary, the information display method provided in this embodiment generates a pie chart including n sector blocks and a description frame corresponding to each sector block according to n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the method achieves the effect of regularly arranging the positions of the description frames, minimizing the description frames positioned on one side of the target direction and saving the display space.
In the embodiment, the pie chart is rotated, so that the fan-shaped blocks of the pie chart on one side of the target direction are minimized, and the effect of saving the display space of the target direction is achieved.
In this embodiment, the connecting line between the description frame belonging to the target direction side and the pie chart is bent in the opposite direction to the target direction, so that the position of the description frame on the target direction side is adjusted in the opposite direction to the target direction, and the display space in the target direction is saved.
In the embodiment, the external rectangle of the pie chart is initialized to the cutting frame, and is expanded along with the cutting frame according to the description frame, and when each description frame is positioned in the cutting frame, the pie chart and the description frame are cut according to the cutting frame, so that the effect of saving the display space is achieved.
As a preferred embodiment, the pie chart may be adjusted before adding the description frame, so that the sector area of the pie chart on the side of the target direction is minimized, and then the description frame may be added and the description frame on the side of the target direction may be adjusted. An embodiment will be described below.
Referring to fig. 10, a flowchart of a method for displaying information according to another embodiment of the invention is shown. The method comprises the following steps:
step 1001, a pie chart is generated according to the proportion of each of the n items of data in the data sum, and each item of data corresponds to a sector block in the pie chart.
Before generating the pie chart, a rectangular plane coordinate system XOY shown in fig. 4 is first determined, in which the right half axis of the X axis is a positive half axis, the lower half axis of the Y axis is a positive half axis, and a concentric circle 41 and a concentric circle 42 are made with O as the center. It should be noted that, the plane rectangular coordinate system XOY may also be determined by taking the left half axis of the X axis as a positive half axis, and the upper half axis of the Y axis as a positive half axis, etc., and this embodiment is only described by taking the plane rectangular coordinate system XOY as the plane rectangular coordinate system shown in fig. 4, and does not limit the embodiment of the present invention.
The electronic equipment can sort the n items of data according to the proportion of each item of data in the total sum of the data and sequentially allocate a corresponding sector area to each item of data according to the sorting result. In order to ensure the display effect, it is reasonable that the data items are 2-4 items of data. Step 301 may include the following sub-steps:
the electronic equipment calculates the proportion of each item of data in the total sum of the data;
for example, if 4 items of data are included in total, where data a is 5, data B is 10, data C is 15, and data D is 20, the sum of the data is 50, and the ratio of data a is calculated to be 10%, the ratio of data B is 20%, the ratio of data C is 30%, and the ratio of data D is calculated to be 40%.
Secondly, the electronic equipment sorts the n items of data according to the proportion of each item of data in the total sum of the data;
the electronic device sorts the n items of data from small to large or from large to small according to the calculated proportion of each item of data in the total sum of data, and this embodiment exemplifies the sorting from small to large, and is not limited to this.
Thirdly, the electronic equipment calculates the central angle of the sector block corresponding to each item of data according to the proportion corresponding to each item of data;
for example, in 4 items of data in total, the proportion of the data a is 10%, the proportion of the data B is 20%, the proportion of the data C is 30%, and the proportion of the data D is 40%, which are obtained by calculation, the central angle of the sector block corresponding to the data a is 36 °, the central angle of the sector block corresponding to the data B is 72 °, the central angle of the sector block corresponding to the data C is 108 °, and the central angle of the sector block corresponding to the data D is 144 °
And fourthly, the electronic equipment divides the sector blocks according to the central angle obtained by calculation to generate a pie chart.
The electronic device divides the sector blocks in the order from small to large from the positive X-axis direction and clockwise according to the size of each item of data, and generates a pie chart as shown in fig. 5.
It should be noted that, in an actual implementation process, in order to ensure the sequentiality of the data, when the data cannot be sorted in some embodiments, the electronic device may respectively calculate the proportion of each item of data in the total sum of the data and allocate a corresponding sector area to each item of data according to the proportion, that is, step two may be omitted, and only substeps one, three, and four need to be performed.
Step 1002, adjusting the sector area of the pie chart at one side of the target direction to be the minimum.
The electronic equipment minimizes the sector area on one side of the target direction through rotation operation according to the preset target direction.
Note that the target direction may be any one of an up direction, a down direction, a left direction, and a right direction of the electronic apparatus. Since electronic devices are typically scrolling up and down, the target direction is illustrated as an up direction.
The term "one side of the target direction" refers to a space that divides the pie chart into two equal sides according to a straight line perpendicular to the target direction and belongs to one side of the target direction. If the target direction is the upper direction, the space belonging to one side of the upper direction is the 'target direction side' after dividing the pie chart into two equal sides according to a horizontal straight line.
The present embodiment is only illustrated with the target direction as the upper direction, and the present embodiment is not limited thereto, and the step 1002 may include the following sub-steps:
the method comprises the steps that firstly, the electronic equipment selects two sector blocks with the largest sum of central angles from every two adjacent sector blocks in a pie chart;
the electronic equipment obtains the central angle corresponding to each sector block in the pie chart, respectively calculates the sum of the central angles corresponding to two adjacent sector blocks, and selects the two sector blocks with the largest central angle sum.
It should be noted that the electronic device may also obtain two corresponding sector blocks by selecting two items of data with the largest sum of the proportions of two adjacent items of data, which is not limited in this embodiment.
And secondly, the electronic equipment rotates the pie chart to enable the two fan-shaped blocks to be positioned at one side of the target direction, and the central line determined according to the two fan-shaped blocks is superposed with the target direction.
As shown in fig. 7A, the pie chart 71 is divided into 4 sectors, and when the adjacent sectors 72 and 73 are two sectors having the largest sum of central angles among every two adjacent sectors, the central line determined from the sectors 72 and 73 coincides with the target direction by rotating the pie chart 71.
In addition, there is a possible case where, when the central angle of the largest sector in the pie chart is larger than the first angle, which may be 180 °, the electronic device may rotate the pie chart so that the largest sector is located on the side of the target direction and the center line of the largest sector coincides with the target direction, thereby minimizing the sectors on the side of the target direction.
As shown in fig. 7B, the central angle corresponding to the sector 74 is greater than 180 °, and the electronic device only needs to rotate the pie chart to locate the sector 74 at one side of the target direction, and the central line of the sector 74 coincides with the target direction, so that the sector located at one side of the target direction can be minimized.
In step 1003, a description box is generated for each sector.
In order to clearly and intuitively display the data attribute name of each item of data and the proportion of each item of data in the data sum, a description box is required to be added at the sector block corresponding to each item of data for adding description characters, wherein the description characters can be the data attribute name of each item of data, the proportion of each item of data in the data sum, and the like.
As one possible implementation, the electronic device may generate a description box for each sector based on the centerline of each sector. At this time, step 1003 may include the following sub-steps:
for any sector block, the electronic equipment detects whether an included angle between the central line of the sector block and the target direction is smaller than a third angle;
because there are two included angles between the center line of the sector block and the target direction, and the sum of the two included angles is 360 °, the included angle referred to in this embodiment refers to the smaller included angle of the two included angles.
Referring to fig. 11, an angle between a center line 1102 of a sector 1101 and the target direction is α 1, and a third angle is an angle between the target direction and the sideline 1103, and the electronic device determines a magnitude relationship between the angle α 1 and the third angle, where the third angle may be 45 °.
When the angle is not smaller than the third angle, the electronic equipment extends the center line of the sector block to a preset length outside the pie chart, and then adds a description frame at the tail end of the center line according to the data attribute name corresponding to the sector block;
referring to fig. 11, an included angle between a center line 1102 of the sector block 1101 and the target direction is α 1, and α 1 > 45 ° of the third angle, after the electronic device extends the center line 1102 of the sector block 1101 outside the pie chart by a predetermined length, a description box 1107 is added at the end of the center line 1103 according to the data attribute name corresponding to the sector block 1101.
And thirdly, when the angle is smaller than the third angle, after an edge line far away from the target direction in the third angle extends for a preset length outside the pie chart, adding a description frame at the tail end of the edge line according to the data attribute name corresponding to the sector block.
Referring to fig. 11, an angle between a center line 1106 of a sector 1105 and a target direction is α 2, α 2 < 45 ° and an edge line 1103 in the third angle far from the target direction is extended outside the pie chart by a predetermined length, and then a description box 1107 is added to the end of the edge line 1103 according to a data attribute name corresponding to the sector 1105, step 1004, when the description box is a description box generated based on the center line of the sector, determines the description box corresponding to the sector whose angle between the center line of the sector and the target direction is less than 90 ° as a description box belonging to one side of the target direction.
As shown in fig. 7C, the description box 75 and the description box 76 are description boxes of sector blocks, and the included angle between the center line of the corresponding sector block of the description box 75 and the description box 76 and the target direction is smaller than 90 °, that is, the description box 75 and the description box 76 may be determined as description boxes belonging to one side of the target direction.
Step 1005, bending a connecting line between the description frame and the pie chart which belong to one side of the target direction to the opposite direction of the target direction, wherein an included angle between the bent connecting line and the target direction is a second angle, and the second angle is larger than 90 degrees.
Taking the second angle as 120 ° as an example, as shown in fig. 7C, the description frame 75 and the description frame 76 belong to one side of the target direction, a connecting line between the description frame 75 and the pie chart is bent in the opposite direction of the target, and an included angle between the bent connecting line and the target direction is 120 °; similarly, it will be described that the line between the frame 76 and the pie chart is bent in the opposite direction to the target, and the angle between the bent line and the target direction is 120 °.
It should be noted that the second angle may be preset according to the size of the screen, and the embodiment is described by taking the second angle as 120 ° as an example, and is not limited to the embodiment of the present invention.
In the implementation process, the description frames may overlap with each other, so the positions of the description frames need to be adjusted. This step may include the following substeps:
firstly, the electronic equipment selects a description frame to obtain the position of the current description frame;
secondly, the electronic equipment acquires the positions of two adjacent description frames of the current description frame;
if the current description frame and one of the description frames are mutually covered and separated from the other description frame, the electronic equipment finely adjusts the preset angle of the current description frame to the direction of the separated description frame according to the circumferential path;
the electronic equipment judges whether the current description frame and the two adjacent description frames are mutually covered or not according to the position relation of the current description frame and the two adjacent description frames. When the current description frame and one of the description frames are mutually covered and separated from the other description frame, the electronic equipment finely adjusts the current description frame to the direction of the description frame separated from the current description frame by a preset angle according to the circumferential path.
And fourthly, repeating the substeps one to three until all the description frames are not covered.
Then, the electronic device may display the pie chart as follows:
step 1006, initialize the bounding rectangle of the pie chart to a clipping frame.
The electronic equipment acquires a circumscribed rectangle of the pie chart, four edges of the circumscribed rectangle are respectively tangent to the circumference of the pie chart, and the circumscribed rectangle is initialized into a cutting frame.
Referring to FIG. 8, the electronic device initializes the circumscribed rectangle 82 of the pie chart 81 to a cropped border.
Step 1007, determine whether each description box is located in the clipping border.
The electronic equipment acquires the vertical coordinates of the upper boundary and the lower boundary of the cutting frame and the horizontal coordinates of the left boundary and the right boundary. Then, the electronic equipment acquires the vertical coordinates of the upper boundary and the lower boundary of each description frame and the horizontal coordinates of the left boundary and the right boundary, and when the vertical coordinate of the upper boundary of each description frame is larger than the vertical coordinate of the upper boundary of the cutting frame, the vertical coordinate of the lower boundary of each description frame is smaller than the vertical coordinate of the lower boundary of the cutting frame, the vertical coordinate of the left boundary of each description frame is larger than the vertical coordinate of the left boundary of the cutting frame, and the vertical coordinate of the right boundary of each description frame is smaller than the vertical coordinates of the cutting frame and the boundary, the description frame is located in the cutting frame.
And step 1008, when the description frame is located outside the clipping frame, enlarging the clipping frame according to the description frame.
When the description box is not clipped in the frame, the electronic equipment enlarges the clipped frame according to the description box.
Step 1008 may include the following sub-steps:
the method comprises the steps that firstly, the electronic equipment obtains the minimum value of the vertical coordinate of the upper boundary and the horizontal coordinate of the left boundary of a description frame and a cutting frame, and the maximum value of the vertical coordinate of the lower boundary and the horizontal coordinate of the right boundary;
and secondly, expanding the cutting frame by the electronic equipment according to the minimum value of the upper boundary ordinate and the left boundary abscissa, and the maximum value of the lower boundary ordinate and the right boundary abscissa.
The electronic equipment determines the vertical coordinate of the upper boundary of the enlarged cutting frame according to the minimum value of the vertical coordinate of the upper boundary between the description frame and the cutting frame; the electronic equipment determines the left boundary abscissa of the enlarged clipping frame according to the minimum value of the left boundary abscissas of the description frame and the clipping frame; the electronic equipment determines the lower boundary ordinate of the enlarged clipping frame according to the maximum value of the lower boundary ordinate of the description frame and the clipping frame; and the electronic equipment determines the right boundary abscissa of the enlarged clipping frame according to the maximum value of the right boundary abscissas of the description frame and the clipping frame.
As shown in fig. 8, an enlarged cropping frame upper boundary 83 determined from the minimum value of the description frame and cropping frame upper boundary ordinate, an enlarged cropping frame left boundary 84 determined from the minimum value of the description frame and cropping frame left boundary abscissa, an enlarged cropping frame lower boundary 85 determined from the maximum value of the description frame and cropping frame lower boundary ordinate, and an enlarged cropping frame right boundary 86 determined from the maximum value of the description frame and cropping frame right boundary ordinate. The upper border 83, left border 84, lower border 85 and right border 86 form an enlarged crop frame.
And step 1009, cutting out the pie chart and the description frame according to the cutting frame when each description frame is positioned in the cutting frame.
As shown in fig. 8, the electronic device cuts out the pie chart and the description frame according to the cutting border 87, and the pie chart and the description frames are located in the cutting border 87.
Step 1010, displaying the pie chart and the description frame through the display component.
The electronic device displays the cut pie chart and the description frame through the display component, and the display effect is as shown in fig. 9. The display component can be a display card device or a display chip.
It should be noted that, the electronic device may achieve the purposes of saving the display space and improving the utilization rate of the space by executing step 1002 and/or step 1005, and this embodiment is described by executing step 1002 and step 1005 by the electronic device, and does not limit the embodiment of the present invention.
In summary, the information display method provided in this embodiment generates a pie chart including n sector blocks and a description frame corresponding to each sector block according to n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the method achieves the effect of regularly arranging the positions of the description frames, minimizing the description frames positioned on one side of the target direction and saving the display space.
In the embodiment, the pie chart is rotated, so that the fan-shaped blocks of the pie chart on one side of the target direction are minimized, and the effect of saving the display space of the target direction is achieved.
In this embodiment, whether the included angle between the central line of the sector block and the target direction is smaller than the second angle is detected, and when the included angle is smaller than the second angle, the position of the additional description frame is adjusted, so that the effect of saving the display space of the target direction is achieved.
In this embodiment, the connecting line between the description frame belonging to the target direction side and the pie chart is bent in the opposite direction to the target direction, so that the position of the description frame on the target direction side is adjusted in the opposite direction to the target direction, and the display space in the target direction is saved.
In the embodiment, the external rectangle of the pie chart is initialized to the cutting frame, and is expanded along with the cutting frame according to the description frame, and when each description frame is positioned in the cutting frame, the pie chart and the description frame are cut according to the cutting frame, so that the effect of saving the display space is achieved.
Referring to fig. 12, a block diagram of an information display device according to an embodiment of the present invention is shown. The information display device may be implemented as all or a part of an electronic apparatus having image processing and display functions by software, hardware, or a combination of both. The device includes:
a generating module 1202, configured to generate a pie chart including n sector blocks and a description frame corresponding to each sector block according to the n items of data;
a description frame adjusting module 1204, configured to adjust the description frame away from the target direction;
a display module 1206 for displaying the pie chart and the description frame through a display component.
In summary, the information display device provided in this embodiment generates a pie chart including n sector blocks and a description frame corresponding to each sector block according to n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the effect of regularly arranging the positions of the description frames is achieved, and therefore the display space is saved.
Referring to fig. 13, a block diagram of an information display device according to another embodiment of the invention is shown. The information display device may be implemented as all or a part of an electronic apparatus having image processing and display functions by software, hardware, or a combination of both. The device includes:
a generating module 1202, configured to generate a pie chart including n sector blocks and a description frame corresponding to each sector block according to the n items of data;
a description frame adjusting module 1204, configured to adjust the description frame away from the target direction;
a display module 1206 for displaying the pie chart and the description frame through a display component.
Optionally, the description box adjusting module 1204 includes:
a first adjusting unit 1204A, configured to adjust a sector area of the pie chart on one side of the target direction to be the smallest;
and/or the presence of a gas in the gas,
a second adjusting unit 1204B, configured to adjust a description box belonging to the side of the target direction to be away from the target direction.
Optionally, the first adjusting unit 1204A includes:
a first rotating subunit 1204Aa, configured to, when a central angle of a largest sector block in the pie chart is greater than a first angle, rotate the pie chart so that the largest sector block is located on one side of the target direction and a center line of the largest sector block coincides with the target direction;
or the like, or, alternatively,
a second rotation subunit 1204Ab, configured to select, from every two adjacent sector blocks in the pie chart, two sector blocks with a largest sum of central angles; and rotating the pie chart to enable the two fan-shaped blocks to be positioned at one side of the target direction, and enabling the central line determined according to the two fan-shaped blocks to be coincident with the target direction.
Optionally, the second adjusting unit 1204B includes:
a description frame determination subunit 1204Ba, configured to determine, as a description frame belonging to one side of the target direction, a description frame corresponding to a sector whose included angle between the center line of the sector and the target direction is smaller than 90 °, when the description frame is a description frame generated based on the center line of the sector;
a line bending subunit 1204Bb, configured to bend a line between the description frame and the pie chart, which belongs to one side of the target direction, in a direction opposite to the target direction, where an included angle between the bent line and the target direction is a second angle, and the second angle is greater than 90 °.
Optionally, the generating module 1202 includes:
a pie chart generating unit 1202A, configured to generate the pie chart according to a ratio of each of the n items of data in a data sum, where each item of data corresponds to one sector block in the pie chart;
a description frame adding unit 1202B for generating the description frame for each sector according to the center line of each sector.
Optionally, the pie chart generating unit 1202A includes:
a first generating subunit 1202Aa, configured to sort the n items of data according to the size of the proportion of each item of data in the data sum; and sequentially distributing corresponding sector areas for each item of data according to the sequencing result.
Or the like, or, alternatively,
a second generation subunit 1202Ab for calculating the proportion of each item of data in the total sum of data, respectively; and distributing corresponding sector areas for each item of data according to the proportion.
Alternatively, the description frame adding unit 1202B includes:
an included angle detecting subunit 1202Ba, configured to detect, for any sector block, whether an included angle between a center line of the sector block and the target direction is smaller than a third angle;
a first adding subunit 1202Bb, configured to, when the angle is not smaller than the third angle, extend the center line of the sector block by a predetermined length outside the pie chart, and then add the description frame at the end of the center line according to the data attribute name corresponding to the sector block.
Optionally, the description frame adding unit 1202B further includes:
a second adding subunit 1202Bc, configured to, when the angle is smaller than the third angle, extend, by a predetermined length, an edge of the third angle that is far from the target direction outside the pie chart, and then add the description frame at the end of the edge according to the data attribute name corresponding to the sector block.
Optionally, the apparatus further comprises:
a frame initializing module 1207, configured to initialize a rectangle frame circumscribing the pie chart to a clipping frame;
a description box determining module 1208, configured to determine whether each description box is located in the clipping border;
a frame enlarging module 1209, configured to enlarge the clipping frame according to the description frame when the description frame is located outside the clipping frame;
and a cutting module 1210, configured to cut out the pie chart and the description frame according to the cutting border when each description frame is located in the cutting border.
In summary, the information display device provided in this embodiment generates a pie chart including n sector blocks and a description frame corresponding to each sector block according to n items of data; adjusting the description frame to be far away from the target direction; displaying a pie chart and a description frame through a display component; the problem that the display space of a mobile phone screen is limited, and when the distribution of a description frame is scattered and random, the display space can be wasted or the display cannot be fully displayed is solved; the effect of regularly arranging the positions of the description frames is achieved, and therefore the display space is saved.
In the embodiment, the pie chart is rotated, so that the fan-shaped blocks of the pie chart on one side of the target direction are minimized, and the effect of saving the display space of the target direction is achieved.
In this embodiment, whether the included angle between the central line of the sector block and the target direction is smaller than the second angle is detected, and when the included angle is smaller than the second angle, the position of the additional description frame is adjusted, so that the effect of saving the display space of the target direction is achieved.
In this embodiment, the connecting line between the description frame belonging to the target direction side and the pie chart is bent in the opposite direction to the target direction, so that the position of the description frame on the target direction side is adjusted in the opposite direction to the target direction, and the display space in the target direction is saved.
In the embodiment, the external rectangle of the pie chart is initialized to the cutting frame, and is expanded along with the cutting frame according to the description frame, and when each description frame is positioned in the cutting frame, the pie chart and the description frame are cut according to the cutting frame, so that the effect of saving the display space is achieved.
It should be noted that: in the information display provided in the above embodiment, only the division of the functional modules is illustrated when displaying information, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. In addition, the information display device and the information display method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
Referring to fig. 14, a schematic structural diagram of an electronic device according to an embodiment of the invention is shown. The electronic device is used for implementing the information display method provided in the above embodiment. Specifically, the method comprises the following steps:
the electronic device 1400 may include RF (Radio Frequency) circuitry 1410, memory 1420 including one or more computer-readable storage media, input unit 1430, display unit 1440, sensor 1450, audio circuitry 1460, WiFi (wireless fidelity) module 1470, processor 1480 including one or more processing cores, and power supply 1490. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 14 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 1410 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink information from a base station and then processing the received downlink information by the one or more processors 1480; in addition, data relating to uplink is transmitted to the base station. In general, RF circuitry 1410 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 1410 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
The memory 1420 may be used to store software programs and modules, and the processor 1480 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device 1400, and the like. Further, memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1420 may also include a memory controller to provide the processor 1480 and the input unit 1430 access to the memory 1420.
The input unit 1430 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 1430 may include an image input device 1431 and other input devices 1432. The image input device 1431 may be a camera or may be a photo scanning device. The input unit 1430 may include other input devices 1432 in addition to the image input device 1431. In particular, other input devices 1432 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1440 may be used to display information input by or provided to a user as well as various graphical user interfaces of the electronic device 1400, which may be made up of graphics, text, icons, video, and any combination thereof. The display unit 1440 may include a display panel 1441, and optionally, the display panel 1441 may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), or the like.
The electronic device 1400 may also include at least one sensor 1450, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1441 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1441 and/or the backlight when the electronic device 1400 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured on the electronic device 1400, detailed descriptions thereof are omitted.
The audio circuit 1460, speaker 1461, microphone 1462 may provide an audio interface between a user and the electronic device 1400. The audio circuit 1460 can transmit the received electrical signal converted from the audio data to the loudspeaker 1461, and the electrical signal is converted into a sound signal by the loudspeaker 1461 and output; on the other hand, the microphone 1462 converts collected sound signals into electrical signals, which are received by the audio circuit 1460 and converted into audio data, which are then processed by the audio data output processor 1480, either by the RF circuit 1410 for transmission to another electronic device, for example, or by outputting the audio data to the memory 1420 for further processing. The audio circuit 1460 may also include an earbud jack to provide communication of peripheral headphones with the electronic device 1400.
WiFi belongs to short-distance wireless transmission technology, and the electronic equipment 1400 can help a user to send and receive e-mails, browse webpages, access streaming media and the like through a WiFi module 1470, and provides wireless broadband Internet access for the user. Although fig. 14 shows the WiFi module 1470, it is understood that it does not belong to the essential constitution of the electronic device 1400, and may be omitted entirely within the scope not changing the essence of the invention as needed.
The processor 1480, which is the control center of the electronic device 1400, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device 1400 and processes data by operating or executing software programs and/or modules stored in the memory 1420 and calling data stored in the memory 1420, thereby integrally monitoring the cellular phone. Optionally, the processor 1480 may include one or more processing cores; preferably, the processor 1480 may integrate an application processor, which handles primarily operating systems, user interfaces, and applications, among others, with a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1480.
The electronic device 1400 also includes a power supply 1490 (e.g., a battery) that powers the various components and is preferably logically coupled to the processor 1480 via a power management system that manages charging, discharging, and power consumption management functions. The power supply 1490 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 1400 may further include a bluetooth module or the like, which is not described herein.
In particular, in this embodiment, the electronic device 1400 further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for performing the information display methods provided by embodiments of the present invention.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (12)

1. An information display method, characterized in that the method comprises:
generating a pie chart containing n sector blocks according to the n items of data;
adjusting the sector blocks of the pie chart on one side of the target direction to be minimum;
for any sector block, detecting whether an included angle between the central line of the sector block and the target direction is smaller than a third angle, wherein the third angle is an included angle formed by the target direction and a side line, and the third angle is 45 degrees; when the angle is not smaller than the third angle, after the center line of the sector block extends to the outside of the pie chart for a preset length, adding a description frame at the tail end of the center line according to the data attribute name corresponding to the sector block; when the angle is smaller than the third angle, after the sideline extends to a preset length outside the pie chart, adding a description frame at the tail end of the sideline according to the data attribute name corresponding to the sector block;
determining a description frame corresponding to a sector block with an included angle smaller than 90 degrees between the central line of the sector block and the target direction as the description frame belonging to one side of the target direction; bending a connecting line between the description frame and the pie chart, which belongs to one side of the target direction, to the direction opposite to the target direction, wherein an included angle between the bent connecting line and the target direction is a second angle, and the second angle is larger than 90 degrees;
selecting a description frame, acquiring the position of the current description frame, and acquiring the positions of two adjacent description frames of the current description frame; if the current description frame and one of the two description frames are mutually covered and separated from the other description frame, adjusting the current description frame to a predetermined angle towards the description frame separated from the current description frame according to a circumferential path; returning to the step of selecting one description frame until all the description frames are not covered by each other;
and displaying the pie chart and the description frame through a display component.
2. The method of claim 1, wherein generating a pie chart comprising n sectored blocks from n items of data comprises:
and generating the pie chart according to the proportion of each of the n items of data in the data sum, wherein each item of data corresponds to one sector block in the pie chart.
3. The method of claim 2, wherein the generating the pie chart according to the ratio of each of the n items of data in the data sum comprises:
sorting the n items of data according to the proportion of each item of data in the total sum of the data; sequentially distributing corresponding sector areas for each item of data according to the sequencing result;
or the like, or, alternatively,
respectively calculating the proportion of each item of data in the total sum of the data; and distributing corresponding sector areas for each item of data according to the proportion.
4. The method according to any one of claims 1-3, wherein said adjusting the pie chart to minimize the sector on the target direction side comprises:
when the central angle of the largest sector block in the pie chart is larger than a first angle, rotating the pie chart to enable the largest sector block to be located on one side of the target direction, wherein the central line of the largest sector block is coincident with the target direction;
or the like, or, alternatively,
selecting two sector blocks with the largest sum of central angles from every two adjacent sector blocks in the pie chart; and rotating the pie chart to enable the two fan-shaped blocks to be positioned at one side of the target direction, and enabling the central line determined according to the two fan-shaped blocks to be coincident with the target direction.
5. The method of claim 1, wherein prior to displaying the pie chart and the description box via a display component, further comprising:
initializing a circumscribed rectangle frame of the pie chart into a cutting frame;
judging whether each description frame is positioned in the clipping frame;
when the description frame is positioned outside the clipping border, the clipping border is enlarged according to the description frame;
and when each description frame is positioned in the cutting border, cutting out the pie chart and the description frame according to the cutting border.
6. An information display apparatus, characterized in that the apparatus comprises:
the generating module is used for generating a pie chart containing n sector blocks according to the n items of data;
a description frame adjusting module for adjusting the sector block of the pie chart at one side of the target direction to be minimum;
the generating module is further configured to detect, for any sector block, whether an included angle between a center line of the sector block and the target direction is smaller than a third angle, where the third angle is an included angle formed by the target direction and one side line, and the third angle is 45 degrees; when the angle is not smaller than the third angle, after the center line of the sector block extends to the outside of the pie chart for a preset length, adding a description frame at the tail end of the center line according to the data attribute name corresponding to the sector block; when the angle is smaller than the third angle, after the sideline extends to a preset length outside the pie chart, adding a description frame at the tail end of the sideline according to the data attribute name corresponding to the sector block;
the description frame adjusting module is further configured to determine, as the description frame belonging to one side of the target direction, a description frame corresponding to a sector block of which an included angle between a center line of the sector block and the target direction is smaller than 90 °; bending a connecting line between the description frame and the pie chart, which belongs to one side of the target direction, to the direction opposite to the target direction, wherein an included angle between the bent connecting line and the target direction is a second angle, and the second angle is larger than 90 degrees;
the display module is used for displaying the pie chart and the description frame through a display component;
wherein the apparatus is further configured to:
selecting a description frame, acquiring the position of the current description frame, and acquiring the positions of two adjacent description frames of the current description frame; if the current description frame and one of the two description frames are mutually covered and separated from the other description frame, adjusting the current description frame to a predetermined angle towards the description frame separated from the current description frame according to a circumferential path; and returning to the step of selecting one description frame until all the description frames are not covered by each other.
7. The apparatus of claim 6, wherein the generating module comprises:
and the pie chart generating unit is used for generating the pie chart according to the proportion of each of the n items of data in the data sum, and each item of data corresponds to one sector block in the pie chart.
8. The apparatus of claim 7, wherein the pie chart generation unit comprises:
the first generation subunit is used for sorting the n items of data according to the proportion of each item of data in the data sum; sequentially distributing corresponding sector areas for each item of data according to the sequencing result;
or the like, or, alternatively,
the second generation subunit is used for respectively calculating the proportion of each item of data in the data sum; and distributing corresponding sector areas for each item of data according to the proportion.
9. The apparatus of any of claims 6-8, wherein the description box adjustment module is configured to:
when the central angle of the largest sector block in the pie chart is larger than a first angle, rotating the pie chart to enable the largest sector block to be located on one side of the target direction, wherein the central line of the largest sector block is coincident with the target direction;
or the like, or, alternatively,
selecting two sector blocks with the largest sum of central angles from every two adjacent sector blocks in the pie chart; and rotating the pie chart to enable the two fan-shaped blocks to be positioned at one side of the target direction, and enabling the central line determined according to the two fan-shaped blocks to be coincident with the target direction.
10. The apparatus of claim 6, further comprising:
the frame initialization module is used for initializing a circumscribed rectangle frame of the pie chart into a cutting frame;
the description frame judging module is used for judging whether each description frame is positioned in the clipping frame;
the frame expanding module is used for expanding the cutting frame according to the description frame when the description frame is positioned outside the cutting frame;
and the cutting module is used for cutting out the pie chart and the description frame according to the cutting frame when each description frame is positioned in the cutting frame.
11. An electronic device, characterized in that the electronic device comprises:
an information display device according to any one of claims 6 to 10.
12. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the information display method according to any one of claims 1 to 5.
CN201410444603.0A 2014-09-03 2014-09-03 Information display method and device and electronic equipment Active CN105426368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410444603.0A CN105426368B (en) 2014-09-03 2014-09-03 Information display method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410444603.0A CN105426368B (en) 2014-09-03 2014-09-03 Information display method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN105426368A CN105426368A (en) 2016-03-23
CN105426368B true CN105426368B (en) 2020-07-07

Family

ID=55504581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410444603.0A Active CN105426368B (en) 2014-09-03 2014-09-03 Information display method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN105426368B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108512989B (en) * 2017-02-28 2021-08-24 腾讯科技(深圳)有限公司 Message prompting method and device
CN110378248B (en) * 2019-06-25 2023-07-21 平安科技(深圳)有限公司 Pie chart identification method, device, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763743A (en) * 2004-10-18 2006-04-26 微软公司 System and method for automatic label placement on charts
CN102428427A (en) * 2009-04-02 2012-04-25 美尔默公司 Displaying pie charts in a limited display area
CN102455860A (en) * 2010-11-03 2012-05-16 深圳市金蝶友商电子商务服务有限公司 Terminal pie chart rotation interactive display method and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7961188B2 (en) * 2005-12-05 2011-06-14 Microsoft Corporation Persistent formatting for interactive charts

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763743A (en) * 2004-10-18 2006-04-26 微软公司 System and method for automatic label placement on charts
CN102428427A (en) * 2009-04-02 2012-04-25 美尔默公司 Displaying pie charts in a limited display area
CN102455860A (en) * 2010-11-03 2012-05-16 深圳市金蝶友商电子商务服务有限公司 Terminal pie chart rotation interactive display method and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
掌握图表使用妙招;启典文化;《Excel公式、函数、图表数据分析高手真经》;20140331;第276-281页 *

Also Published As

Publication number Publication date
CN105426368A (en) 2016-03-23

Similar Documents

Publication Publication Date Title
US10817165B2 (en) Folder management method and device
CN105786878B (en) Display method and device of browsing object
US11579946B2 (en) Method for managing multiple operating systems in a terminal
CN106708538B (en) Interface display method and device
CN105872666B (en) Mode switching method and device
CN108205398B (en) Method and device for adapting webpage animation to screen
CN104915091B (en) A kind of method and apparatus for the prompt information that Shows Status Bar
CN104133624B (en) Web animation display packing, device and terminal
CN105989572B (en) Picture processing method and device
CN109271014A (en) A kind of method and apparatus adjusting screen intensity
CN109726368B (en) Map marking method and device
US20170046040A1 (en) Terminal device and screen content enlarging method
WO2020007116A1 (en) Split-screen window adjustment method and apparatus, storage medium and electronic device
CN104881844A (en) Picture combination method and device and terminal equipment
AU2018273505A1 (en) Method for capturing fingerprint and associated products
US20150089431A1 (en) Method and terminal for displaying virtual keyboard and storage medium
CN109067981A (en) Split screen application switching method, device, storage medium and electronic equipment
WO2015010570A1 (en) A method, device, and terminal for hiding or un-hiding content
CN109891388A (en) A kind of image processing method and device
WO2014166266A1 (en) File scanning method and system, client and server
CN105245432B (en) Unread message counting method and device and terminal
CN108564539B (en) Method and device for displaying image
CN105700801B (en) Interface intercepting method and equipment
CN104238931B (en) Information input method and device and electronic equipment
CN105426368B (en) Information display method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant