Graphic display method and electronic device

By applying text processing strategies in the graph display, such as branch processing and keyword extraction, the problem of excessive text display caused by data fluctuations is solved, and clear and readable text information is conveyed, improving the user experience.

CN114662450BActive Publication Date: 2025-03-11ALIBABA (CHINA) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210220861.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2025-03-11
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

In the chart caused by data fluctuations, excessive text information is difficult to clearly display. Existing solutions such as truncation or rotation angle display have problems such as text information loss and reading difficulties.

Method used

By determining the target text in the chart and the corresponding text processing strategy, we adopt strategies such as branch processing, keyword extraction, and hidden processing to ensure that the text information is clearly readable in the chart display.

Benefits of technology

It realizes that while ensuring the clear chart, it fully conveys text information and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114662450B_ABST
    Figure CN114662450B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for displaying a chart and an electronic device. The method includes the following steps: determining the display type of the text in the chart to be displayed; obtaining the text processing strategy corresponding to the display type; determining the target text in the chart; processing the target text according to the text processing strategy to obtain the text display object and display area after the target text is processed; when displaying the chart, displaying the text display object at the display area of ​​the chart. The technical solution provided in the embodiment of the present application can not only make the chart appear clear, but also ensure that the text information in the chart is fully conveyed to the user, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a chart display method and electronic equipment. Background Art

[0002] As the era of big data continues to deepen, the daily output of supply chain operation data is increasing, and users are in urgent need of graphical tools to analyze and reveal the information in the data. Charts are widely used in the field of data analysis because they can intuitively and vividly analyze and describe various attributes of data (such as time and quantity).

[0003] Usually, the output of supply chain operation data often fluctuates greatly due to various factors such as big promotions and seasonal sales, which will lead to a large data span, resulting in extreme values ​​in the chart when presenting data, and further causing some long text in the chart to be unclear. To address this problem, existing solutions often use methods such as truncating long text or rotating the angle to display long text to display the chart, but this has problems such as text information loss and difficult to read text. Summary of the invention

[0004] In view of the above problems, the present application provides a diagram display method and an electronic device that solve the above problems or at least partially solve the above problems.

[0005] In one embodiment of the present application, a method for displaying a chart is provided. The method comprises:

[0006] Determine the display type of the text in the chart to be displayed;

[0007] Obtaining a text processing strategy corresponding to the display type;

[0008] determining target text in the chart;

[0009] According to the text processing strategy, the target text is processed to obtain a text display object and a display area after the target text is processed;

[0010] When displaying the chart, the text display object is displayed in the display area of ​​the chart.

[0011] In another embodiment of the present application, a method for displaying a chart is also provided. The method comprises:

[0012] Acquire a text area of ​​a chart to be displayed and a first text to be displayed in the text area;

[0013] determining a character size of the first text;

[0014] Determining whether the first text can be displayed in the text area according to the number of characters included in the first text, the character size, and area information of the text area;

[0015] If not, extracting at least one keyword adapted to the text area from the first text;

[0016] When displaying the chart, the at least one keyword is displayed in the text area.

[0017] In one embodiment of the present application, an electronic device is provided. The electronic device includes: a processor and a memory; wherein the memory is used to store one or more computer instructions; and the processor is coupled to the memory and is used to execute the one or more computer instructions to implement the steps in the above-mentioned embodiments of the diagram display method.

[0018] A technical solution provided by an embodiment of the present application is to process the target text in the determined chart according to the text processing after determining the display type of the text in the chart to be displayed and obtaining the text processing strategy corresponding to the display, thereby obtaining the text display object and display area after the target text is processed, so as to display the text display object in the display area of ​​the chart when displaying the chart. The solution provided by this embodiment is used to realize chart display, which can not only make the chart appear clear, but also ensure that the text information in the chart is fully conveyed to the user, thereby improving the user experience.

[0019] Another technical solution provided by the embodiment of the present application is to obtain the text area of ​​the chart to be displayed and the first text to be displayed in the text area, and then further determine whether the first text can be displayed in the text area according to the determined character size of the first text, the number of characters contained in the first text and the area information of the text area, and when it is determined that the text cannot be displayed in the text area, at least one keyword that is adapted to the text area is extracted from the first text, so that at least one keyword is displayed in the text area when the chart is displayed. By realizing chart display by extracting keywords in this way, it is possible to ensure that the text information in the chart can be fully conveyed to the user while ensuring the clarity of the chart, which is conducive to improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1aAn example of a chart provided for an embodiment of the present application;

[0022] Figure 1b A diagram example provided for another embodiment of the present application;

[0023] Figure 1c A diagram example provided for another embodiment of the present application;

[0024] Figure 2 A flowchart of a diagram display method provided in one embodiment of the present application;

[0025] Figure 3 A diagram example provided for another embodiment of the present application;

[0026] Figure 4a A diagram example provided for another embodiment of the present application;

[0027] Figure 4b A diagram example provided for another embodiment of the present application;

[0028] Figure 5a A diagram example provided for another embodiment of the present application;

[0029] Figure 5b A diagram example provided for another embodiment of the present application;

[0030] Figure 6 A diagram example provided for another embodiment of the present application;

[0031] Figure 7 A flowchart of a diagram display method provided in another embodiment of the present application;

[0032] Figure 8 A structural block diagram of a chart display device provided in one embodiment of the present application;

[0033] Fig. 9 A structural block diagram of a chart display device provided in another embodiment of the present application;

[0034] Fig.10 A structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0035] Charts refer to graphic structures displayed on the display interface that can intuitively show the attributes of data statistics (such as time, quantity, etc.), and play a key role in data knowledge mining and intuitive and vivid perception of data information. Users can view the corresponding key information more intuitively and conveniently through charts. For example, investors can accurately obtain the financial data of the company through charts, and use the company's financial data for investment analysis. There are various types of charts. Generally speaking, charts can be divided into two categories according to whether there is a coordinate axis: charts with axes (such as bar charts, line charts, column charts, etc.) and charts without axes (such as pie charts); among them, the coordinate axis in the chart with axes is used to represent the data dimension, such as Figure 1c The bar chart with X-axis and Y-axis shown in the figure indicates that the data corresponding to the bar chart is two-dimensional data. Whether it is an axis chart or an axisless chart, it generally has multiple chart elements that reflect data information. The chart element may refer to but is not limited to a column, a block, a point, etc. in the chart, for example, a point on the line of a line chart (not shown in the figure), Figure 1a or the fan-shaped blocks in the fan-shaped chart shown in 1b, such as Figure 1c The rectangular blocks in the bar chart shown are all chart elements that reflect data information in the corresponding chart; and there are also multiple texts used to explain the chart so that users can easily understand the chart, such as numerical texts or character texts, etc. Specifically: for example, the title text, through which users can quickly understand the function of the chart; for another example, the text associated with the chart element (also called data mark or data label), through which users can quickly understand the category, data volume, percentage, etc. corresponding to the data reflected by the chart element. For a detailed introduction to the chart elements and texts included in the chart, please refer to the relevant content below.

[0036] When using charts to present data, data fluctuations are inevitable due to certain factors, which can cause some long text in the chart to be unable to be displayed clearly, especially the long text associated with the chart elements. To address this problem, existing solutions mostly use the following processing methods:

[0037] 1. No treatment. No treatment means that the overlong text that cannot be clearly displayed in the chart is not processed at all, allowing the overlong text to exceed the corresponding block, or allowing the overlong text to overlap with other surrounding text. For details, see Figure 1a In the sector chart shown, for the text that cannot be clearly displayed in the sector chart, such as "Category 1", the inaction method is adopted, allowing "Category 1" to exceed the corresponding sector block 1. Although the inaction method can ensure the integrity of the text information displayed in the chart, it will make the text difficult to read.

