Weight bubble graph generation method and device, storage medium and electronic equipment
By generating a weight bubble chart, the final display radius and center coordinates of the bubble are calculated using the weighted value and the display space of the display interface, the problem of the difference in weight data cannot be displayed in multiple dimensions in the existing technology, and the multi-dimensional display and the weight data are realized Real-time update.
Patent Information
- Application Number
- CN202411138574.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-26
AI Technical Summary
The existing bubble chart can only represent one dimension of the data point through the size of the bubble, and cannot effectively display the differences between weighted data in multiple dimensions, and cannot meet the weighted expression requirements of complex data.
By obtaining the data value and weight value of the weight data, generating weight values, calculating the final display radius, optimizing the center coordinates of the bubbles to minimize the overlap area, generating a weight bubble chart, displaying multi-dimensional information of the weight data, and supporting user interaction.
It realizes multi-dimensional display of weight data, meets users' expression needs for weight data, can quickly respond to data changes, and realizes real-time updates and dynamic display of weight bubbles.
Smart Images

Figure CN119027535A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular relates to a method, device, storage medium and electronic device for generating a weighted bubble chart. Background Art
[0002] As a data visualization tool, bubble charts have been widely used to display multidimensional data sets. They use the size, color, and position of bubbles to represent the three-dimensional attributes of data points. Although bubble charts are intuitive in data display, they can only express one dimension of a data point through the size of bubbles, and cannot show the weight differences between weighted data in multiple dimensions, and cannot meet the weight expression requirements of complex data. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a method, device, storage medium and electronic device for generating a weight bubble chart, which can realize multi-dimensional display of the difference between weight data.
[0004] In a first aspect, the present application provides a method for generating a weighted bubble chart, the method comprising:
[0005] Obtaining data values and weight values of weight data for which a weight bubble chart is to be generated, and generating weighted values corresponding to each weight data according to the data values and weight values of each weight data;
[0006] Obtaining a final display radius of a weight bubble corresponding to each weight data according to a weighted value corresponding to each weight data and an available display space of a display interface displaying the weight bubble graph;
[0007] Calculating the overlapping areas between the weight bubbles corresponding to the weight data according to the final display radii, and calculating the center coordinates of the circles corresponding to the weight bubbles when the overlapping areas are minimum;
[0008] A weight bubble of each weight data is displayed at each circle center coordinate of the display interface with the final display radius to generate a weight bubble chart.
[0009] According to the method for generating a weight bubble chart of the present application, the final display radius of each weight bubble is obtained by utilizing the weight value and the display space of the display interface, and then the overlapping area of each weight bubble in the display interface is calculated according to the final display radius, and the center coordinates of each weight bubble are obtained by minimizing the overlapping area, thereby generating a weight bubble chart in the display interface. The size of the bubble chart includes the data value and weight value of the weight data, so that the multi-dimensional data of the weight data can be displayed through the size of the weight bubble, which can better display the differences between the weight data and meet the user's expression needs for the weight data. In addition, the method can quickly respond to data changes and realize real-time updating and dynamic display of weight bubbles.
[0010] According to an embodiment of the present application, obtaining the final display radius of the weight bubble corresponding to each weight data according to the weighted value corresponding to each weight data and the available display space of the display interface displaying the weight bubble chart includes:
[0011] Acquire a width value and a height value of the display interface, and calculate a display area A of the display space according to the width value and the height value;
[0012] Obtain the number n of data of the weight data;
[0013] The ratio A / n of the display area A and the number of data n is used as the reference area of each weighted bubble;
[0014] Calculating an initial display radius of each weighted data using the reference area and the weighted value;
[0015] The initial display radius is adjusted using the scaling factor of the display space to obtain the final display radius.
[0016] By calculating the display radius of each weight bubble through the weighted value of each weight data and the display area of the display interface, the weight bubble can be displayed in the display interface in a more optimal size.
[0017] According to an embodiment of the present application, the scaling factor is determined by the size of the initial display radius and the maximum radius, wherein the maximum radius is determined by the smaller value of the width value w and the height value h.
[0018] According to an embodiment of the present application, the maximum radius is w / 2 or h / 2; the scaling factor is determined by the size of the initial display radius and the maximum radius, including:
[0019] When it is determined that the initial display radius is less than or equal to the maximum radius, determining the scaling factor to be 1;
[0020] When it is determined that there is a target initial display radius greater than the maximum radius in the initial display radii, the maximum initial display radius is determined from the target initial display radii, and the ratio of the maximum radius to the maximum initial display radius is used as the scaling factor.
[0021] By limiting the presentation size of the weight bubble by the size of the display interface, the best presentation of the weight bubble can be achieved, and the calculation method of the scaling factor of the radius of the weight bubble alone is convenient and easy to implement.
[0022] According to an embodiment of the present application, the step of calculating the initial display radius of each weight data by using the reference area and the weight value includes:
[0023] Determining a maximum weighted value from among the weighted values;
[0024] Calculating the ratio of each weighted value to the maximum weighted value to obtain a weighting factor of each weight data;
[0025] The initial display radius of each weighted data is calculated using the reference area and the weighting factor.
[0026] The ratio of each weighted value to the maximum weighted value is used as a weighting factor, and then the weighting factor is used to calculate the initial display radius of the weight bubble. This can reduce the calculation procedure of the radius of the weight bubble to a certain extent and improve the generation efficiency of the weight bubble.
[0027] According to an embodiment of the present application, displaying weight bubbles of each weight data at the center coordinates of each circle on the display interface with the final display radius to generate a weight bubble chart includes:
[0028] Determine the display level of the weight bubble corresponding to each weight data according to each weight value;
[0029] Each of the weight bubbles is displayed in the display interface according to the display level.
[0030] By further increasing the display dimensions of the weight bubbles through the display level, the multi-dimensional display of the weight data can be further realized.
[0031] According to one embodiment of the present application, after generating the weight bubble chart, the method further includes:
[0032] In response to an interactive operation of a user, displaying the weight bubble in the display interface according to the interactive operation;
[0033] The interactive operations include dragging, adding, viewing, filtering, and filling operations.
[0034] Through user interaction, the interactivity of the weight bubble chart is enhanced to support more complex user interaction operations, allowing users to explore and analyze data more deeply.
[0035] In a second aspect, the present application provides a device for generating a weighted bubble chart, the device comprising:
[0036] A weighted value generating module, used for obtaining data values and weight values of weight data for generating a weight bubble chart, and generating weight values corresponding to each weight data according to the data values and weight values of each weight data;
[0037] A display radius acquisition module, used to obtain the final display radius of the weight bubble corresponding to each weight data according to the weight value corresponding to each weight data and the available display space of the display interface displaying the weight bubble chart;
[0038] A circle center coordinate calculation module, which calculates the overlapping area between the weight bubbles corresponding to the weight data according to the final display radius, and calculates the circle center coordinates corresponding to the weight bubbles when the overlapping area is minimum;
[0039] The bubble chart generating module is used to display the weight bubbles of each weight data at the center coordinates of each circle on the display interface with the final display radius to generate a weight bubble chart.
[0040] According to the device for generating a weight bubble chart of the present application, the final display radius of each weight bubble is obtained by utilizing the weight value and the display space of the display interface, and then the overlapping area of each weight bubble in the display interface is calculated according to the final display radius, and the center coordinates of each weight bubble are obtained by minimizing the overlapping area, thereby generating a weight bubble chart in the display interface. The size of the bubble chart includes the data value and weight value of the weight data, so that the multi-dimensional data of the weight data can be displayed through the size of the weight bubble, which can better display the differences between the weight data and meet the user's expression needs for the weight data, and the method can also quickly respond to data changes to achieve real-time updating and dynamic display of weight bubbles.
[0041] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a weight bubble chart as described in the first aspect above is implemented.
[0042] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a weight bubble chart as described in the first aspect above is implemented.
[0043] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method for generating a weight bubble chart as described in the first aspect.
[0044] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for generating a weight bubble chart as described in the first aspect above.
[0045] The above one or more technical solutions in the embodiments of the present application have at least the following technical effects:
[0046] The weighted value of each weight data is generated by the data value and weight value of the weight data, and the final display radius of each weight bubble is obtained by using the weight value and the display space of the display interface. Then, the overlapping area of each weight bubble in the display interface is calculated according to the final display radius, and the center coordinates of each weight bubble are obtained by minimizing the overlapping area, thereby generating a weight bubble chart in the display interface. The size of the bubble chart includes the data value and weight value of the weight data, so that the multi-dimensional data of the weight data can be displayed through the size of the weight bubble, which can better display the differences between the weight data and meet the user's expression needs for the weight data. In addition, this method can quickly respond to data changes and realize real-time updating and dynamic display of weight bubbles. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0048] Figure 1 It is a schematic diagram of the flow of a method for generating a weighted bubble chart provided in an embodiment of the present application;
[0049] Figure 2 is a schematic diagram of the structure of two circles intersecting provided in an embodiment of the present application;
[0050] Figure 3 This is one of the interface schematic diagrams of the generated weight bubble chart provided in the embodiment of the present application;
[0051] Figure 4 It is a structural schematic diagram of a device for generating a weighted bubble chart provided in an embodiment of the present application;
[0052] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0054] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0055] In combination with the accompanying drawings, the weight bubble chart generation method, weight bubble chart generation device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0056] Among them, the method for generating a weight bubble chart can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.
[0057] The method for generating a weighted bubble chart provided in an embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the method for generating a weighted bubble chart. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The method for generating a weighted bubble chart provided in an embodiment of the present application is described below using an electronic device as an example of an execution subject.
[0058] like Figure 1 As shown, the method for generating the weight bubble chart includes:
[0059] Step S100, obtaining data values and weight values of weight data for generating a weight bubble chart, and generating weighted values corresponding to each weight data according to the data values and weight values of each weight data.
[0060] It is understandable that before obtaining the data value and weight value of the weight data, a data interface for obtaining the weight data can be provided first. It may include the following: interface definition, setting the API (Application Programming Interface) port for obtaining weight data; parameter definition, determining the query parameters required by the interface, such as sorting, weight value range, bubble type, etc.; return format definition, usually positioning data return format as a JSON object array; data source connection, realizing the logical connection with the data source, which may be a connection to a database or other data storage; query construction, constructing a query statement based on the passed-in parameters to retrieve the required data from the data source; data screening, filtering out the bubble point data to be displayed based on the calculation of the weight value and the data value.
[0061] When obtaining the data value and weight value of the weight data, it can specifically include: taking the data table containing the weight data as input, analyzing the data table, obtaining a data column containing the data value and the weight value, and generating a new table with the data value column and the weight value column, thereby deleting the noise data and avoiding the influence of the noise data. The new table is shown in Table 1 below, which also includes the bubble radius, the bubble center coordinates and the bubble initial style, which are filled in after confirmation in the subsequent process for the user to consult.
[0062] Table 1
[0063] Bubble Name Data Value Weight value Bubble Radius Bubble center coordinates Bubble initial style bubble1 100 1 bubble2 100 2
[0064] When generating the weighted value corresponding to each weighted data according to the data value and the weight value of each weighted data, it may include: taking the product of the data value and the weight value of each weighted data as the weighted value of each weighted data. Thus, the weight value and the data value of the weighted data can be expressed by the weighted value parameter.
[0065] The following is an explanation in conjunction with a specific embodiment. For example: given the data value D = [1, 2, 4, 8, 10] and the weight value W = [4, 2, 1, 1, 1] of the weighted data, the weighted values Weight Value of each weight data are calculated as: Weight Value1 = 1x 4 = 4, Weight Value2 = 2x 2 = 4, Weight Value3 = 4x 1 = 4, Weight Value4 = 8x 1 = 8, Weight Value5 = 10x 1 = 10.
[0066] Step S200, obtaining a final display radius of a weight bubble corresponding to each weight data according to a weighted value corresponding to each weight data and an available display space of a display interface for displaying the weight bubble chart.
[0067] Specifically, step S200 includes: obtaining the width value w and height value h of the display interface, and calculating the display area A = w * h of the display space according to the width value and height value. Obtaining the number of data n of the weight data. Assuming that each weight data evenly divides the display area, the reference area corresponding to each weight data is A / n, that is, the ratio A / n of the display area A and the number of data n is used as the reference area of each weight bubble. Calculating the initial display radius of each weight data Weight Value i using the reference area A / n and the weighting value. Adjusting the initial display radius using the scaling factor of the display space to obtain the final display radius.
[0068] In some embodiments, the initial display radius of each weight bubble In this way, the size of each weight bubble can be determined by the weighting value of its corresponding weight data, so that the data value and weight value of the weight data can be reflected by the size of the bubble.
[0069] However, the radius of the weight bubble calculated in this way may exceed the display interface. Therefore, it is necessary to adjust it according to the area size of the display interface to ensure that each weight bubble is within the display interface.
[0070] In some embodiments, the initial display radius is adjusted using the scaling factor k of the display space to obtain the final display radius ri.
[0071] In some embodiments, the scaling factor is determined by the size of the initial display radius and the maximum radius, where the maximum radius is determined by the smaller value of the width value w and the height value h.
[0072] Furthermore, when it is determined that the initial display radius is less than or equal to the maximum radius, the scaling factor is determined to be 1; when it is determined that the initial display radius is less than the maximum radius, the scaling factor is determined to be the ratio of the maximum radius to the initial display radius. Wherein, the maximum radius Rmax is w / 2 or h / 2.
[0073] It can be understood that if all the weight bubbles are to be displayed in the display interface, its diameter cannot exceed the smaller value of the width value w and the height value h of the display interface, that is, the maximum bubble radius that the display interface can withstand is w / 2 or h / 2. That is, when w > h, Rmax = h / 2, and when w < h, Rmax = w / 2.
[0074] During actual execution, it is determined whether the initial display radius is less than or equal to the maximum radius. If the initial display radius is less than or equal to the maximum radius, the scaling factor is determined to be 1, that is, all weight bubbles can be fully displayed in the display interface, so there is no need to scale; if there is a target initial display radius greater than the maximum radius in the initial display radius, the maximum initial display radius R is determined from the target initial display radius, and the ratio of the maximum radius to the maximum initial display radius is used as the scaling factor k=Rmax / R, that is, if there are weight bubbles exceeding the display interface, the scaling factor can make the radius of the largest weight bubble the same as the maximum radius, so that all weight bubbles can be placed in the display interface.
[0075] In some embodiments, the initial display radius of each weighted data is calculated using the reference area and the weighted value, including: determining a maximum weighted value MAX Weight Value from each weighted value. Calculating the ratio of each weighted value to the maximum weighted value to obtain a weighting factor Weight Value i / MAXWeight Value of each weighted data. The square root of the product of the reference area and each weighting factor is used as the initial display radius of each weighted data.
[0076] In addition to the above method of directly using the weighted value of each weighted data and the reference area to obtain the initial display radius of each weighted data, the initial display radius of each weighted data can also be calculated using the weighting factor and the reference area. Specifically, the square root of the product of the reference area and each weighting factor is used as the initial display radius of each weighted data, that is, It can be understood that the weighting factor is similar to the normalized weighted value, that is, the weighting factor is a value less than or equal to 1. The weight bubbles corresponding to the initial display radius obtained based on this will basically not exceed the display interface, thereby saving most of the scaling factor calculations and the steps of scaling using the scaling factor, saving calculations.
[0077] Of course, in this process, there are extreme cases, such as when there is only one or a small amount of weight data, the initial display radius may still be larger than the maximum radius, so it is still necessary to use the scaling factor to scale it.
[0078] Step S300, calculating the overlapping areas between the weight bubbles corresponding to the weight data according to the final display radii, and calculating the center coordinates of the circles corresponding to the weight bubbles when the overlapping areas are minimum.
[0079] Combination Figure 2If the two circles intersect, find the area of the intersection of the two circles (i.e. the area of the shaded part), which can be obtained by the sum of the difference between sector BCD and triangle BCD and the difference between sector ACD and triangle ACD, i.e. A 相交 = sector BCD-ΔBCD+sector ACD-ΔACD=sector ACD+sector BCD-2ΔABC. Further, in ΔABC, Similarly, S ΔABC=1 / 2 sinθ*d*ri. Sector Similarly, fan-shaped In summary, A 相交 =θ*ri 2 +β*rj 2 -sinθ*d*ri, where In the area formula of the intersection of two circles, ri and rj have been determined in the above process, d is related to the center coordinates of the two circles, and the angles θ and β are also related to the center coordinates of the two circles. Since the drawn bubbles cannot exceed the boundary of the display interface, there are constraints on the center coordinates w / 2-ri≤xi≤w-ri, h / 2-ri≤yi≤h-ri. When the center coordinates of one of the circles are known, the annealing algorithm can be used to calculate the center coordinates of the other circle when the intersection area of the two circles is the smallest. The annealing algorithm is an existing algorithm in the industry and will not be described here.
[0080] Optionally, in some embodiments, the center coordinates of the first weight bubble placed in the display interface are set to the center of the display interface, that is, (w / 2, h / 2), and the formula for minimizing the overlapping area of the subsequent weight bubbles and the previously placed weight bubbles is used, that is, by minimizing the Minimize formula The center coordinates of each subsequently placed weight bubble can be calculated in sequence, where n is the number of weight bubbles (i.e., weight data), dij represents the distance between the centers of the ith weight bubble and the jth weight bubble, ri represents the final display radius of the ith weight bubble, and rj represents the final display radius of the jth weight bubble. The above formula Represents the overlapping area of all weight bubbles. Through this algorithm, when the weight data changes, it can quickly respond to data changes and realize real-time update and dynamic display of bubble chart.
[0081] Step S400, displaying weight bubbles of each weight data at the center coordinates of each circle on the display interface with the final display radius to generate a weight bubble chart.
[0082] In some embodiments, step S400 includes: determining a display level of a weight bubble corresponding to each weight data according to each weight value, and displaying each weight bubble in the display interface according to the display level.
[0083] In addition to displaying each weight bubble on the display interface according to the calculated final display radius and center coordinates of each weight bubble, each weight bubble is also displayed in layers. For example, the weight bubble corresponding to the first weight value is displayed on the first layer, the weight bubble corresponding to the second weight value is displayed on the second layer, the weight bubble corresponding to the third weight value is displayed on the third layer..., so as to quickly determine the weight bubbles with the same weight value, and then quickly obtain the corresponding data, thereby realizing the multi-dimensional display of the weight data.
[0084] In some embodiments, the smaller the display level, the higher the corresponding weight bubble is located, or the larger the display level, the higher the corresponding weight bubble is located.
[0085] In some embodiments, in response to the user's color filling operation, weight bubbles at different levels are filled with different colors to distinguish the weight bubbles of each weight value, further realizing a multi-dimensional display of the weight values.
[0086] In some embodiments, after step S400, the method further includes: in response to a user's interactive operation, displaying the weight bubble in the display interface according to the interactive operation, wherein the interactive operation includes dragging, adding, viewing, filtering, and filling operations.
[0087] Through this embodiment, the interactivity of the weight bubble chart is enhanced, and more complex user interaction operations can be supported, allowing users to explore and analyze data more deeply.
[0088] It is worth noting that, in response to the user's adding and filtering operations, the weight bubble is updated on the display interface, that is, the weight bubble is redrawn.
[0089] Figure 3 A specific embodiment is shown, combining Figure 3The above embodiment is further explained. The display levels of weight bubbles with different weight values, that is, weight bubbles with a weight value of 1 are located at the first level, weight bubbles with a weight value of 2 are located at the second level, and weight bubbles with a weight value of 3 are located at the third level. It can be understood that weight bubbles with larger display levels are located at lower levels, and weight bubbles with the smallest display level are located at the top level. In addition, the fill color of weight bubbles with a weight value of 1 is red, the fill color of weight bubbles with a weight value of 2 is blue, and the fill color of weight bubbles with a weight value of 3 is yellow. When the weight bubble chart is initially generated, the red weight bubbles are located at the top level, the blue weight bubbles are located at the second level, and the yellow weight bubbles are located at the third level. When the user clicks on the W3-VALUE1 weight bubble to view it, in order to display the relevant information of the W3-VALUE1 weight bubble, the display level of the W3-VALUE1 weight bubble moves to the upper level of W1-VALUE1, and displays the relevant detailed information of W3-VALUE1. Figure 2 Shown is the display interface when the user clicks on the W3-VALUE1 weight bubble to view it.
[0090] In some embodiments, displaying weight bubbles of each weight data at each circle center coordinate of the display interface with the final display radius to generate a weight bubble chart includes:
[0091] By adding the Canvas element to HTML and using the Canvas's built-in drawing function to draw each weight bubble, a weight bubble chart is generated. By using Canvas in HTML to draw a weight bubble chart, you can get rid of the dependence on third-party plug-ins. Canvas is a tool for drawing graphics on a web page, which uses JavaScript to draw 2D graphics. The Canvas's built-in drawing functions include beginPath(), arc(), fill(), and stroke(). Among them, beginPath() means starting to draw, arc() means drawing the boundary of the weight bubble, that is, it will be drawn according to the final display radius and center coordinates of the weight bubble, fill() means filling color, and stroke() means drawing the border of the display interface.
[0092] According to the weight bubble chart generation method provided in the embodiment of the present application, the weighted value of each weight data is generated by the data value and weight value of the weight data, and the final display radius of each weight bubble is obtained by using the weighted value and the display space of the display interface. Then, the overlapping area of each weight bubble in the display interface is calculated according to the final display radius, and the center coordinates of each weight bubble are obtained by minimizing the overlapping area, thereby generating a weight bubble chart in the display interface. The size of the bubble chart includes the data value and weight value of the weight data, so that the multi-dimensional data of the weight data can be displayed through the size of the weight bubble, which can better display the differences between the weight data and meet the user's expression needs for the weight data. In addition, the method can quickly respond to data changes and realize real-time updating and dynamic display of weight bubbles.
[0093] The method for generating a weighted bubble chart provided in the embodiment of the present application can be executed by a device for generating a weighted bubble chart. In the embodiment of the present application, the device for generating a weighted bubble chart is taken as an example to illustrate the method for generating a weighted bubble chart provided in the embodiment of the present application.
[0094] The present application also provides a device for generating a weighted bubble chart. Figure 4 As shown, the device comprises:
[0095] The weighted value generating module 100 is used to obtain the data value and weight value of the weight data for generating the weight bubble chart, and to generate the weighted value corresponding to each weight data according to the data value and weight value of each weight data.
[0096] The display radius acquisition module 200 is used to obtain the final display radius of the weight bubble corresponding to each weight data according to the weight value corresponding to each weight data and the available display space of the display interface displaying the weight bubble chart.
[0097] The circle center coordinate calculation module 300 calculates the overlapping area between the weight bubbles corresponding to the weight data according to the final display radius, and calculates the circle center coordinate corresponding to each weight bubble when the overlapping area is minimum.
[0098] The bubble chart generating module 400 is used to display the weight bubbles of each weight data at the center coordinates of each circle on the display interface with the final display radius to generate a weight bubble chart.
[0099] According to the weight bubble chart generating device provided in the embodiment of the present application, the weighted value of each weight data is generated by the data value and weight value of the weight data, and the final display radius of each weight bubble is obtained by using the weighted value and the display space of the display interface. Then, the overlapping area of each weight bubble in the display interface is calculated according to the final display radius, and the center coordinates of each weight bubble are obtained by minimizing the overlapping area, thereby generating a weight bubble chart in the display interface. The size of the bubble chart includes the data value and weight value of the weight data, so that the multi-dimensional data of the weight data can be displayed through the size of the weight bubble, which can better display the differences between the weight data and meet the user's expression needs for the weight data. In addition, the method can quickly respond to data changes and realize real-time updating and dynamic display of weight bubbles.
[0100] In some embodiments, the display radius acquisition module further includes:
[0101] The display area acquisition unit is used to acquire the width value and the height value of the display interface, and calculate the display area A of the display space according to the width value and the height value.
[0102] The data number acquisition unit is used to acquire the data number n of the weight data.
[0103] A reference area calculation unit, used for taking the ratio A / n of the display area A to the number of data n as the reference area of each weighted bubble;
[0104] An initial radius calculation unit, used to calculate an initial display radius of each weighted data using the reference area and the weighted value;
[0105] An adjusting unit is used to adjust the initial display radius using the scaling factor of the display space to obtain the final display radius.
[0106] In some embodiments, the adjustment unit is further configured to determine a scaling factor based on the initial display radius and a maximum radius, wherein the maximum radius is determined by a smaller value between the width value w and the height value h.
[0107] In some embodiments, the adjustment unit is further used to determine that the scaling factor is 1 when it is determined that the initial display radii are all less than or equal to the maximum radius; when it is determined that there is a target initial display radius greater than the maximum radius among the initial display radii, determine the maximum initial display radius from the target initial display radii, and use the ratio of the maximum radius to the maximum initial display radius as the scaling factor.
[0108] In some embodiments, the initial radius calculation unit is also used to determine the maximum weighted value from each of the weighted values; calculate the ratio of each of the weighted values to the maximum weighted value to obtain the weighting factor of each of the weight data; and use the reference area and the weighting factor to calculate the initial display radius of each of the weight data.
[0109] In some embodiments, the bubble chart generation module 400 is further used to determine the display level of the weight bubble corresponding to each weight data according to each weight value; and display each weight bubble in the display interface according to the display level.
[0110] In some embodiments, the device further includes: a response operation module, which is used to respond to the user's interactive operation and display the weight bubble in the display interface according to the interactive operation; wherein the interactive operation includes dragging, adding, viewing, filtering, and filling operations.
[0111] The generating device of the weight bubble diagram in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplary, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) equipment, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobilepersonal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0112] The device for generating the weight bubble chart in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0113] The weight bubble chart generation device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0114] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the embodiment of the method for generating a weighted bubble chart described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0115] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0116] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned weight bubble chart generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0117] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0118] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned method for generating a weight bubble chart when executed by a processor.
[0119] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0120] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned weight bubble chart generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0121] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0122] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0124] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0125] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0126] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for generating a weighted bubble chart, characterized in that: include: Obtaining data values and weight values of weight data for which a weight bubble chart is to be generated, and generating weighted values corresponding to each weight data according to the data values and weight values of each weight data; Obtaining a final display radius of a weight bubble corresponding to each weight data according to a weighted value corresponding to each weight data and an available display space of a display interface displaying the weight bubble graph; Calculating the overlapping areas between the weight bubbles corresponding to the weight data according to the final display radii, and calculating the center coordinates of the circles corresponding to the weight bubbles when the overlapping areas are minimum; A weight bubble of each weight data is displayed at each circle center coordinate of the display interface with the final display radius to generate a weight bubble chart.
2. The method according to claim 1, characterized in that The method of obtaining the final display radius of the weight bubble corresponding to each weight data according to the weighted value corresponding to each weight data and the available display space of the display interface displaying the weight bubble chart comprises: Acquire a width value and a height value of the display interface, and calculate a display area A of the display space according to the width value and the height value; Obtain the number n of data of the weight data; The ratio A / n of the display area A and the number of data n is used as the reference area of each weighted bubble; Calculating an initial display radius of each weighted data using the reference area and the weighted value; The initial display radius is adjusted using the scaling factor of the display space to obtain the final display radius.
3. The method according to claim 2, characterized in that The scaling factor is determined by the size of the initial display radius and the maximum radius, wherein the maximum radius is determined by the smaller value of the width value w and the height value h.
4. The method according to claim 3, characterized in that The maximum radius is w / 2 or h / 2; the scaling factor is determined by the size of the initial display radius and the maximum radius, including: When it is determined that the initial display radius is less than or equal to the maximum radius, determining the scaling factor to be 1; When it is determined that there is a target initial display radius greater than the maximum radius in the initial display radii, the maximum initial display radius is determined from the target initial display radii, and the ratio of the maximum radius to the maximum initial display radius is used as the scaling factor.
5. The method according to claim 2, characterized in that: The step of calculating the initial display radius of each weighted data by using the reference area and the weighted value includes: Determining a maximum weighted value from among the weighted values; Calculating the ratio of each weighted value to the maximum weighted value to obtain a weighting factor of each weight data; The initial display radius of each weighted data is calculated using the reference area and the weighting factor.
6. The method according to any one of claims 1 to 5, characterized in that: The step of displaying a weight bubble of each weight data at each center coordinate of the display interface with the final display radius to generate a weight bubble chart includes: Determine the display level of the weight bubble corresponding to each weight data according to each weight value; Each of the weight bubbles is displayed in the display interface according to the display level.
7. The method according to any one of claims 1 to 5, characterized in that: After generating the weight bubble chart, it also includes: In response to an interactive operation of a user, displaying the weight bubble in the display interface according to the interactive operation; The interactive operations include dragging, adding, viewing, filtering, and filling operations.
8. A device for generating a weighted bubble chart, characterized in that: include: A weighted value generating module, used for obtaining data values and weight values of weight data for generating a weight bubble chart, and generating weight values corresponding to each weight data according to the data values and weight values of each weight data; A display radius acquisition module, used to obtain the final display radius of the weight bubble corresponding to each weight data according to the weight value corresponding to each weight data and the available display space of the display interface displaying the weight bubble chart; A circle center coordinate calculation module, which calculates the overlapping area between the weight bubbles corresponding to the weight data according to the final display radius, and calculates the circle center coordinates corresponding to the weight bubbles when the overlapping area is minimum; The bubble chart generating module is used to display the weight bubbles of each weight data at the center coordinates of each circle on the display interface with the final display radius to generate a weight bubble chart.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for generating a weight bubble chart as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a weighted bubble chart as described in any one of claims 1 to 7 is implemented.
