Radar map rendering method and device, electronic equipment and readable medium
By calculating the index coordinate value based on SVG, adaptive adjustment of the radar map is achieved, solving the problem that the radar map size and position cannot be adapted in the existing technology, and improving the user experience.
Patent Information
- Application Number
- CN202311633936.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art cannot adaptively adjust the size and position of the drawn radar map, resulting in poor user experience.
The SVG-based rendering method is used to render the radar graph by calculating the coordinate value of the indicator, so that it can be adjusted adaptively.
Improves the experience of radar maps, allowing them to scale and position changes flexibly without distortion.
Smart Images

Figure CN120070649A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, apparatus, electronic device, and readable medium for rendering a radar chart. Background Art
[0002] A radar chart, also known as a network chart, spider chart, star chart, spider web chart, irregular polygon, polar coordinate chart, or Kiviat chart, is a graph that displays multiple variable data in the form of a two-dimensional chart of multiple variables represented on axes starting from the same point. With the development of computers, the drawing of radar charts has been converted from manual to computer automatic implementation. Currently, radar charts are usually rendered using the drawing method of canvas. However, canvas draws radar charts in units of pixels and cannot adaptively change the size and position of the drawn radar chart, which is not user-friendly for services using radar charts. Summary of the Invention
[0003] To solve the above technical problems, this application provides a method, apparatus, electronic device, and readable medium for rendering a radar chart, which can implement the rendering of a radar chart based on the method of drawing a vector graph using Scalable Vector Graphics (SVG). The rendered radar chart can be adaptively adjusted, thereby improving the usage experience of the radar chart.
[0004] To achieve the above objective, the technical solutions provided in this application are as follows:
[0005] In a first aspect, this application provides a method for rendering a radar chart, including:
[0006] In response to a radar chart drawing request for a first object, obtain a first value of each of the N indicators included in the radar chart to be drawn, where the first value of an indicator is the value of the indicator of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3;
[0007] According to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, calculate first coordinate values corresponding to the first values of each of the N indicators in a first rectangular coordinate system;
[0008] Based on the first coordinate values of each of the N indicators, obtain a target radar chart, where the target radar chart is used to describe the value distribution of the N indicators of the first object.
[0009] In some implementation manners, the obtaining a target radar chart based on the first coordinate values of each of the N indicators includes:
[0010] Based on the SVG rendering template and input parameters, obtain the target radar chart, where the input parameters correspond to the configuration items in the SVG rendering template, and the SVG rendering template is used to draw the target radar chart according to each configuration item in the configuration items and the parameters corresponding to the configuration item in the input parameters. The input parameters at least include: the first coordinate value of each of the N metrics.
[0011] In some implementation manners, the configuration items of the SVG rendering template at least include a path drawing function. Obtaining the target radar chart based on the scalable vector graphics (SVG) rendering template and input parameters includes:
[0012] Determine the second coordinate value of each of the N metrics in the SVG coordinate system according to the first coordinate value of each of the N metrics;
[0013] Draw the target radar chart according to the path drawing function and the second coordinate value of each of the N metrics.
[0014] In some implementation manners, the radar chart drawing request also corresponds to a second object, and the method further includes:
[0015] In response to the radar chart drawing request, obtain the second value of each of the N metrics included in the radar chart to be drawn for the second object, where the second value of the metric is the value of the metric of the second object corresponding to the radar chart drawing request;
[0016] According to the size, the maximum value of each of the N metrics, and the second value of each of the N metrics, calculate the third coordinate value corresponding to the second value of each of the N metrics in the first rectangular coordinate system;
[0017] Then, obtaining the target radar chart based on the SVG rendering template and input parameters includes:
[0018] Draw a first radar chart corresponding to the first object based on the SVG rendering template and the first coordinate value corresponding to the first value of each of the N metrics in the input parameters;
[0019] Draw a second radar chart corresponding to the second object based on the SVG rendering template and the third coordinate value corresponding to the second value of each of the N metrics in the input parameters;
[0020] Wherein, the target radar chart includes a layer corresponding to the background, a layer corresponding to the first radar chart, and a layer corresponding to the second radar chart.
[0021] In some implementations, the SVG rendering template further includes at least one of the following configuration items: a background configuration item, a first radar chart configuration item, and a second radar configuration item. The input parameters further include at least one of the following parameters corresponding to the configuration items in the SVG rendering template: a background configuration value, a first radar chart configuration value, and a second radar chart configuration value. The background configuration value is used to indicate the drawing style of the background, the first radar chart configuration value is used to indicate the drawing style of the first radar chart, and the second radar chart configuration value is used to indicate the drawing style of the second radar chart.
[0022] In some implementations, the target radar chart further includes a layer corresponding to a legend, and the layer corresponding to the legend is used to indicate the drawing styles of the first radar chart and the second radar chart in the target radar chart.
[0023] In some implementations, the method further includes:
[0024] Setting animation parameters of a Cascading Style Sheets (CSS) using SVG;
[0025] Performing animation rendering on the target radar chart according to the animation parameters, and the effects of the animation rendering include at least one of the following effects: gradual change in width, gradual change in height, gradual change in transparency, gradual change in position, 2D and 3D rotation, tilt, displacement, or scaling.
[0026] In some implementations, if N is equal to 3, calculating, according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system includes:
[0027] Constructing an equilateral triangle covering the 3 indicators included in the radar chart to be drawn in the first rectangular coordinate system;
[0028] Determining the radius of the circumcircle of the equilateral triangle and the fourth coordinate value of the center of the circumcircle based on the side length of the equilateral triangle;
[0029] Determining the first coordinate value corresponding to the first value of each of the 3 indicators in the first rectangular coordinate system based on the ratio between the maximum value of each of the 3 indicators and the first value of the indicator, the radius, and the fourth coordinate value.
[0030] In a second aspect, the present application further provides a rendering device for a radar chart, including:
[0031] A first acquisition unit, configured to, in response to a radar chart drawing request for a first object, acquire a first value of each of the N metrics included in the radar chart to be drawn, where the first value of a metric is the value of the metric of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3;
[0032] A first calculation unit, configured to calculate, according to the size of the radar chart to be drawn, the maximum value of each of the N metrics, and the first value of each of the N metrics, a first coordinate value corresponding to the first value of each of the N metrics in a first rectangular coordinate system;
[0033] A rendering unit, configured to obtain a target radar chart based on the first coordinate value of each of the N metrics, where the target radar chart is used to describe the value distribution of the N metrics of the first object.
[0034] In some implementation manners, the rendering unit is specifically configured to:
[0035] Obtain the target radar chart based on an SVG rendering template and input parameters, where the input parameters correspond to configuration items in the SVG rendering template, and the SVG rendering template is used to draw the target radar chart according to each configuration item in the configuration items and the parameter corresponding to the configuration item in the input parameters, and the input parameters at least include: the first coordinate value of each of the N metrics.
[0036] In some implementation manners, the configuration items of the SVG rendering template at least include a path drawing function, and the rendering unit is specifically configured to:
[0037] Determine a second coordinate value of a metric in an SVG coordinate system according to the first coordinate value of each of the N metrics;
[0038] Draw the target radar chart according to the path drawing function and the second coordinate value of each of the N metrics.
[0039] In some implementation manners, the radar chart drawing request also corresponds to a second object, and the apparatus further includes:
[0040] A second acquisition unit, configured to, in response to the radar chart drawing request, acquire a second value of each of the N metrics included in the radar chart to be drawn, where the second value of a metric is the value of the metric of the second object corresponding to the radar chart drawing request;
[0041] A second calculation unit, configured to calculate, according to the size, the maximum value of each of the N indicators, and the second value of each of the N indicators, a third coordinate value corresponding to the second value of each of the N indicators in the first rectangular coordinate system;
[0042] Then, the rendering unit includes:
[0043] A first rendering subunit, configured to draw a first radar chart corresponding to the first object based on the SVG rendering template and the first coordinate value corresponding to the first value of each of the N indicators in the input parameters;
[0044] A second rendering subunit, configured to draw a second radar chart corresponding to the second object based on the SVG rendering template and the third coordinate value corresponding to the second value of each of the N indicators in the input parameters;
[0045] Wherein, the target radar chart includes a layer corresponding to the background, a layer corresponding to the first radar chart, and a layer corresponding to the second radar chart.
[0046] In some implementation manners, the SVG rendering template further includes at least one of the following configuration items: a background configuration item, a first radar chart configuration item, and a second radar configuration item, and the input parameters further include at least one of the following parameters corresponding to the configuration items in the SVG rendering template: a background configuration value, a first radar chart configuration value, and a second radar chart configuration value, where the background configuration value is used to indicate the drawing style of the background, the first radar chart configuration value is used to indicate the drawing style of the first radar chart, and the second radar chart configuration value is used to indicate the drawing style of the second radar chart.
[0047] In some implementation manners, the target radar chart further includes a layer corresponding to a legend, and the layer corresponding to the legend is used to indicate the drawing styles of the first radar chart and the second radar chart in the target radar chart.
[0048] In some implementation manners, the apparatus further includes:
[0049] A setting unit, configured to use SVG to set animation parameters of CSS;
[0050] An animation unit, configured to perform animation rendering on the target radar chart according to the animation parameters, and the effects of the animation rendering include at least one of the following effects: gradual change in width, gradual change in height, gradual change in transparency, gradual change in position, 2D and 3D rotation, tilt, displacement, or scaling.
[0051] In some implementations, if N is equal to 3, the first calculation unit is specifically configured to:
[0052] In the first rectangular coordinate system, construct an equilateral triangle covering the 3 indicators included in the radar chart to be drawn;
[0053] Based on the side length of the equilateral triangle, determine the radius of the circumcircle of the equilateral triangle and the fourth coordinate value of the center of the circumcircle;
[0054] Based on the ratio between the maximum value of each of the 3 indicators and the first value of the indicator, the radius, and the fourth coordinate value, determine the first coordinate value corresponding to the first value of each of the 3 indicators in the first rectangular coordinate system.
[0055] It should be noted that for the specific implementation manner and the achieved technical effects of this device, reference can be made to the relevant descriptions of the method provided in the first aspect or any implementation manner of the first aspect.
[0056] In a third aspect, the present application further provides an electronic device, which includes: a processor and a memory;
[0057] The memory is used to store instructions or programs;
[0058] The processor is configured to execute the instructions or programs in the memory, so that the electronic device executes the method provided in the above-mentioned target aspect or any implementation manner of the target aspect.
[0059] In a fourth aspect, the present application further provides a readable medium, in which instructions or programs are stored. When the instructions or programs run on a processor, the processor is caused to execute the method provided in the above-mentioned target aspect or any implementation manner of the target aspect.
[0060] Compared with the prior art, the embodiments of the present application have at least the following advantages:
[0061] In the technical solution provided by this application, if there is a need to draw a radar chart for a first object, then a radar chart drawing request for the first object can be triggered. In response to the radar chart drawing request, the radar chart rendering device can obtain the first value of each of the N metrics included in the radar chart to be drawn for the first object. The first value of a metric is the value of the metric of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3. Then, the radar chart rendering device can calculate the first coordinate value corresponding to the first value of each of the N metrics in the first rectangular coordinate system according to the size of the radar chart to be drawn, the maximum value of each of the N metrics, and the first value of each of the N metrics. Then, the radar chart rendering device obtains a target radar chart based on the first coordinate value of each of the N metrics. The target radar chart is used to describe the value distribution of the N metrics of the first object. In this way, through this method, by calculating the coordinate values corresponding to each metric in the radar chart and using these coordinate values as the input for radar chart rendering, the drawing of the radar chart can be simply and quickly realized. Moreover, the rendered radar chart can be adaptively adjusted. Therefore, the user experience of the radar chart is improved based on this method. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0063] Figure 1 Schematic diagram of a radar chart provided by an embodiment of the present application;
[0064] Figure 2 Schematic flowchart of a method for rendering a radar chart provided by an embodiment of the present application;
[0065] Figure 3 Schematic flowchart of triggering radar chart rendering on a display page provided by an embodiment of the present application;
[0066] Figure 4 Schematic diagram of a triangular radar chart provided by an embodiment of the present application;
[0067] Figure 5 Schematic diagram of a pentagonal radar chart provided by an embodiment of the present application;
[0068] Figure 6 Schematic diagram of a target radar chart provided by an embodiment of the present application;
[0069] Figure 7A schematic diagram of another target radar map provided in an embodiment of the present application;
[0070] Figure 8 A schematic diagram of the structure of a radar chart rendering device 800 provided in an embodiment of the present application;
[0071] Figure 9 A schematic diagram of the structure of an electronic device 900 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] Radar charts are widely used in various business scenarios to display the values of multiple indicators of at least one object. It is a commonly used chart format. Since the distribution of multiple indicators is combined and displayed on a single graph, it is vividly called a radar chart. Take the triangular radar chart as an example. Figure 1 As shown, the radar charts of object A, object B and object C are shown respectively. The radar charts of object A, object B and object C all involve index 1, index 2 and index 3. From the radar chart of object A, it can be seen that the values of index 1 and index 2 of object A are large, but the value of index 3 is small; from the radar chart of object B, it can be seen that the values of index 2 and index 3 of object B are large, but the value of index 1 is small; from the radar chart of object C, it can be seen that the value of index 1 of object C is large, but the values of index 2 and index 3 are small. Based on Figure 1 The radar chart shown can provide targeted follow-up processing opinions for objects A, B, and C to achieve a balance of various indicators or optimization of certain indicators. It should be noted that in the embodiment of the present application, the object can be, for example, a store, product, or service to be understood, and the indicator refers to the variable that needs to be analyzed for the object, such as the store's ecology, sales volume, experience, etc.
[0073] With the development of computers, radar charts are being used more and more widely. If radar charts are drawn manually, it can no longer meet the requirements of users for the drawing efficiency and effect of radar charts. For the automatic drawing of radar charts, the rendering is usually carried out by using the drawing method of canvas. However, canvas draws radar charts in pixels and cannot adaptively change the size and position of the drawn radar chart. For example, when a radar chart drawn by canvas is enlarged, the radar chart will be distorted; if it is necessary to perform operations such as scaling or position change on a radar chart drawn by canvas, corresponding codes for scaling or position change need to be written additionally to achieve the drawing of the radar chart with the changes brought by the corresponding operations, and the implementation cost is relatively high. In addition, if an animation effect such as gradient is implemented on a radar chart drawn by canvas, additional code for this animation effect also needs to be written, and the implementation cost is relatively high; many devices do not support canvas, and if you want to make the device compatible with canvas, complex configurations are required. Therefore, canvas has poor compatibility and a high cost for achieving compatibility.
[0074] Based on this, the embodiments of the present application provide a technical solution for radar chart rendering. The radar chart rendering device can obtain the first value of each of the N indicators of the first object in the N indicators included in the radar chart to be drawn in response to a radar chart drawing request for the first object. The first value of the indicator is the value of the indicator of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3; then, the radar chart rendering device can calculate the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators; then, the radar chart rendering device obtains a target radar chart based on the first coordinate value of each of the N indicators, and the target radar chart is used to describe the value distribution of the N indicators of the first object.
[0075] In this way, by this method, the coordinate values corresponding to each indicator in the radar chart are calculated and used as the input for radar chart rendering, and the drawing of the radar chart can be simply and quickly achieved. Moreover, the rendered radar chart can be adaptively adjusted. Therefore, the user experience of the radar chart is improved based on this method.
[0076] As an example, the radar chart rendering device can render a target radar chart based on the SVG rendering method, using the first coordinate value of each of the N metrics as a basis. Since the SVG rendering template is implemented based on the method of drawing vector graphics, for the radar chart rendered based on SVG, operations such as scaling or position change do not require additional code to be written; since SVG supports all animation parameters of CSS3, the cost of implementing animation effects such as gradients on the radar chart based on SVG rendering is also relatively low; compared with canvas, the compatibility of SVG is also improved.
[0077] It should be noted that the main body implementing the radar chart rendering method can be the radar chart rendering device provided in the embodiments of the present application. The radar chart rendering device can be carried in an electronic device or a functional module of an electronic device. For example, the radar chart rendering device can be a functional module integrated on a terminal device where the browser is located and has the function of rendering a radar chart for an object on the display page, or, for example, the radar chart rendering device can be a functional module integrated on a server corresponding to the browser and has the function of rendering a radar chart for an object on the display page.
[0078] Figure 2 It is a schematic flowchart of a radar chart rendering method provided in the embodiments of the present application. This method can be applied to a radar chart rendering device, and the radar chart rendering device can be, for example, as follows Figure 8 The radar chart rendering device 800 shown below.
[0079] As Figure 2 shown, this method can include the following S101 to S103, for example:
[0080] S101, in response to a radar chart drawing request for a first object, obtain the first value of each of the N metrics included in the radar chart to be drawn for the first object. The first value of the metric is the value of the metric of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3.
[0081] In some implementation manners, on the display page, a function for analyzing metrics of one or more objects on the display page can be provided for the user. For example, a control (such as a button) corresponding to the radar chart drawing request is set on the display page. When the user needs to perform metric analysis on a certain object or several objects through a radar chart, the corresponding control can be clicked to trigger the corresponding radar chart drawing request. The radar chart drawing request is used to request to draw the distribution of the N metrics of the first object. For example, if the first object corresponds to Figure 1 Object A among the objects, then the target radar chart generated based on the radar chart drawing request of S101 can be seen in Figure 1 the leftmost radar chart in; and for another example, if the first object corresponds to Figure 1For the object C in [it], the target radar chart generated based on the radar chart drawing request in S101 can be seen in Figure 1 the rightmost radar chart in [it].
[0082] For the radar chart rendering device, in response to the radar chart drawing request occurring on the display page, it triggers the execution of S101, where the first value in S101 corresponds to the radar chart drawing request. As an example, the first value can be the current value of the first object for each of the N indicators included in the radar chart to be drawn when the radar chart drawing request occurs; as another example, the radar chart drawing request can also indicate the acquisition rule for the first value targeted by the radar chart to be drawn. For example, if the acquisition rule indicates the target time, then the first value can be the value of the first object for each of the N indicators included in the radar chart to be drawn at the target time; or for another example, if the acquisition rule indicates the target time period, then the first value can be the sum or average of the values of the first object for each of the N indicators included in the radar chart to be drawn during the target time period.
[0083] For example, as Figure 3 shown, the display page can be a list of product recommendations under the target category (such as clothing). The display page includes Product 1, Product 2, and Product 3 under the target category. Products 1 to 3 respectively correspond to buttons 1 to 3 related to the index analysis requirements. When the user wants to render the radar chart corresponding to Product 1, they can click button 1 corresponding to Product 1, triggering the radar chart rendering device to execute Figure 2 the method shown in [it] to generate the target radar chart corresponding to Product 1 on the display page. Among them, the multiple indicators in the target radar chart can be pre-configured default indicators, or can be multiple indicators selected by the user on the selection page that pops up on the display page after clicking button 1 corresponding to Product 1.
[0084] It should be noted that the target radar chart can be displayed on the display page in the form of a drawer, a pop-up window, full screen, or an embedded card.
[0085] It can be seen that by obtaining the first value of the first object for each of the N indicators included in the radar chart to be drawn through S101, as the original data basis for the subsequent drawn target radar chart, it prepares for the subsequent execution of S102 - S103.
[0086] S102, according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, calculate the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system.
[0087] Among them, the size of the radar chart to be drawn, for example, can be the size of the background of the radar chart to be drawn. Taking the background of the radar chart to be drawn as a regular N-sided polygon as an example, the size of the background of the radar chart to be drawn can refer to the side length of the regular N-sided polygon.
[0088] In some implementation manners, S102 can include, for example: First, a regular N-sided polygon covering the N indicators included in the radar chart to be drawn can be constructed in the first rectangular coordinate system as the background of the target radar chart to be generated in S103; then, based on the side length of the regular N-sided polygon, the radius of the circumscribed circle of the regular N-sided polygon and the coordinate values of the center of the circumscribed circle are determined; next, the ratio between the maximum value of each of the N indicators and the first value is calculated, and based on this ratio, the radius, and the coordinate values of the center, the first coordinate values of the vertices corresponding to each of the N indicators in the first rectangular coordinate system are determined. Among them, the first rectangular coordinate system can be, for example, the Figure 4 or Figure 5 coordinate system shown below, or the first rectangular coordinate system can also be the SVG coordinate system.
[0089] Taking N = 3 and N = 5 as examples below, the implementation of S102 in the process of rendering a triangular radar chart and a pentagonal radar chart is introduced respectively.
[0090] As an example, when N = 3, S102 can include, for example: S102a1, in the first rectangular coordinate system, an equilateral triangle covering the three indicators included in the radar chart to be drawn is constructed as the background; S102a2, based on the side length of the equilateral triangle, the radius of the circumscribed circle of the equilateral triangle and the fourth coordinate value of the center of the circumscribed circle are determined; S101a3, based on the ratio between the maximum value of each of the 3 indicators and the first value, the radius, and the fourth coordinate value, the first coordinate values of the vertices corresponding to each of the 3 indicators in the first rectangular coordinate system are determined.
[0091] See Figure 4 and Figure 4 Taking the coordinate system shown below as the first rectangular coordinate system as an example, assuming that the first values and the maximum values of the three indicators are <First value 1, Maximum value 1>, <First value 2, Maximum value 2>, and <First value 3, Maximum value 3> respectively, the ratios calculated based on S101a3 are: ratio 1 = First value 1 / Maximum value 1, ratio 2 = First value 2 / Maximum value 2, and ratio 3 = First value 3 / Maximum value 3. If the single vertices in the radar chart to be rendered are Figure 4 points A, B, and C in Figure 4 then the equilateral triangle constructed in S101a1 can be the gray equilateral triangle with side length w in The fourth coordinate value is (pointX = (1 / 2)*w, Then, based on the above calculation results, the first coordinate value of point A in the first coordinate system is (pointX, pointY + r*ratio 1), the first coordinate value of point B in the first coordinate system is (pointX - ratio 2*pointX, pointY*ratio 2), and the first coordinate value of point C in the first coordinate system is (pointX + r*ratio3, pointY - r*ratio 3).
[0092] As another example, when N = 5, S102 may include: S102b1, in the first rectangular coordinate system, construct a regular pentagon covering the five indicators included in the radar chart to be drawn as the background; S102b2, divide the regular pentagon into 5 triangles according to the connection lines between the center of the circumscribed circle and the vertices of the regular pentagon. The apex angle of each triangle is (360 degrees / 5 = 72 degrees). According to the cosine theorem, side length, and apex angle in trigonometry, determine the radius of the circumscribed circle and the fourth coordinate value of the center of the circumscribed circle; S102b3, based on the ratio between the maximum value of each of the 5 indicators and the first value, the radius, and the fourth coordinate value, determine the first coordinate value of the vertex corresponding to each of the 5 indicators in the first rectangular coordinate system.
[0093] See Figure 5 , taking the Figure 5 shown coordinate system as the first rectangular coordinate system as an example. Assume that the ratios of the first value and the maximum value of the five indicators are: ratio 1 to ratio 5. If the single vertices in the radar chart to be rendered are Figure 5 points A, B, C, D, and E in Figure 5 , then the regular pentagon constructed in S101b1 can be the 2 gray regular pentagon with side length w in 2 . In S101b2, based on w 2 = r The fourth coordinate value is denoted as (pointX, pointY) (the relationship between pointX and pointY and the values such as w is not described). Then, based on the above calculation results, the first coordinate value of point A in the first coordinate system is (pointX + ratio 1 * r * cos(90 degrees), pointY + ratio 1 * r * sin(90 degrees)), the first coordinate value of point B in the first coordinate system is (pointX + ratio 2 * r * cos(162 degrees), pointY + ratio 2 * r * sin(162 degrees)), the first coordinate value of point C in the first coordinate system is (pointX + ratio 2 * r * cos(234 degrees), pointY + ratio 3 * r * sin(234 degrees)), the first coordinate value of point D in the first coordinate system is (pointX + ratio 4 * r * cos(306 degrees), pointY + ratio 4 * r * sin(306 degrees)), and the first coordinate value of point E in the first coordinate system is (pointX + ratio 5 * r * cos(378 degrees), pointY + ratio 5 * r * sin(378 degrees)). The above angles can be obtained by establishing a polar coordinate system with the center of the circumscribed circle as the reference, and getting the angles where points A to E are located. Specifically, the angle of point A is 90 degrees, the angle of point B is 90 degrees + 72 degrees * 1 = 162 degrees, the angle of point C is 90 degrees + 72 degrees * 2 = 234 degrees, the angle of point D is 90 degrees + 72 degrees * 3 = 306 degrees, and the angle of point E is 90 degrees + 72 degrees * 4 = 378 degrees.
[0094] It can be seen that S102 provides a data basis for rendering the radar chart to be rendered based on SVG in S103 to obtain the target radar chart.
[0095] S103. Based on the first coordinate value of each of the N indicators, obtain a target radar chart, which is used to describe the value distribution of the N indicators of the first object.
[0096] As an example, S103 can be implemented, for example, based on the SVG rendering method. Specifically, S103 may include: obtaining a target radar chart based on an SVG rendering template and input parameters, where the input parameters correspond to the configuration items in the SVG rendering template, and the SVG rendering template is used to draw the target radar chart according to each configuration item in each configuration item and the parameter corresponding to the configuration item in the input parameters. The input parameters at least include: the first coordinate value of each of the N indicators.
[0097] Among them, the SVG rendering template can be understood as a template with fixed configuration items. Only the corresponding values need to be input for each configuration item in the SVG rendering template. After the configuration is completed, running the configured SVG rendering template can obtain the target radar chart. In this way, the implementation cost for users is relatively low, and the experience is very friendly.
[0098] Among them, the SVG rendering template can at least include a path drawing function, which is used to draw the second coordinate value of each of the N indicators in the SVG coordinate system in a drawing direction. The drawing direction can be clockwise or counterclockwise.
[0099] In the above example, the horizontal axis of the first rectangular coordinate system in S102 is horizontal to the right, and the vertical axis is vertical upward, while the SVG coordinate system has the horizontal axis horizontal to the right and the vertical axis vertical downward. Then, during rendering, the first coordinate values in the first rectangular coordinate system need to be converted into the second coordinate values in the SVG coordinate system. The abscissas of the first coordinate value and the second coordinate value are the same, and the ordinate in the second coordinate value is the height of the background minus the ordinate in the first coordinate value. Taking the triangular radar chart as an example, the height of the background can be expressed as
[0100] As an example, the conversion of the first coordinate value and the second coordinate value can be performed by the radar chart rendering device after S102 and before S103. Then, in the input parameters of S103, the first coordinate value of each of the N indicators can be replaced with the second coordinate value of each of the N indicators, without the need for the path drawing function to perform the coordinate value conversion operation before path drawing.
[0101] As another example, the conversion of the first coordinate value and the second coordinate value can be the coordinate value conversion operation performed by the path drawing function before path drawing. Then, the input parameters include the first coordinate value of each of the N indicators. The path drawing function first replaces the first coordinate value of each of the N indicators with the corresponding second coordinate value, and then performs path drawing in the SVG coordinate system based on the second coordinate value, without the need to separately perform the operation of replacing the first coordinate value of each of the N indicators with the second coordinate value of each of the N indicators before S103.
[0102] In some other possible implementation methods, S102 can also be directly implemented in the SVG coordinate system, that is, the first rectangular coordinate system is the same as the SVG coordinate system. In this case, the first coordinate value is the same as the second coordinate value of the corresponding indicator.
[0103] In some implementation methods, the target radar chart can only include the first radar chart of the first object, such as Figure 6As shown, the target radar chart includes a background layer and a layer corresponding to the first radar chart. Figure 6 (which is denoted as the layer corresponding to SVG 1 in Figure 6 ). Among them, the first object can be a certain product or service targeted by the index analysis requirement.
[0104] In some other implementation manners, the target radar chart may also include a first radar chart of the first object and a second radar chart of the second object. If the first value in S101 is associated with the first object, then the method may further include: S104, in response to the radar chart drawing request, obtaining a second value of each of the N indexes included in the radar chart to be drawn for the second object, where the second value of the index is the value of the index of the second object corresponding to the radar chart drawing request; S105, calculating a third coordinate value corresponding to the second value of each of the N indexes in the first rectangular coordinate system according to the size, the maximum value of each of the N indexes, and the second value of each of the N indexes. Thus, S103 may include: based on the SVG rendering template and the input parameters, drawing the first radar chart corresponding to the first object and the second radar chart corresponding to the second object, and generating a target radar chart including the layer corresponding to the background, the layer corresponding to the first radar chart, and the layer corresponding to the second radar chart. Among them, the input parameters may further include the third coordinate value corresponding to each of the N indexes, and the path drawing function is used to draw the fourth coordinate value of each of the N indexes in the SVG coordinate system in one direction. The first object and the second object may be two different products or services, or may be the index situations of the same product or service at different time stages. In this implementation manner, for the target radar chart, reference may be made to the following Figure 7 as shown.
[0105] As an example, in order to distinguish the first radar chart and the second radar chart in the target radar chart, the input parameters may further include a first radar chart configuration value and a second radar chart configuration value. The first radar chart configuration value is used to indicate the drawing style of the first radar chart, and the second radar chart configuration value is used to indicate the drawing style of the second radar chart. Then, in S102, the first radar chart and the second radar chart with different drawing styles (such as colors) may be drawn according to the first radar chart configuration value and the second radar chart configuration value respectively.
[0106] It should be noted that in addition to sharing the layer corresponding to the background, the first radar chart and the second radar chart may also share the layer corresponding to the legend. The layer corresponding to the legend is used to indicate the drawing styles of the first radar chart and the second radar chart in the target radar chart. In other words, the legend is used to indicate the correspondence between the radar chart and the object, and the legend may be determined according to the first radar chart configuration value and the second radar chart configuration value. Or, the legend configuration value may also be included in the input parameters, and the legend may also be determined based on the legend configuration value in the input parameters.
[0107] It should be noted that the indicators shown in the first radar chart and the second radar chart are the same.
[0108] As Figure 7 shown, the target radar chart may include a background layer, a legend layer, a layer corresponding to the first radar chart, and a layer corresponding to the second radar chart ( Figure 7 denoted as the layer corresponding to SVG 1 and the layer corresponding to SVG 2 respectively in
[0109] In some implementation manners, since SVG supports all animation parameters of CSS3, the embodiments of the present application may further include: setting the animation parameters of CSS by using SVG; performing animation rendering on the target radar chart according to the animation parameters to improve the display effect of the rendered radar chart and give users a better usage experience. Among them, the effects of the animation rendering may at least include one or a combination of more than one of the following effects: gradual change of width, gradual change of height, gradual change of transparency, gradual change of position, 2D and 3D rotation, tilt, displacement, or scaling. In this way, through the configuration of the animation parameters, the desired animation effect can be achieved simply and conveniently during the rendering of the radar chart at low cost.
[0110] It should be noted that in the embodiments of the present application, the side length of the background or the radius of the circumscribed circle of the regular N-sided radar chart, the filling color of the background, the line color of the background, the line color of the radar chart, the filling color of the radar chart, etc. can be flexibly configured in the SVG rendering template, which improves the adaptability of the radar chart rendering solution.
[0111] It can be seen that through this method, by calculating the coordinate values corresponding to each indicator in the radar chart and using the coordinate values as an important part of the input parameters of the SVG rendering template, writing the input parameters into the corresponding configuration items of the SVG rendering template, and running the configured SVG rendering template, the rendering of the radar chart can be simply and quickly realized. Moreover, since the SVG rendering template is implemented based on the method of drawing vector graphics, the rendered radar chart can be adaptively adjusted. Therefore, the usage experience of the radar chart is improved based on this method.
[0112] Correspondingly, the embodiments of the present application further provide a radar chart rendering device 800, as Figure 8 shown. The device 800 may include, for example:
[0113] A first obtaining unit 801, configured to obtain a first value of each of the N indicators included in the radar chart to be drawn for the first object in response to a radar chart drawing request for the first object, where the first value of the indicator is the value of the indicator of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3;
[0114] The first calculation unit 802 is configured to calculate, according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, a first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system;
[0115] The rendering unit 803 is configured to obtain a target radar chart based on the first coordinate values of each of the N indicators, where the target radar chart is used to describe the value distribution of the N indicators of the first object.
[0116] In some implementation manners, the rendering unit 803 is specifically configured to:
[0117] Obtain the target radar chart based on an SVG rendering template and input parameters, where the input parameters correspond to configuration items in the SVG rendering template, and the SVG rendering template is used to draw the target radar chart according to each configuration item in the configuration items and the parameters corresponding to the configuration item in the input parameters. The input parameters at least include the first coordinate values of each of the N indicators.
[0118] In some implementation manners, the configuration items of the SVG rendering template at least include a path drawing function. The rendering unit 803 is specifically configured to:
[0119] Determine a second coordinate value of each of the N indicators in the SVG coordinate system according to the first coordinate values of each of the N indicators;
[0120] Draw the target radar chart according to the path drawing function and the second coordinate values of each of the N indicators.
[0121] In some implementation manners, the radar chart drawing request also corresponds to a second object, and the apparatus 800 further includes:
[0122] A second acquisition unit, configured to, in response to the radar chart drawing request, acquire a second value of each of the N indicators included in the radar chart to be drawn for the second object, where the second value of the indicator is the value of the indicator of the second object corresponding to the radar chart drawing request;
[0123] A second calculation unit, configured to calculate, according to the size, the maximum value of each of the N indicators, and the second value of each of the N indicators, a third coordinate value corresponding to the second value of each of the N indicators in the first rectangular coordinate system;
[0124] Then, the rendering unit 803 includes:
[0125] The first rendering subunit is configured to draw a first radar chart corresponding to the first object based on the SVG rendering template and the first coordinate values corresponding to the first values of each of the N metrics in the input parameters.
[0126] The second rendering subunit is configured to draw a second radar chart corresponding to the second object based on the SVG rendering template and the third coordinate values corresponding to the second values of each of the N metrics in the input parameters.
[0127] Wherein, the target radar chart includes a layer corresponding to the background, a layer corresponding to the first radar chart, and a layer corresponding to the second radar chart.
[0128] In some implementation manners, the SVG rendering template further includes at least one of the following configuration items: a background configuration item, a first radar chart configuration item, and a second radar configuration item, and the input parameters further include at least one of the following parameters corresponding to the configuration items in the SVG rendering template: a background configuration value, a first radar chart configuration value, and a second radar chart configuration value. The background configuration value is used to indicate the drawing style of the background, the first radar chart configuration value is used to indicate the drawing style of the first radar chart, and the second radar chart configuration value is used to indicate the drawing style of the second radar chart.
[0129] In some implementation manners, the target radar chart further includes a layer corresponding to a legend, and the layer corresponding to the legend is used to indicate the drawing styles of the first radar chart and the second radar chart in the target radar chart.
[0130] In some implementation manners, the apparatus 800 further includes:
[0131] A setting unit, configured to set the animation parameters of CSS by using SVG;
[0132] An animation unit, configured to perform animation rendering on the target radar chart according to the animation parameters, and the effects of the animation rendering include at least one of the following effects: gradual change of width, gradual change of height, gradual change of transparency, gradual change of position, 2D and 3D rotation, tilt, displacement, or scaling.
[0133] In some implementation manners, if N is equal to 3, the first calculation unit 802 is specifically configured to:
[0134] In the first rectangular coordinate system, construct an equilateral triangle covering the 3 metrics included in the radar chart to be drawn;
[0135] Based on the side length of the equilateral triangle, determine the radius of the circumscribed circle of the equilateral triangle and the fourth coordinate value of the center of the circumscribed circle;
[0136] Based on the ratio between the maximum value of each of the three indicators and the first value of the indicator, the radius, and the fourth coordinate value, determine the first coordinate value corresponding to the first value of each of the three indicators in the first rectangular coordinate system.
[0137] It should be noted that for the specific implementation manner and achieved technical effects of the apparatus 800, reference may be made to Figure 2 the relevant descriptions of the method shown.
[0138] In addition, an embodiment of the present application further provides an electronic device, the device including a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device executes any implementation manner of the method provided in the embodiment of the present application.
[0139] See Figure 9 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 9 The electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0140] As Figure 9 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0141] Typically, the following devices can be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and a communication device 909. The communication device 909 can allow the electronic device 900 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 9 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0142] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0143] The electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept. Technical details not described in detail in this embodiment can be seen in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0144] An embodiment of the present application also provides a computer-readable medium, in which instructions or a computer program are stored, and when the instructions or the computer program run on a device, the device is caused to execute any implementation manner of the method provided by the embodiment of the present application.
[0145] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0146] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (Hyper Text Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0147] The above computer-readable medium can be included in the above electronic device; or it can exist separately and not be assembled into the electronic device.
[0148] The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device can execute the above method.
[0149] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or combinations thereof. The foregoing programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0150] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0151] The units involved in the embodiments described in this disclosure can be implemented in software or in hardware. Among them, the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.
[0152] The functions described above herein can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0153] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0154] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the systems or apparatuses disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and reference can be made to the method part for the relevant parts.
[0155] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist simultaneously. Here, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expressions refer to any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0156] It should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0157] The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well known in the art.
[0158] It should be noted that in the embodiments of the present application, user-sensitive information is not involved, and user-related information is obtained, used and determined only after user authorization. In one example, before obtaining user-related information, a prompt message related to obtaining data usage authorization is displayed on the corresponding interface. This prompt message informs the user of the type, usage scope, usage scenarios, etc. of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, so that the user can determine whether to agree to the authorization based on this prompt message. It can be understood that the above notification and user authorization process is only illustrative and does not constitute a limitation on the implementation manner of this disclosure. Other methods that comply with relevant laws and regulations can also be applied to the implementation manner of this disclosure.
[0159] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for rendering a radar chart, characterized in that, it includes: In response to a radar chart drawing request for a first object, obtain the first value of each of the N indicators included in the radar chart to be drawn, where the first value of an indicator is the value of the indicator of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3; According to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, calculate the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system; Based on the first coordinate value of each of the N indicators, obtain a target radar chart, where the target radar chart is used to describe the value distribution of the N indicators of the first object.
2. The method according to claim 1, characterized in that, The obtaining the target radar chart based on the first coordinate value of each of the N indicators includes: Based on an SVG rendering template and input parameters, obtain the target radar chart, where the input parameters correspond to the configuration items in the SVG rendering template, and the SVG rendering template is used to draw the target radar chart according to each configuration item in each configuration item and the parameter corresponding to the configuration item in the input parameters. The input parameters at least include: the first coordinate value of each of the N indicators.
3. The method according to claim 2, characterized in that, The configuration items of the SVG rendering template at least include a path drawing function. The obtaining the target radar chart based on the scalable vector graphics SVG rendering template and input parameters includes: According to the first coordinate value of each of the N indicators, determine the second coordinate value of the indicator in the SVG coordinate system; According to the path drawing function and the second coordinate value of each of the N indicators, draw the target radar chart.
4. The method according to claim 2 or 3, characterized in that, The radar chart drawing request also corresponds to a second object, and the method further includes: In response to the radar chart drawing request, obtain the second value of each of the N indicators included in the radar chart to be drawn, where the second value of an indicator is the value of the indicator of the second object corresponding to the radar chart drawing request; According to the size, the maximum value of each of the N indicators, and the second value of each of the N indicators, calculate the third coordinate value corresponding to the second value of each of the N indicators in the first rectangular coordinate system; The obtaining the target radar chart based on the SVG rendering template and input parameters includes: Based on the SVG rendering template and the first coordinate value corresponding to the first value of each of the N indicators in the input parameters, draw a first radar chart corresponding to the first object; Based on the SVG rendering template and the third coordinate value corresponding to the second value of each of the N indicators in the input parameters, draw a second radar chart corresponding to the second object; Among them, the target radar chart includes a layer corresponding to the background, a layer corresponding to the first radar chart, and a layer corresponding to the second radar chart.
5. The method according to claim 4, wherein, the SVG rendering template further includes at least one of the following configuration items: a background configuration item, a first radar chart configuration item, and a second radar configuration item, and the input parameters further include at least one of the following parameters corresponding to the configuration items in the SVG rendering template: a background configuration value, a first radar chart configuration value, and a second radar chart configuration value. The background configuration value is used to indicate the drawing style of the background, the first radar chart configuration value is used to indicate the drawing style of the first radar chart, and the second radar chart configuration value is used to indicate the drawing style of the second radar chart.
6. The method according to any one of claims 1-5, wherein, the method further includes: using SVG to set the animation parameters of the cascading style sheet CSS; performing animation rendering on the target radar chart according to the animation parameters, and the effects of the animation rendering include at least one of the following effects: gradual change in width, gradual change in height, gradual change in transparency, gradual change in position, 2D and 3D rotation, tilt, displacement, or scaling.
7. The method according to any one of claims 1-6, wherein, if N is equal to 3, calculating the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators, includes: constructing an equilateral triangle covering the 3 indicators included in the radar chart to be drawn in the first rectangular coordinate system; determining the radius of the circumscribed circle of the equilateral triangle and the fourth coordinate value of the center of the circumscribed circle based on the side length of the equilateral triangle; determining the first coordinate value corresponding to the first value of each of the 3 indicators in the first rectangular coordinate system based on the ratio between the maximum value of each of the 3 indicators and the first value of the indicator, the radius, and the fourth coordinate value.
8. A rendering device for a radar chart, wherein, it includes: an acquisition unit, configured to acquire the first value of each of the N indicators included in the radar chart to be drawn for the first object in response to a radar chart drawing request for the first object, and the first value of the indicator is the value of the indicator of the first object corresponding to the radar chart drawing request, and N is an integer greater than or equal to 3; a calculation unit, configured to calculate the first coordinate value corresponding to the first value of each of the N indicators in the first rectangular coordinate system according to the size of the radar chart to be drawn, the maximum value of each of the N indicators, and the first value of each of the N indicators; a rendering unit, configured to obtain a target radar chart based on the first coordinate value of each of the N indicators, and the target radar chart is used to describe the value distribution of the N indicators of the first object.
9. An electronic device, Characterized in that, the electronic device includes: a processor and a memory; the memory is used for storing instructions or programs; the processor is used for executing the instructions or programs in the memory so that the electronic device executes the method according to any one of claims 1-7.
10. A readable medium, characterized in that, instructions or programs are stored in the readable medium, and when the instructions or programs run on a processor, the processor is caused to execute the method according to any one of claims 1-7.