[0038] 2. How to deal with truncating overlong texts. Truncating overlong texts means retaining a certain number of keywords in the text for display and hiding other content except a certain number of keywords. Figure 1b An example is shown of using a truncated display method to display text that is too long to be displayed clearly in a chart. Although this truncated display method can ensure that the chart is presented clearly, the truncated text only displays part of the content of the text, resulting in loss of text information.

[0039] 3. How to handle text that is too long when displayed by rotating the angle. Figure 1c An example of rotating the text (such as Zhao####, Li####, Han####, etc.) that is too long to be clearly displayed in the chart is shown. This rotation angle display method has the problem that the rotated text is not easy to read.

[0040] In order to solve the problems existing in the above-mentioned existing solutions, each embodiment of the present application provides a technical solution for graph display. In the graph display solution provided by the present application, the following text processing strategies are introduced to address the problem that too long text cannot be displayed clearly and understandably: a strategy for dividing the text into lines, a strategy for extracting keywords from the text, a strategy for staggered display with overlapping text, and a strategy for hiding the text. By combining these text processing strategies to achieve graph display, it is possible to ensure that the graph is presented clearly while allowing the text information in the graph to be fully conveyed to the user. In order to enable personnel in the technical field to better understand the solution of the present application, the technical solution in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application.

[0041] In some processes described in the specification, claims and the above-mentioned figures of the present application, multiple operations appearing in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. In addition, the following embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0042] The following is a detailed description of the chart display method provided in each embodiment of the present application.

[0043] Figure 2 A flow chart of a method for displaying charts provided in one embodiment of the present application is shown. The execution subject of the method for displaying charts provided in the embodiment of the present application is an electronic device having data processing logic, and the electronic device may be a client or a server; wherein the client may be any terminal device such as a mobile phone, a tablet computer, a smart wearable device, etc.; the server may be a commonly used server (such as a single server or a service cluster composed of multiple functional servers), a cloud or virtual server, etc., and the embodiment of the present application does not specifically limit this. The following content is a detailed introduction to the technical solution provided in this embodiment from the perspective of the execution subject being the client. As Figure 2 As shown, the diagram display method provided in this embodiment includes the following steps:

[0044] 101. Determine the display type of the text in the chart to be displayed;

[0045] 102. Obtain a text processing strategy corresponding to the display type;

[0046] 103. Determine the target text in the chart;

[0047] 104. Process the target text according to the text processing strategy to obtain a text display object and a display area after the target text is processed;

[0048] 105. When displaying the chart, display the text display object in the display area of ​​the chart.

[0049] In practical applications, see Figure 3 The bar chart shown in the figure is usually composed of the chart area, drawing area, chart elements that reflect data information (such as data series, data points, legends, coordinate axes, etc.) and text. Specifically:

[0050] The chart area refers to the entire chart, and the plot area is a portion of the chart area. Figure 3 In the two-dimensional bar chart shown, the drawing area is a rectangular area bounded by two coordinate axes, namely the vertical coordinate axis (ie, the Y axis) and the horizontal coordinate value (ie, the X axis) and including scale lines.

[0051] A data series is a group of data points, a row or column of numerical data in a chart. Each group of data series is represented in the same shape, color, or pattern in the chart (such as Figure 3The data series corresponding to the ###### area 1 division shown are all represented in medium gray). One or more data series can be drawn in a chart, but there is only one data series in a pie chart and different data series in a pie chart can be represented by different colors or patterns. When a chart includes multiple data series, the meaning of the chart is often unclear. In this case, a legend can be used to explain the data series. The legend is usually located on the right side of the chart and consists of many small items. Each small item represents a mapping relationship between the chart and the content. Therefore, users can quickly understand the meaning of each data series through the legend.

[0052] Data point, a data point is a specific value in a cell in an electronic worksheet (such as Excel), which is displayed in a chart as a rectangle, line, column, sector or other shape. For example, Figure 3 Each distance block in the bar chart shown in is a data point; Figure 1b Each pie segment (ie, sector segment) in the pie chart shown in FIG. 1 is a data point, and so on.

[0053] The coordinate axis is used to represent the data dimension corresponding to the data presented in the chart, and has the function of classifying and measuring the data. For example, Figure 3 The two-dimensional bar chart shown in has two coordinate axes: the X-axis (also called the classification axis) for classifying data and the Y-axis (also called the value axis) for measuring data. A three-dimensional chart has three coordinate axes, while a pie chart has no coordinate axes. For the specific role played by the coordinate axis, a corresponding numerical text or character text that can identify the role of the coordinate axis is usually added. For ease of description, in this embodiment, the text added to the coordinate axis in the chart is called the coordinate axis text. For example, in Figure 3 In the bar chart shown, the coordinate axis text added for the Y-axis includes numerical texts representing the sales volume of a certain commodity, such as 0, 1000, 2000, 3000, 4000, 5000, etc.; the coordinate axis text added for the Y-axis includes character texts representing quarters, such as Quarter One, Quarter Two, Quarter Three, Quarter Four, etc.

[0054] Text, the text in the chart usually includes two types of text: numerical text and character text. It is mainly used to explain the chart so that users can easily understand the content of the chart. For example, the title text in the chart can help users quickly understand the function of the chart. Another example is the text associated with the chart elements that reflect data information. Users can quickly understand the category, data volume, percentage, etc. of the data represented by the chart elements through the text associated with the chart elements. Specifically, as described above, Figure 3 The axis text shown is Figure 3A text associated with a rectangular block and / or coordinate axis in a bar chart shown; and, Figure 1a The texts in the corresponding fan-shaped blocks, such as category 1, category 2, category 3, etc., are related to Figure 1a The text associated with the pie-shaped blocks in the pie-shaped chart shown; and, Figure 5a The text outside the corresponding fan-shaped blocks, such as "Overseas: 0.92%", "North China: 11.44%", etc., are Figure 5a The text associated with the fan-shaped blocks in the diagram shown; further, Figure 4a In the bar chart shown, the numerical text such as 42.3, 93.4, etc. located above the rectangular block (i.e. Figure 4a The text in Part B above the bar indicated in the figure is the text in Part B above the bar. Figure 4a Another type of text associated with the bar chart block in the bar chart shown above. Based on the text associated with the chart elements shown above, the text in the chart can be divided into the following three categories according to the position relationship of the text relative to the chart element: out-of-area text, in-area text and axis text; among which, out-of-area text refers to text displayed outside the corresponding element area of ​​the chart element, for example, Figure 4a The indicated texts such as 42.3, 93.4, etc. are located above the B part of the block; the text in the area refers to the text displayed in the corresponding element area of ​​the chart element, for example, Figure 4b The text in part C, such as 154, 147, etc., is located inside the rectangular block. Figure 4a For a detailed introduction to the text in Part A that indicates the coordinate axes in the chart, please refer to the relevant content above.

[0055] Based on the above content, the chart to be displayed in the above 101 may include but is not limited to multiple chart elements and multiple texts, and one chart element is associated with at least one text. For example, Figure 4a The rectangular block 1 shown in the figure is associated with the numerical text "94.2" located above the top of the rectangular area 1 and the corresponding coordinate axis text "Category 0837". The display types of text include but are not limited to: out-of-area text displayed outside the element area corresponding to the chart element, in-area text displayed within the element area corresponding to the chart element, and coordinate axis text. Specifically, when determining the display type of the text in the chart to be displayed, after obtaining the text in the chart to be displayed, the positional relationship between the text and the chart elements and / or coordinate axes in the chart can be analyzed based on the graphic structure of the chart, thereby determining the display type of the text in the chart to be displayed.

[0056] It should be noted that, in addition to the above-mentioned chart area, drawing area, data series, legend, data point, coordinate axis and text (including numerical text and character text), a chart may also include other components, such as grid lines, error lines, trend lines, chart titles, etc. For a detailed introduction to other components that may be included in a chart, please refer to the existing content, which will not be described in detail here. Among the above, elements such as legends, data series, trend lines, etc. used to compose charts are called drawing elements in the process of generating charts, which are converted from the obtained supply chain operation data (such as the company's financial data). The graphic structure of the chart can be used to characterize the positional relationship of the drawing elements in the chart.

[0057] In order to realize that when displaying a chart, the text information in the chart can be fully conveyed to the user while ensuring that the chart is presented clearly, this embodiment configures at least one corresponding text processing strategy in advance for texts of different display types. The text processing strategies correspondingly configured between texts of different display types can be the same or different, which is not limited here. Specifically, the text processing strategy configured for the text outside the region includes but is not limited to the first sub-strategy for processing the text in lines, the second sub-strategy for extracting keywords from the text, and the third sub-strategy for staggered display with overlapping text; further, the text processing strategy configured for the text in the region includes, in addition to the first sub-strategy and the second sub-strategy described above, a fourth sub-strategy for hiding the text; further, the text processing strategy configured for the coordinate axis text may include but is not limited to the first sub-strategy and the second sub-strategy described above. The above-mentioned first sub-strategy, second sub-strategy, third sub-strategy and fourth sub-strategy, etc., these text processing strategies can be pre-stored in but not limited to a local corresponding storage medium so as to be called when needed. For a specific introduction to the text processing strategy, please refer to the relevant content below. Based on this, in the above 102, after the display type of the text in the to-be-displayed chart is determined in step 101, the text processing strategy corresponding to the display type can be obtained from the storage medium pre-stored with the corresponding text processing strategy.

[0058] After obtaining the text processing strategy corresponding to the display type, the main reasons why some texts in the chart cannot be clearly and completely conveyed to the user when displaying the chart are: the length of the text is too long, and the size of the text display space is limited. Under the limitation of the text display space, it is easy to cause the text that is too long to be fully conveyed; and / or, at least two texts overlap, and / or the text is out of range; wherein, the text out of range means that the text exceeds the range of the element area corresponding to the chart element associated with it. The overlap of at least two texts and the text out of range are likely to cause the text to not be clearly conveyed to the user when displaying the chart, and the reason for the two is usually that the graphic structure of the chart changes due to data fluctuations. For example, see Figure 1b In the pie chart shown, due to data fluctuations, the corresponding sizes of sector blocks 2 and 3 in the chart are too small, which easily leads to the overlap of the text associated with sector block 2 (i.e., "Category 1") and the text associated with sector block 3 (i.e., "Others"); further, see Figure 1a The sector chart (a type of pie chart) shown has a sector block 1 in the chart that is too small in size due to data fluctuations, which can easily cause the text associated with sector block 1 (i.e., "category one") to exceed the range of the element area corresponding to the corresponding sector block 1. Based on the above content, this embodiment only needs to process at least one of the text that is too long, at least two overlapping texts, and out-of-range texts in the chart according to the text processing strategy to ensure that the text that is too long, at least two overlapping texts, and out-of-range texts in the chart can be clearly and clearly conveyed to the user when the chart is displayed. This can effectively achieve the purpose of the present embodiment of ensuring that the chart is presented clearly while also being able to clearly and completely convey all text information in the chart to the user, and can also reduce the amount of data processing. That is to say, it is sufficient to process target texts in the chart, such as texts that are too long, at least two texts that overlap, and texts that are out of range, according to the text processing strategy. In specific implementation, long texts whose length is greater than a set threshold among multiple texts contained in the chart can be considered as long texts, and based on the graphic structure of the chart, it can be determined whether there are at least two texts that overlap in the chart and / or whether there is out-of-range text whose text exceeds the area range of the corresponding element of the chart element associated with it.

[0059] That is, in a specific achievable technical solution, the above 103 “determining the target text in the chart” may include at least one of the following:

[0060] 1031. Searching, from among the multiple texts included in the chart, whether there is a long text whose length is greater than a threshold; when the chart contains the long text, determining the long text as a target text;

[0061] 1032. Based on the graphic structure of the chart, determine whether there are at least two texts that overlap; if so, determine the at least two texts as target texts;

[0062] 1032. Based on the graphic structure of the chart, determine whether there is out-of-range text that exceeds the area range of the element corresponding to the corresponding chart element in the chart; if there is, determine the out-of-range text as the target text.

[0063] In appeal 1031, when searching for long texts among the multiple texts contained in the chart, the threshold can be flexibly set according to the actual situation. For example, if the text length is in inches, the threshold can be 2in, 4in, 5in, etc., which is not limited here. Taking the threshold of 4in as an example, for the multiple texts contained in the chart, after determining the text length corresponding to each text in the multiple texts based on the character size of each text in the multiple texts and the number of characters contained in the text, as long as the text length is greater than 4in, it is considered to be a long text.

[0064] In the above 1032 and 1033, since the graphic structure of the chart can characterize the positional relationship of the components of the chart, such as the chart elements, texts, legends, etc., for this reason, by calling the data information related to the graphic structure in the background, and analyzing and processing the data information, it is possible to determine whether there are at least two texts with overlapping texts, and / or determine whether there is an over-range text whose text exceeds the area range of the corresponding element of the corresponding chart element in the chart. Of course, in some other embodiments, an image recognition algorithm can also be used to identify the graphic structure of the chart, and a corresponding text recognition algorithm can be used to identify the text in the chart, so as to implement the graphic structure of the chart, determine whether there are at least two texts with overlapping texts, and / or determine whether there is an over-range text whose text exceeds the area range of the corresponding element of the corresponding chart element in the text chart, and this embodiment does not specifically limit this. For the specific implementation of the above 1032 and 1033, please refer to the existing content.

[0065] Further, based on the above content, it can be known that there are generally various reasons why some texts in a chart cannot be clearly conveyed to the user, and this embodiment configures multiple text processing strategies for texts of different display types based on these reasons, that is, there are multiple text processing strategies corresponding to the target text. Based on this, in order to ensure that the target text can be more effectively and clearly conveyed to the user when displaying the chart, the above 104 can be combined with the reasons why the target text cannot be clearly conveyed to the user when processing the target text according to the text processing strategy. At least one text processing strategy that is suitable for processing the target text can be selected from the multiple text processing strategies corresponding to the target text to process the target text. When the processing is specifically implemented, the area information of the text area corresponding to the target text and the text display size of the target text can be obtained. Combined with the reasons why the target text cannot be clearly conveyed to the user, such as whether the target text cannot be clearly conveyed to the user because it overlaps with the surrounding text, etc., and at least one text processing strategy that is suitable for processing the target text can be selected from the multiple text processing strategies corresponding to the target text according to the area information and the text display size. Based on this,

[0066] In an achievable technical solution, when the above-mentioned display type is out-of-region text, and correspondingly, the text processing strategy corresponding to the out-of-region text includes: a first sub-strategy for processing the text in lines, a second sub-strategy for extracting keywords from the text, and a third sub-strategy for staggered display with overlapping text, the above-mentioned 104 "processing the target text according to the text processing strategy" may specifically include:

[0067] A11, obtaining area information of a text area corresponding to a target text and a text display size of the target text;

[0068] A12, when the target text does not overlap with surrounding texts, selecting at least one sub-strategy from the first sub-strategy and the second sub-strategy according to the region information and the text display size; and processing the target text using the selected at least one sub-strategy;

[0069] A13. When the target text overlaps with the surrounding text, the overlapping size of the target text and the movable control of the target text, i.e., the movable space of the surrounding text, are obtained, and the text area corresponding to the target text is adjusted and / or moved using the third sub-strategy to be staggered with the surrounding text.

[0070] In the above A11, the area information of the text area corresponding to the target text includes but is not limited to the size, position and other information of the area. The acquisition of the area information can be achieved by referring to the existing related technical content. The text display size of the target text can be determined according to the display character size configured by the user for the target text (or the system default character size) and the character data contained in the target text.

[0071] For text outside the region, the reasons why the text outside the region cannot be displayed clearly and completely are generally: the text overlaps with the surrounding text, and the text is too long. Therefore, when the above A12 determines that the target text does not overlap with the surrounding text, it can be considered that the target text is too long and cannot be displayed clearly and completely to the user when displaying the chart. At this time, according to the region information of the target text corresponding to the text and the text display size of the target text, at least one of the first sub-strategy and the second sub-strategy can be used to process the target text. Exemplarily,

[0072] For example, based on the area information and the text display size, the number of text lines that the text area corresponding to the target text can accommodate can be determined first, and then based on the number of text lines and the text display size, it can be determined that by dividing the target text into lines, the target text can be clearly displayed in the text area. In this case, only the first sub-strategy can be selected to divide the target text into lines, so as to obtain the text display object and display area (located in the text area) after the target text is divided into lines. Subsequently, by executing the above step 105, it can be achieved that when displaying a chart, the text display object after the target text is divided into lines is displayed in the display area of ​​the chart.

[0073] Figure 5a The text 1 (ie, "Northeast Region 3: 9.84%)" shown in the chart shown in the figure is a text display object obtained by processing the corresponding target text by line breaking using the first sub-strategy.

[0074] For another example, when it is determined based on the area information and the text display size that even if the target text is divided into lines, it is still impossible to clearly display the entire target text in the text area, the first sub-strategy and the second sub-strategy can be selected at the same time, or the second sub-strategy can be selected to process the target text. In specific processing, the target text can be processed using the second sub-strategy first to extract the corresponding keywords from the target text. Specifically: the number of keywords to be extracted can be determined based on the area information and the text display size; then, the target text can be semantically recognized using the second sub-strategy, and based on the semantic recognition result, a number of keywords that can reflect the central semantics of the target text can be extracted from the target text, and based on the text display size corresponding to the number of keywords (or based on the text display size corresponding to the number of keywords and the text display size corresponding to the abbreviation mark (such as the ellipsis "...") that needs to be added), it is determined whether the number of keywords (or the number of keywords and the abbreviation mark) can be clearly and completely displayed in the text area without line processing; if it can, only the second sub-strategy can be selected to process the target text; otherwise, if it cannot, the first sub-strategy and the second sub-strategy can be selected at the same time to process the target text. The purpose of adding the abbreviation mark above is to prompt the user that the number of keywords is the abbreviation of the target content. By subsequently executing step 105, it is possible to display a number of keywords in the corresponding display area of ​​the chart when displaying the chart; in addition, a corresponding reduction mark can also be displayed in the corresponding display area to prompt the user that the number of keywords displayed in the display area are the reduced content of the target text.

[0075] Figure 5a The text 2 (i.e., "South China............1435 District: 23%") shown in the chart shown in the figure is the text display object obtained by processing the complete text content corresponding to text 2 (i.e., target text 3) using the first sub-strategy and the second sub-strategy at the same time.

[0076] It should be noted here that, when the target text is processed using the second sub-strategy to obtain the text display object and display area corresponding to the target text, when the chart is displayed by executing step 105, when the text display object (or the text object and the corresponding abbreviated mark) is displayed in the display area of ​​the chart, a hover event for displaying the complete text content corresponding to the text display object can be added to the display area. Using this hover event, when the user operates the mouse such as moving the mouse to the display area corresponding to the text object, the specified first function can be triggered. After the first function is triggered, the complete text content corresponding to the text display object can be displayed. For example, continue to refer to Figure 5aAs shown, when the arrow representing the mouse moves to the display area corresponding to text 2, the first function will be triggered to make the complete text corresponding to text 2 (i.e., text 3) be displayed in the floating window. When the user operates the mouse such as moving the mouse out of the display area corresponding to the text object, the specified second function can be triggered. After the second function is triggered, the complete text corresponding to the displayed text 2 disappears. In specific implementation, the hover event described above can be implemented using the hover method in combination with the Tooltips tool; wherein the hover method is a custom method that imitates the hover event (such as the mouse moving onto an object and moving out of the object), which can provide a "stay in" state for frequently used tasks; the Tooltips tool is used to display the prompt information of the interface to the user, and the prompt information only appears when the user interacts with the elements in the graphical user interface (GUI). Tooltips are usually triggered in two ways: by mouse hovering and by keyboard hovering. Keyboard hovering refers to keeping the keyboard focus on the same element for a long time.

[0077] It should be further explained that, when the second sub-strategy is used to extract keywords from the target text, in addition to the semantic recognition method described above, in some other embodiments, the following method of extracting the first and last words of the text can also be used: based on the regional information and the text display size, the number of keywords to be extracted is determined; the N keywords located at the front of the target text, that is, the M keywords located at the tail, are extracted to obtain the number of keywords; wherein N and M are both natural numbers, and the sum of N and M is less than or equal to the number of keywords to be extracted. The text 2 shown in Figure 5 uses this method of extracting the first and last words of the text to extract keywords such as "South China, 4135 District: 23%" shown in the text 2 from the complete text corresponding to the text 2 (i.e., the target text 3).

[0078] Furthermore, when the above A13 determines that the target text overlaps with the surrounding texts, it is considered that the target text cannot be clearly and completely displayed to the user when displaying the chart due to the overlap with the surrounding texts. At this time, the overlapping size of the target text, the movable space of the target text and the movable space of the surrounding texts can be obtained, and the third sub-strategy can be used to adjust and / or move the text area corresponding to the target text so that the target text is staggered with the surrounding text. For example, when the target text overlaps with the upper text above it, based on the overlapping size of the target text, the movable space of the target text and the movable space of the upper text, if it is determined that the size corresponding to the movable space of the target text is greater than or equal to the overlapping size, the target text can be moved downward by only the overlapping size to stagger the target text with the upper text; if it is determined that the size corresponding to the movable space of the target text is smaller than the overlapping size, then based on the movable space of the target text and the movable space of the upper text, the target text can be moved downward by M1 size and the upper text can be moved upward by M2 size, wherein the sum of the M1 size and the M2 size is greater than or equal to the overlapping size, the M1 size is smaller than the size corresponding to the movable space of the target text, and the M2 size is smaller than the size corresponding to the movable space of the upper text.

[0079] Figure 5a The two texts "Overseas: 0.92%" and "Southwest: 0.52%" located in the rectangular frame 10 shown in the chart represent the target object obtained by processing the two overlapping texts "Overseas: 0.92%" and "Southwest: 0.52%" (not shown in the figure) using the third sub-strategy.

[0080] In another feasible technical solution, when the above-mentioned display type is text in the region, and correspondingly, the text processing strategy corresponding to the text in the region includes: a first sub-strategy for dividing the text into lines, a second sub-strategy for extracting keywords from the text, and a fourth sub-strategy for hiding the text, the above-mentioned 104 "processing the target text according to the text processing strategy" may specifically include:

[0081] A21, obtaining area information of a text area corresponding to a target text and a text display size of the target text;

[0082] A22. Select at least one sub-strategy from the first sub-strategy, the second sub-strategy and the fourth sub-strategy according to the area information and the text display size;

[0083] A23. Process the target text using at least one selected sub-strategy.

[0084] For a detailed description of the above step A21, please refer to the relevant description of the above step A11.

[0085] In A22 and A23 above, for the text in the area (such as Figure 5b The reason why the text in the area cannot be displayed clearly is generally because the text is too long or the size of the element area corresponding to some chart elements in the chart is too small due to data fluctuations. In the case where the target text cannot be displayed clearly and completely due to the length of the text, at least one of the first sub-strategy and the second sub-strategy can be used to process the target text. For the specific implementation of using at least one of the first sub-strategy and the second sub-strategy to process the target text, please refer to the relevant content in the above steps A12 to A13, which will not be described in detail here.

[0086] Figure 5b The text 2 shown in the diagram is shown in the figure. The first sub-strategy and the second sub-strategy are used to process the corresponding target text, and the obtained target text is a text display object after the processing.

[0087] When the size of the element area corresponding to the chart element associated with the target text in the chart is too small due to data fluctuations, so that the target text cannot be clearly and completely conveyed to the user when the chart is displayed, the third sub-strategy can be used to hide the target text, and the target text will not be displayed when the chart is displayed.

[0088] Figure 5b The fan-shaped blocks 4 and 5 shown in the figure show the situation where the third sub-strategy is adopted to hide the texts associated with the fan-shaped blocks 4 and 5 respectively.

[0089] It should be noted that, when the target text is hidden by the third sub-strategy, the chart element associated with the target text is added with a corresponding hover event, such as Figure 5b The fan-shaped blocks 4 and 5 shown in the figure have corresponding hover events added. When the user operates such as moving the mouse onto the fan-shaped block 4, the text content associated with the fan-shaped block 4 can be automatically displayed; and when the mouse moves out of the fan-shaped block 4, the displayed text content associated with the fan-shaped block 4 will automatically disappear. For a detailed introduction to the hover time, please refer to the relevant content above.

[0090] In another feasible technical solution, when the display type is coordinate axis text, and the text processing strategy corresponding to the coordinate axis text includes: a first sub-strategy for dividing the text into lines and a second sub-strategy for extracting keywords from the text, the “processing the target text according to the text processing strategy” in the above 104 may specifically include:

[0091] A31, obtaining area information of a text area corresponding to a target text and a text display size of the target text;

[0092] A32. Select at least one sub-strategy from the first sub-strategy and the second sub-strategy according to the area information and the text display size;

[0093] A33. Process the target text using at least one selected sub-strategy.

[0094] For the specific implementation of the above steps A31 to A33, please refer to the relevant contents in the above steps A11 to A12.

[0095] Figure 6 The coordinate value text in the rectangular frame 20 shown in the diagram is the text display object obtained after the target text is processed by the first sub-strategy and the second sub-strategy.

[0096] Based on the text display object and display area obtained after the target text processing through the above step 104, it is necessary to display the text display object in the display area of ​​the chart so as to present it to the user. Generally, the automatic process of displaying the chart is as follows: after obtaining the supply chain operation data and forming the operation data into table data (also called graphic data) through Excel, the graphic grammar layer is called through the graphic data, so that the graphic data is converted into drawing elements to be rendered (such as legends, blocks (i.e., chart elements), broken lines, etc. in the chart) through the graphic grammar layer, and a graphic structure for representing the positional relationship of the drawing elements in the chart is generated; further, the rendering layer renders the drawing elements to display the chart to the user. The above rendering layer is the bottom layer in the chart generation framework, which can be understood as a display canvas for displaying the chart to the user. Based on this, in the above 105, on the basis of obtaining the text display object after the target text processing through the above step 104, when realizing the display image, the text display object can be rendered by calling the rendering layer, so as to realize the display of the text display object in the display area of ​​the chart.

[0097] In specific implementation, the rendering layer can render the text display object according to the graphic structure through drawing methods such as canvas 2D, webgl, etc. (i.e., chart rendering mechanism), so as to display the text display object in the display area of ​​the graph.

[0098] The rendering layer can also set up multiple chart rendering mechanisms at the same time and call them through a unified interface. In this case, the rendering layer is called according to the graphic structure, so that the rendering layer can realize the rendering of the text display object according to the graphic structure. The rendering layer realizes the rendering of the text display object according to the graphic structure, which can be specifically: calling the rendering layer according to the graphic structure, so as to determine the target chart rendering mechanism among multiple chart rendering mechanisms through the rendering layer calling interface, so as to realize the rendering of the text display object based on the target chart rendering mechanism. This rendering method can select the corresponding chart rendering mechanism for chart rendering according to different scenarios, which can adapt to different scenarios.

[0099] In summary, the technical solution provided by this embodiment is to process the target text in the determined chart according to the text processing after determining the display type of the text in the chart to be displayed and obtaining the text processing strategy corresponding to the display, thereby obtaining the text display object and display area after the target text is processed, so as to display the text display object at the display position of the chart when displaying the chart. When realizing the display of the chart, this technical solution can not only make the chart appear clear, but also ensure that the text information in the chart is fully conveyed to the user, which can improve the user experience.

[0100] Figure 8 The flowchart of the diagram display method of another embodiment of the present application is shown in FIG. Figure 2 The execution subject of the diagram display method shown in the figure will not be described in detail here. Figure 8 The chart display method includes the following steps:

[0101] 201. Acquire a text area of ​​a chart to be displayed and a first text to be displayed in the text area;

[0102] 202. Determine the character size of the first text;

[0103] 203. Determine whether the first text can be displayed in the text area according to the number of characters included in the first text, the character size, and the area information of the text area;

[0104] 204. If not, extract at least one keyword adapted to the text area from the first text;

[0105] 205. When displaying the chart, display the at least one keyword in the text area.

[0106] In the above 201, the text area can be obtained by planning corresponding text areas for multiple texts in the chart information after obtaining the chart information of the chart to be displayed by taking corresponding technical means. After completing the planning of corresponding text areas for multiple texts in the chart information, the correspondence between the text area and the text is established, so that the first text to be displayed in the text area can be obtained based on the correspondence. That is, a feasible technical solution for the above 201 "obtaining the text area of ​​the chart to be displayed and the first text to be displayed in the text area" is:

[0107] 2011. Get the chart information of the chart to be displayed;

[0108] 2012. Planning corresponding text areas for the multiple texts in the chart information;

[0109] 2013. Based on the planning result, determine the first text to be displayed in the text area.

[0110] In specific implementation, the above chart information includes all the information of the chart to be displayed, such as chart attribute information (such as chart type, chart size, chart coordinates, etc.), text information (including title text, text associated with coordinate axes, text associated with chart elements, etc.), chart elements that reflect data information (also called data blocks, such as bar blocks in bar charts, sector blocks in pie charts), etc. After obtaining the chart information, the corresponding text areas can be planned for multiple texts in the chart information in combination with the attribute information of the chart, so as to determine the first text to be displayed in the text area based on the planning results. For the specific implementation of planning text areas, please refer to the relevant content below.

[0111] In the above 202 and 203, the character size (such as character width, character height) of the first text can be determined according to the font size set by the user for the text in the chart or the system default font size. The area information of the above text area includes but is not limited to the shape and size (such as length, width) of the text area. When judging whether the first text can be displayed in the text area, in some embodiments, the number of text lines that can be displayed in the text area and the number of characters that can be displayed in each line can be determined according to the character size of the first text and the size of the text area, so as to determine the total number of characters that can be displayed in the text area. When the number of characters contained in the first text is less than or equal to the total number of characters that can be displayed in the text area, it is considered that the first text can be displayed in the text area; on the contrary, if the number of characters contained in the first text is greater than the total number of characters that can be displayed in the text area, it is considered that the first text cannot be displayed in the text area. Of course, in some other embodiments, in addition to judging whether the text area can display the first text according to the size information of the first text and the size information of the text area, it can also be further combined with the shape of the text area to judge whether the text area can display the first text, and this embodiment is no longer specifically limited to this.

[0112] In the case where it is determined that the text area cannot display the first text, the method of extracting keywords can be used to realize the display of the first text in the text area. The method of extracting keywords can be, but is not limited to: extracting keywords based on the recognition results of text semantic recognition, extracting keywords by taking the first and last words of the text; wherein, the method of taking the first and last words of the text refers to extracting several keywords at the front and several keywords at the end of the text, and the number of keywords extracted can be determined according to the shape and size of the text area. Based on this, in a specific achievable technical solution, the "extracting at least one keyword adapted to the text area from the first text" in the above 204 may include:

[0113] 2041. Determine the number of keywords to be extracted based on the shape and size of the text area;

[0114] 2042. Perform semantic recognition on the first text; based on the semantic recognition result, extract the number of keywords that reflect the central semantics of the first text from the first text; or

[0115] 2043. Extract N keywords at the front and M keywords at the end of the text to obtain the number of keywords; wherein N and M are both natural numbers, and the sum of N and M is equal to the number.

[0116] In specific implementation, the actual size of the text area that can be used to display the text can be determined based on the shape and size of the text area and the character size of the first text, and the number of keywords to be extracted can be determined based on the actual size and the character size of the first text. After that, a semantic recognition method for the first text or a method of extracting the first and last words of the first text can be used to extract a certain number of keywords from the first text. For the specific implementation of extracting a certain number of keywords from the first text using the semantic recognition method or the method of extracting the first and last words of the text, please refer to the existing content.

[0117] In the above 205, after extracting at least one keyword that is adapted to the text area from the first text, when displaying the chart, the at least one keyword can be rendered by calling the rendering layer to display the at least one keyword in the text area. For the specific implementation of step 205, please refer to the relevant content above.

[0118] Furthermore, in order to ensure that the first text can be fully conveyed to the user, when displaying a chart, while displaying at least one keyword corresponding to the first text in the text area, a corresponding reduction mark (such as an ellipsis "...") can also be displayed in the text area to provide the user with a reduced content of the first text for the keyword displayed in the text area. In this case, a corresponding hover event can also be added to the text area, so that when the user triggers an operation on the text area (such as moving the mouse to the text area), the first text can be displayed in a floating window, so that the user can understand the entire content of the first text. For a specific introduction to the hover time, please refer to the relevant content above, which will not be described in detail here. Based on this, the method provided in this embodiment may also include the following steps:

[0119] 206a, when displaying the chart, displaying a reduction mark in the text area to prompt the user that the keyword displayed in the text area is a reduced content of the first text;

[0120] 206b. In response to a user operation on the text area, display the first text in a floating window.

[0121] For the specific implementation principles of the above 205 and 206, please refer to the relevant contents of the above embodiments.

[0122] Furthermore, the method provided in this embodiment may also include the following steps:

[0123] 207a. If it is determined that the first text can be displayed in the text area, the number of display lines and the number of characters displayed in each line are arranged in the text area according to the number of characters included in the first text, the display size of the characters, and the shape and size of the text area;

[0124] 207b. When displaying the chart, display the first text in the text area according to the number of display rows and the number of display characters per row.

[0125] In a specific implementation, the maximum number of characters that can be displayed in each line in the text area can be determined first based on the display size of the characters and the shape and size of the text area; then, the number of display lines and the number of characters displayed in each line can be arranged in the text area in combination with the number of characters contained in the second text, so that when displaying a chart, the first text can be displayed in the text area according to the number of display lines and the number of characters displayed in each line.

[0126] The technical solution provided in this embodiment is to obtain the text area of ​​the chart to be displayed and the first text to be displayed in the text area, and then further determine whether the first text can be displayed in the text area according to the determined character size of the first text, the number of characters contained in the first text and the area information of the text area, and when it is determined that the text cannot be displayed in the text area, at least one keyword that is adapted to the text area is extracted from the first text, so that at least one keyword is displayed in the text area when the chart is displayed. By realizing chart display by extracting keywords in this way, it can effectively ensure that the text information in the chart can be fully conveyed to the user while ensuring the clear presentation of the chart, which is conducive to improving the user experience.

[0127] Considering that in the process of planning corresponding text areas for multiple texts in the chart information in the above 201, it is often difficult to plan corresponding text areas for some texts. For example, the supply chain operation data is affected by certain factors and has a large volatility, resulting in a large data span, which makes the corresponding element area of ​​some chart elements reflecting data information small (such as Figure 5b The block areas corresponding to the fan-shaped blocks 4 and 5 shown are relatively small. For these chart elements with small element areas, it is impossible to plan a corresponding text area for the text associated with the chart element. For text for which a corresponding text area cannot be planned, it can be processed in a hidden manner when displaying the chart. Based on this, the chart display method provided in this embodiment can also include the following steps:

[0128] S11, obtaining chart information of a chart to be displayed;

[0129] S12, planning corresponding text areas for the multiple texts in the chart information;

[0130] S13, when there is a second text for which a corresponding text area cannot be planned, marking the second text as a hidden text, so as to hide the second text when displaying the chart;

[0131] S12. In response to a user operation on a chart element in the chart that hides the second text, display the hidden second text; wherein the chart includes a plurality of chart elements that reflect corresponding data information.

[0132] For a detailed description of the above step S11, please refer to the relevant content above.

[0133] In the above S12, due to the diversity of charts, different types of charts and / or charts of the same type often have differences in the layout planning of the text areas corresponding to the multiple texts of the corresponding charts. However, in general, based on the positional relationship between the text and the chart elements, the planning results of the text area corresponding to the text can generally include the following two types: planning the text area corresponding to the text outside the corresponding chart element (such as Figure 4a The coordinate axis text indicated by part A in the bar chart shown and the text outside the area above the top of the rectangular block indicated by part B), the text area corresponding to the text is planned in the corresponding chart element (such as Figure 4b When planning the text area corresponding to the text outside the corresponding chart element, the text area corresponding to the text can be planned in the idle area based on the chart area and the element areas corresponding to the multiple chart elements of the chart, and the idle area in the chart area is determined. At the same time, in the text area planning process, if at least two text areas overlap, the size of at least part of the text areas in the at least two overlapping text areas can be adjusted, or at least part of the text areas in the at least two overlapping text areas can be moved, so that the at least two overlapping text areas are staggered.

[0134] That is, in an achievable technical solution, the above S12 “planning corresponding text areas for the multiple texts in the chart information” may specifically include:

[0135] S121, determining a chart area and element areas corresponding to each of a plurality of chart elements displayed in the chart area;

[0136] S122, determining a free area according to the chart area and the element areas corresponding to the plurality of chart elements;

[0137] S123, based on the chart elements associated with the multiple texts respectively, demarcating text areas for the multiple texts in the free areas around the element areas corresponding to the chart elements associated with the multiple texts respectively;

[0138] S124: When there is an overlap of text regions, adjust at least a portion of at least two overlapping text regions to stagger the text regions.

[0139] In specific implementation, after determining the free area in the chart area, text areas can be delineated for the multiple texts based on the preset text area size, shape, etc., in the free area around the element area corresponding to the respective associated chart elements, based on the respective associated chart elements of the multiple texts; and then adjustments are made to at least two overlapping text areas to stagger the overlapping text areas.

[0140] When planning the text area corresponding to the text in the corresponding chart element, the corresponding text area can be demarcated for the multiple texts based on the element areas corresponding to the multiple chart elements contained in the chart. That is, in another feasible technical solution, the above S12 "planning the corresponding text area for the multiple texts in the chart information" can specifically include:

[0141] S121', determining element areas corresponding to each of the plurality of chart elements included in the chart;

[0142] S122': Based on the chart elements associated with the multiple texts, respectively define text areas for the multiple texts in element areas corresponding to the chart elements associated with the multiple texts.

[0143] It should be noted here that for the specific implementation of delimiting text areas for multiple texts in the element areas corresponding to the chart elements associated with the multiple texts, please refer to the existing content. In addition, this embodiment does not specifically limit the shape and size of the text area delimited for the text, as long as the text area is ensured to be within the element area corresponding to the corresponding chart element.

[0144] In the above S13 and S12, for the second text (such as Figure 5b The text associated with the fan-shaped block 4 and the fan-shaped block 5 (not specifically shown in the figure) is marked as hidden text, and when the chart is displayed, when the second text is hidden, a hover event can be added to the chart element associated with the second text, so that when the user triggers an operation on the chart element that hides the second text in the chart by, for example, using a mouse, the hidden second text can be displayed. For the specific implementation of adding the hover event, please refer to the relevant content above.

[0145] Figure 5b The sector blocks 4 and 5 in the pie chart shown are chart elements in which the second text is hidden, and the sector blocks 4 and 5 are respectively added with corresponding hover events.

[0146] Figure 8 FIG. 1 is a schematic diagram showing the structure of a chart display device provided in an embodiment of the present application. Figure 8As shown, the chart display device includes: a determination module 31, an acquisition module 32, a processing module 33 and a display module 34. Among them,

[0147] A determination module 31, used to determine the display type of the text in the chart to be displayed;

[0148] An acquisition module 32, used to acquire a text processing strategy corresponding to the display type;

[0149] The determination module 31 is further used to determine the target text in the chart;

[0150] A processing module 33, used to process the target text according to the text processing strategy to obtain a text display object and a display area after the target text is processed;

[0151] A display module 34, configured to display the text display object in the display area of ​​the chart when displaying the chart;

[0152] Furthermore, the above-mentioned determination module 31, when used to determine the target text in the chart, is specifically used for at least one of the following: searching whether there is a long text whose text length is greater than a threshold from the multiple texts contained in the chart; when the chart contains the long text, determining the long text as the target text; based on the graphic structure of the chart, determining whether there are at least two texts with overlapping texts; if so, determining both of the at least two texts as target texts.

[0153] Furthermore, the above-mentioned chart includes multiple chart elements, that is, multiple texts, and one chart element is associated with at least one text; the display types of text include: out-of-area text displayed outside the element area corresponding to the chart element, in-area text displayed in the element area corresponding to the chart element, and coordinate axis text.

[0154] Furthermore, when the display type is out-of-region text, the text processing strategy corresponding to the out-of-region text includes: a first sub-strategy for dividing the text into lines, a second sub-strategy for extracting keywords from the text, and a third sub-strategy for staggered display with overlapping text; and

[0155] The above-mentioned processing module 33, when used to process the target text according to the text processing strategy, is specifically used to: obtain the area information of the text area corresponding to the target text and the text display size of the target text; when the target text does not overlap with the surrounding text, select at least one sub-strategy from the first sub-strategy and the second sub-strategy according to the area information and the text display size; use the selected at least one sub-strategy to process the target text; when the target text overlaps with the wrinkled text, obtain the overlapping area size of the target text, the movable space of the target text, that is, the movable space of the surrounding text, and use the third sub-strategy to adjust and / or move the text area corresponding to the target text to stagger it with the surrounding text.

[0156] Furthermore, when the above-mentioned display type is text in the area, the text processing strategy corresponding to the text in the area includes: a first sub-strategy for dividing the text into lines, a second sub-strategy for extracting keywords from the text, and a fourth sub-strategy for hiding the text; and

[0157] The above-mentioned processing module 33, when used to process the target text according to the text processing strategy, is specifically used to: obtain the area information of the text area corresponding to the target text and the display size of the target text; select at least one sub-strategy from the first sub-strategy, the second sub-strategy and the third sub-strategy based on the area information and the text display size; and use the selected at least one sub-strategy to process the target text.

[0158] Furthermore, when the display type is coordinate axis text, the text processing strategy corresponding to the coordinate axis text includes: a first sub-strategy for performing line processing on the text, a second sub-strategy for extracting keywords from the text; and

[0159] The above-mentioned processing module 33, when used to process the target text according to the text processing strategy, is specifically used to: obtain the area information of the text area corresponding to the target text and the text display size of the target text; select at least one sub-strategy from the first sub-strategy and the second sub-strategy based on the area information and the text display size; and use the selected at least one sub-strategy to process the target text.

[0160] It should be noted here that: the chart display device provided in the above embodiment can implement the technical solution described in the chart display method embodiment shown in Figure 1 above. The specific implementation principles of the above modules or units can refer to the corresponding contents in the chart display method embodiment shown in Figure 1 above, and will not be repeated here.

[0161] Fig. 9FIG. 1 is a schematic diagram showing the structure of a chart display device provided in an embodiment of the present application. Fig. 9 As shown, the chart display device includes: an acquisition module 41, a determination module 42, a determination and extraction module 43 and a display module 44.

[0162] An acquisition module 41 is used to acquire a text area of ​​a chart to be displayed and a first text to be displayed in the text area;

[0163] A determination module 42, configured to determine the character size of the first text;

[0164] A determination and extraction module 43, configured to determine whether the first text can be displayed in the text area according to the number of characters contained in the first text, the character size and the area information of the text area; if not, extract at least one keyword adapted to the text area from the first text;

[0165] The display module 44 is configured to display the at least one keyword in the text area.

[0166] Furthermore, the above-mentioned judgment and extraction module 43, when used to extract at least one keyword adapted to the text area from the first text, is specifically used to: determine the number of keywords to be extracted based on the shape and size of the text area; perform semantic recognition on the first text; based on the semantic recognition result, extract the number of keywords that embody the central semantics of the first text from the first text; or, extract N keywords at the front and M keywords at the end of the text to obtain the number of keywords; wherein N and M are both natural numbers, and the sum of N and M is equal to the number.

[0167] Furthermore, the display module 44 is further configured to display a reduction mark in the text area when displaying the chart, so as to prompt the user that the keyword displayed in the text area is a reduced content of the first text; and

[0168] The device provided in this embodiment further includes: a response module, configured to display the first text in a floating window in response to an operation directed to the text area.

[0169] Furthermore, the device provided in this embodiment further includes: a layout module, which is used to layout the number of display lines, i.e., the number of characters displayed in each line, in the text area according to the number of characters contained in the first text, the display size of the characters, and the shape and size of the text area if it is determined that the first text can be displayed in the text area; accordingly,

[0170] The display module 44 , when used to display the chart, displays the first text in the text area according to the number of display rows and the number of display characters per row.

[0171] Furthermore, the acquisition module 41 is also used to acquire the chart information of the chart to be displayed; and the device provided in this embodiment also includes: a planning and marking module, which is used to plan corresponding text areas for multiple texts in the chart information; when there is a second text for which a corresponding text area cannot be planned, the second text is marked as a hidden text, so that the second text is hidden when the chart is displayed; accordingly,

[0172] The display module 44 is further configured to display the hidden second text in response to a user's operation on a chart element in the chart that hides the second text; wherein the chart includes a plurality of chart elements that reflect corresponding data information.

[0173] Furthermore, the above-mentioned planning and marking module, when used to plan corresponding text areas for multiple texts in the chart information, is specifically used to: determine the chart area and the element areas corresponding to each of the multiple chart elements displayed in the chart area; determine the idle area based on the chart area and the element areas corresponding to each of the multiple chart elements; based on the chart elements associated with each of the multiple texts, in the idle area around the element areas corresponding to the respectively associated chart elements, respectively delineate text areas for the multiple texts; when there is overlap of text areas, adjust at least part of the at least two overlapping text areas to stagger the text areas.

[0174] Furthermore, the above-mentioned planning identification module, when used to plan corresponding text areas for multiple texts in the chart information, is specifically used to: determine the element areas corresponding to each of the multiple chart elements contained in the chart; based on the chart elements associated with each of the multiple texts, respectively delineate text areas for the multiple texts within the element areas corresponding to the respectively associated chart elements.

[0175] It should be noted here that: the chart display device provided in the above embodiment can realize the above Figure 2 The technical solution described in the embodiment of the diagram display method shown in the figure, the specific implementation principle of each module or unit can be found in the above Figure 2 The corresponding contents in the illustrated diagram display method embodiment will not be repeated here.

[0176] Fig.10The schematic diagram of the principle structure of an electronic device provided by an embodiment of the present application is shown. The electronic device includes a processor 52 and a memory 51. The memory 51 is used to store one or more computer instructions; the processor 52, coupled with the memory 51, is used for one or more computer instructions (such as computer instructions for implementing data storage logic) to implement the steps in the above-mentioned various diagram display method embodiments.

[0177] The memory 51 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0178] Further, if Fig.10 As shown, the electronic device also includes: a communication component 53, a power component 55, a display 54 and other components. Fig.10 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.10 Components shown.

[0179] Another embodiment of the present application provides a computer program product (not shown in the accompanying drawings of the specification). The computer program product includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the processor is enabled to implement the steps in the above-mentioned method embodiments.

[0180] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the method steps or functions provided in the above embodiments can be implemented.

[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for displaying a chart, characterized in that: include: Determine the display type of the text in the chart to be displayed; Obtaining a text processing strategy corresponding to the display type; determining target text in the chart; According to the text processing strategy, the target text is processed to obtain a text display object and a display area after the target text is processed; When displaying the chart, displaying the text display object in the display area of ​​the chart; Among them, when the display type is out-of-region text, if the target text overlaps with surrounding text, the text area corresponding to the target text will be adjusted and / or moved to be displayed staggered with the surrounding text.

2. The method according to claim 1, characterized in that Determining the target text in the chart includes at least one of the following: Searching whether there is a long text whose length is greater than a threshold value from among the multiple texts included in the chart; when the chart contains the long text, determining the long text as the target text; Based on the graphic structure of the chart, it is determined whether at least two texts overlap each other; if so, the at least two texts are both determined as target texts.

3. The method according to claim 1 or 2, characterized in that: The chart includes a plurality of chart elements and a plurality of texts, and one chart element is associated with at least one text; The text display types include: out-of-area text displayed outside the element area corresponding to the chart element, in-area text displayed within the element area corresponding to the chart element, and coordinate axis text.

4. The method according to claim 3, characterized in that: When the display type is out-of-region text, the text processing strategy corresponding to the out-of-region text includes: a first sub-strategy for performing line processing on the text, a second sub-strategy for extracting keywords from the text, and a third sub-strategy for staggered display with overlapping text; and According to the text processing strategy, the target text is processed, including: Obtaining area information of a text area corresponding to a target text and a text display size of the target text; When the target text does not overlap with surrounding texts, at least one sub-strategy is selected from the first sub-strategy and the second sub-strategy according to the area information and the text display size; and the target text is processed using the selected at least one sub-strategy; When the target text overlaps with the surrounding text, the overlapping area size of the target text, the movable space of the target text and the movable space of the surrounding text are obtained, and the third sub-strategy is used to adjust and / or move the text area corresponding to the target text to be staggered with the surrounding text.

5. The method according to claim 3, characterized in that: When the display type is text in an area, the text processing strategy corresponding to the text in the area includes: a first sub-strategy for dividing the text into lines, a second sub-strategy for extracting keywords from the text, and a fourth sub-strategy for hiding the text; and According to the text processing strategy, the target text is processed, including: Obtaining area information of a text area corresponding to a target text and a text display size of the target text; Selecting at least one sub-strategy from the first sub-strategy, the second sub-strategy, and the fourth sub-strategy according to the area information and the text display size; The target text is processed using the selected at least one sub-strategy.

6. The method according to claim 3, characterized in that: When the display type is coordinate axis text, the text processing strategy corresponding to the coordinate axis text includes: a first sub-strategy for performing line processing on the text, and a second sub-strategy for extracting keywords from the text; and According to the text processing strategy, the target text is processed, including: Obtaining area information of a text area corresponding to a target text and a text display size of the target text; Selecting at least one sub-strategy from the first sub-strategy and the second sub-strategy according to the area information and the text display size; The target text is processed using the selected at least one sub-strategy.

7. A method for displaying a chart, characterized in that: include: Acquire a text area of ​​a chart to be displayed and a first text to be displayed in the text area; determining a character size of the first text; Determining whether the first text can be displayed in the text area according to the number of characters included in the first text, the character size, and area information of the text area; If not, extracting at least one keyword adapted to the text area from the first text; When displaying the chart, displaying the at least one keyword in the text area; When planning corresponding text areas for multiple texts in the chart information of the chart to be displayed, when there is overlap of text areas, at least part of the at least two overlapping text areas will be adjusted to stagger the text areas.

8. The method according to claim 7, characterized in that Extracting at least one keyword adapted to the text area from the first text includes: Determining the number of keywords to be extracted based on the shape and size of the text area; Performing semantic recognition on the first text; based on the semantic recognition result, extracting the number of keywords that embody the central semantics of the first text from the first text; or Extract N keywords at the front and M keywords at the end of the text to obtain the number of keywords; wherein N and M are both natural numbers, and the sum of N and M is equal to the number.

9. The method according to claim 7 or 8, characterized in that: Also includes: When displaying the chart, a reduction mark is displayed in the text area to prompt the user that the keyword displayed in the text area is a reduced content of the first text; In response to a user operation on the text area, the first text is displayed in a floating window.

10. The method according to claim 7 or 8, characterized in that: Also includes: If it is determined that the first text can be displayed in the text area, then the number of display lines and the number of characters displayed in each line are arranged in the text area according to the number of characters contained in the first text, the display size of the characters, and the shape and size of the text area; When displaying the chart, the first text is displayed in the text area according to the number of display rows and the number of display characters per row.

11. The method according to claim 7 or 8, characterized in that: Also includes: Get the chart information of the chart to be displayed; Planning corresponding text areas for multiple texts in the chart information; When there is a second text for which a corresponding text area cannot be planned, marking the second text as a hidden text, so as to hide the second text when displaying the chart; In response to a user's operation on a chart element in the chart that hides the second text, displaying the hidden second text; The chart includes a plurality of chart elements reflecting corresponding data information.

12. The method according to claim 11, characterized in that Planning corresponding text areas for the multiple texts in the chart information includes: Determine a chart area and element areas corresponding to each of a plurality of chart elements displayed in the chart area; Determine a free area according to the chart area and the element areas corresponding to the plurality of chart elements; Based on the chart elements associated with the multiple texts, respectively demarcating text areas for the multiple texts in the free areas around the element areas corresponding to the chart elements associated with the multiple texts; When there is a situation where text regions overlap, at least a portion of at least two overlapping text regions is adjusted to stagger the text regions.

13. The method according to claim 11, characterized in that Planning corresponding text areas for the multiple texts in the chart information includes: Determine element areas corresponding to each of the plurality of chart elements included in the chart; Based on the chart elements associated with the multiple texts respectively, text areas are respectively demarcated for the multiple texts in element areas corresponding to the chart elements associated with the multiple texts respectively.

14. An electronic device, characterized in that: comprising a memory and a processor; wherein, The memory stores one or more computer instructions; The processor, coupled to the memory, is used to execute the one or more computer instructions to implement the steps of the method described in any one of claims 1 to 6, or to implement the steps of the method described in any one of claims 7 to 13.

Citation Information

Patent Citations

  • Label text displaying method and device

    CN106873925A

  • Report configuration method, system and device and computer readable storage medium

    CN110287472A

  • Data single chart display method and device

    CN112084378A

  • Character processing method and device

    CN113705156A

  • Method and device for arranging multiple national political rights in same time period and storage medium

    CN114117164A