[go: up one dir, main page]

CN114662450B - Graphic display method and electronic device - Google Patents

Graphic display method and electronic device Download PDF

Info

Publication number
CN114662450B
CN114662450B CN202210220861.5A CN202210220861A CN114662450B CN 114662450 B CN114662450 B CN 114662450B CN 202210220861 A CN202210220861 A CN 202210220861A CN 114662450 B CN114662450 B CN 114662450B
Authority
CN
China
Prior art keywords
text
chart
area
displayed
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210220861.5A
Other languages
Chinese (zh)
Other versions
CN114662450A (en
Inventor
佟婷娜
刘家齐
陈昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210220861.5A priority Critical patent/CN114662450B/en
Publication of CN114662450A publication Critical patent/CN114662450A/en
Application granted granted Critical
Publication of CN114662450B publication Critical patent/CN114662450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请实施例提供一种图表展示方法及电子设备。其中,方法包括如下的步骤:确定待展示图表中文本的展示类型;获取所述展示类型对应的文本处理策略;确定所述图表中的目标文本;按照所述文本处理策略,对所述目标文本进行处理,以得到所述目标文本处理后的文本展示对象及展示区域;展示所述图表时,在所述图表的所述展示区域处显示所述文本展示对象。采用本申请实施例提供的技术方案,既能够使得图表呈现清晰,又可保证图表中的文本信息完整地传达给用户,提高用户体验感。

The embodiment of the present application provides a method and electronic device for displaying a chart. 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.

Description

Graph display method and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a chart display method and an electronic device.
Background
With the continuous deepening of the big data age, the daily output of the data of the supply chain operation is larger and larger, and the users are urgent to need imaging tools to analyze and reveal information in the data. The chart is widely applied in the field of data analysis due to the characteristics of visual and vivid analysis and various attributes (such as timeliness and quantity) of the description data.
Typically, supply chain operational data throughput is subject to large fluctuations due to various factors such as large promotions, seasonal sales, etc., which can result in large spans of data, resulting in extreme cases of the chart in presenting the data, and further in some lengthy text in the chart becoming obscured. Aiming at the problem, the existing scheme mostly adopts a mode of cutting off overlong text or displaying overlong text by rotating angle and the like to display the chart, but the problems of text information loss, difficult text reading and the like exist.
Disclosure of Invention
In view of the above, the present application provides a chart display method and an electronic device that solve or at least partially solve the above problems.
In one embodiment of the present application, a chart presentation method is provided. The method comprises the following steps:
determining the display type of the text in the chart to be displayed;
acquiring a text processing strategy corresponding to the display type;
determining a target text in the chart;
Processing 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;
When the chart is displayed, the text display object is displayed at the display area of the chart.
In another embodiment of the present application, a graph display method is also provided. The method comprises the following steps:
Acquiring a text region of a chart to be displayed and a first text to be displayed in the text region;
determining a character size of the first text;
judging whether the first text can be displayed in the text area according to the character quantity contained in the first text, the character size and the area information of the text area;
If not, extracting at least one keyword adapting to the text region from the first text;
and when the chart is displayed, displaying the at least one keyword in the text area.
In one embodiment of the present application, an electronic device is provided. The electronic equipment comprises a processor and a memory, wherein the memory is used for storing one or more computer instructions, and the processor is coupled with the memory and used for realizing the steps in the chart display method embodiments.
According to the technical scheme provided by the embodiment of the application, after the display type of the text in the chart to be displayed is determined and the text processing strategy corresponding to the display is obtained, the target text in the determined chart is processed according to the text processing, so that the text display object and the display area after the target text processing are obtained, and the purpose that the text display object is displayed at the display area of the chart when the chart is displayed is achieved. The scheme provided by the embodiment is utilized to realize chart display, so that the chart can be clearly presented, text information in the chart can be completely transmitted to a user, and the user experience is improved.
According to the other technical scheme provided by the embodiment of the application, on the basis of acquiring the text region of the chart to be displayed and the first text to be displayed in the text region, the first text can be displayed in the text region according to the determined character size of the first text, the character amount contained in the first text and the region information of the text region, and when the text cannot be displayed in the text region, at least one keyword matched with the text region is extracted from the first text, so that when the chart is displayed, the at least one keyword is displayed in the text region. The method for extracting the keywords can realize chart display, can effectively ensure that text information in the chart can be completely transmitted to a user while ensuring clear chart presentation, and is beneficial to improving user experience.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic illustration of an embodiment of the present application;
FIG. 1b is a schematic illustration of another embodiment of the present application;
FIG. 1c is an illustration of a graph provided by another embodiment of the present application;
FIG. 2 is a flow chart illustrating a method according to an embodiment of the present application;
FIG. 3 is an illustration of a graph provided by another embodiment of the present application;
FIG. 4a is an illustration of a graph provided by another embodiment of the present application;
FIG. 4b is an illustration of a graph provided by another embodiment of the present application;
FIG. 5a is an illustration of a graph provided by another embodiment of the present application;
FIG. 5b is an illustration of a graph provided by another embodiment of the present application;
FIG. 6 is an illustration of a graph provided by a further embodiment of the present application;
FIG. 7 is a flowchart illustrating a chart illustrating a method according to another embodiment of the present application;
FIG. 8 is a block diagram of a diagram illustrating an embodiment of the present application;
FIG. 9 is a block diagram of a diagram illustrating an apparatus according to another embodiment of the present application;
Fig. 10 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The chart generally refers to a graphic structure which is displayed on a display interface, can intuitively display data statistical information attributes (such as timeliness, quantity and the like), and plays a key role in data knowledge mining and data information visual and vivid feeling. The user can view the corresponding key information relatively intuitively and conveniently through the chart, for example, an investor can accurately acquire the financial data of the enterprise through the chart, and investment analysis is facilitated on the financial data of the enterprise. The types of charts have various types, and the charts can be generally divided into two major types of charts with axes (such as bar charts, broken line charts, column charts and the like) and charts without axes (such as pie charts) according to the existence of coordinate axes, wherein the coordinate axes in the charts with axes are used for representing data dimensions, and the bar charts with X axes and Y axes shown in fig. 1c represent that the data corresponding to the bar charts are two-dimensional data. Whether an axial graph or a shaftless graph generally has a plurality of graph elements reflecting data information, the graph elements can refer to, but are not limited to, columns, blocks, a point and the like in the graph, such as a point on a broken line in the graph (not shown in the drawing), a sector block in a sector graph shown in fig. 1a or 1b, a rectangle block in a bar graph shown in fig. 1c and the like, which are all graph elements reflecting data information in the corresponding graph, and a plurality of texts for explaining the graph so that a user can easily understand the graph, such as a numerical text or a character text and the like, specifically, such as a title text, a user can quickly understand the function of the graph through the title text in the graph, and further such as a text (also called a data mark or a data tag) associated with the graph element, a user can quickly understand the category, the data amount, the percentage and the like corresponding to the data reflected by the graph element through the text associated with the graph element. For a detailed description of chart elements and text included in a chart, see the following relevant text.
When rendering data using a chart, some lengthy text in the chart, particularly that associated with chart elements, cannot be clearly and unambiguously displayed due to the inevitable fluctuations in the data that result from being affected by certain factors. Aiming at the problem, the prior proposal adopts the following treatment modes:
1. and not as a way of processing. By not being a way of processing, it is meant that the lengthy text in the chart that is not clearly displayed is not processed, the lengthy text is left over the corresponding block, or the lengthy text overlaps other surrounding text, etc. Specifically, referring to the fan chart shown in fig. 1a, for a text such as "class one" that is not clearly displayed in the fan chart, it is not used as a processing manner to leave "class one" beyond the corresponding fan block 1. The integrity of the text information display in the chart can be ensured without being used as a processing mode, but the text is not easy to read.
2. The processing mode of cutting the overlong text. Cutting off excessively long text refers to reserving a number of keywords in the text for display and hiding other content than the number of keywords. Fig. 1b shows an example of displaying a lengthy text that is not clearly displayed in a chart in a truncated manner, where the truncated display ensures that the chart is clearly presented, but the truncated text only displays a portion of the text, resulting in text information loss.
3. The rotation angle shows the processing mode of the overlong text. FIG. 1c shows an example of the rotation angle display of lengthy text (e.g., zhao# # #, li# # #, han# # # etc.) in a graph that is not clearly apparent. The rotation angle display mode has the problem that the rotation text is not easy to read.
In order to solve the problems of the prior art, the embodiments of the present application provide a chart display technical scheme. In the scheme for displaying the chart, aiming at the problem that the display cannot be clearly understood by overlong texts, a plurality of text processing strategies are proposed, namely a strategy for carrying out line separation processing on the texts, a strategy for extracting keywords from the texts, a strategy for displaying the overlapped texts in a staggered manner and a strategy for hiding the texts, the chart display is realized by integrating the text processing strategies, and the text information in the chart can be completely conveyed to a user while the clear presentation of the chart is ensured. In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present application with reference to the accompanying drawings.
In some of the flows described in the description of the application, the claims, and the figures described above, a number of operations occurring in a particular order are included, and the operations may be performed out of order or concurrently with respect to the order in which they occur. The sequence numbers of operations such as 101, 102, etc. are merely used to distinguish between the various operations, and the sequence numbers themselves do not represent any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types. Furthermore, the embodiments described below are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following describes the chart showing method provided by each embodiment of the present application in detail.
Fig. 2 is a flow chart illustrating a method according to an embodiment of the application. The execution main body of the chart display method provided by the embodiment of the application is an electronic device with data processing logic, the electronic device can be a client or a server, wherein the client can be any terminal device such as a mobile phone, a tablet computer, an intelligent wearable device and the like, and the server can be a common server (such as a single server or a service cluster formed by a plurality of functional servers), a cloud or a virtual server and the like. The following describes the technical solution provided in this embodiment in detail from the perspective that the execution body is a client. As shown in fig. 2, the chart display method provided in this embodiment includes the following steps:
101. Determining the display type of the text in the chart to be displayed;
102. Acquiring a text processing strategy corresponding to the display type;
103. Determining a target text in the chart;
104. Processing 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;
105. when the chart is displayed, the text display object is displayed at the display area of the chart.
In practical applications, referring to the bar chart shown in fig. 3, a chart is generally composed of several main parts, namely a chart area, a drawing area, chart elements (such as data series, data points, legends, coordinate axes, etc.) reflecting data information, and text. Specifically:
The graph area refers to the entire graph, and the drawing area is a part of the graph area, and in the two-dimensional bar graph shown in fig. 3, the drawing area is a rectangular area that is bounded by two coordinate axes of a vertical coordinate axis (i.e., Y axis) and a horizontal coordinate axis (i.e., X axis) and includes graduation marks.
The data series are a set of data points, one row or column of value data in the chart, each set of data series being represented in the chart by the same shape, color or pattern (a set of data series corresponding to division 1 of the # # zone is represented in medium gray as shown in fig. 3). One or more sets of data series may be drawn in a single chart, but only one set of data series in a pie chart and different data series in the pie chart may be represented in different colors or patterns. In the case where a chart includes multiple sets of data series, the meaning of the chart is often unclear, and a legend may be used to explain the data series. The legend is often located on the right side of the chart and is made up of a number of small items, each representing a mapping relationship between the chart and the content, so that the user can quickly ascertain the meaning of each data series through the legend.
Data points, a data point is a specific value in a cell in a spreadsheet (e.g., excel), and is shown in a graph as a rectangle, line, column, sector, or other shape. For example, each tile in the bar chart shown in FIG. 3 is a data point, each tile (i.e., sector) in the pie chart shown in FIG. 1b is a data point, and so on.
And the coordinate axis is used for representing the data dimension corresponding to the data presented by the chart and has the function of classifying and measuring the data. For example, the two-dimensional bar chart shown in fig. 3 has two coordinate axes of an X axis (also called a classification axis) for classifying data and a Y axis (also called a numerical axis) for measuring data. For a three-dimensional chart, there are three axes, while for a pie chart, there are no axes. For a specific role played by a coordinate axis, a corresponding numerical text or character text capable of identifying the role of the coordinate axis is generally added. For convenience of description, the text added to the coordinate axes in the chart is referred to as coordinate axis text in this embodiment. For example, in the bar chart shown in fig. 3, the coordinate axis text added for the Y axis has numerical text for representing sales of a certain commodity, such as 0, 1000, 2000, 3000, 4000, 5000, etc., and the coordinate axis text added for the Y axis has character text for representing quarters, such as quarterly one, quarterly two, quarterly three, quarterly four, etc.
Text, the text in the chart generally comprises numerical text and character text, and the numerical text and the character text are mainly used for explaining the chart so that a user can easily understand the chart content. For example, the title text in the chart, through which the user can quickly understand the function of the chart. For another example, text in the chart associated with the chart element reflecting the data information, the user may quickly determine the category, amount, percentage, etc. of the data represented by the chart element through the text associated with the chart element. Specifically, the coordinate axis text shown in fig. 3 is a text associated with a rectangular block and/or a coordinate axis in the bar chart shown in fig. 3, the text shown in fig. 1a, such as a first category, a second category, a third category, etc., located in the corresponding block is a text associated with a block in the bar chart shown in fig. 1a, and the text shown in fig. 5a located outside the corresponding block is a text associated with a block in the bar chart shown in fig. 5a, such as "overseas: 0.92%," north china: 11.44%, "etc., and further, the numerical text shown in fig. 4a located above the rectangular block, such as 42.3, 93.4, etc. (i.e., the portion B text indicated above the bar in fig. 4 a) is another text associated with a block in the bar chart shown in fig. 4 a. In summary, the text associated with the chart element shown in the drawing can be divided into three types, namely, text outside the area, text inside the area and coordinate axis text according to the position relation of the text relative to the chart element, wherein the text outside the area refers to the text displayed outside the area corresponding to the chart element, such as the text B part positioned above the distance block, such as 42.3 and 93.4 indicated in fig. 4a, and the text inside the area refers to the text displayed inside the area corresponding to the chart element, such as the text C part positioned inside the distance block, such as 154 and 147 indicated in fig. 4B. For a specific description of the axis text (as indicated in fig. 4a as part a text associated with the axis in the chart) see the above relevant.
Based on the foregoing, the chart to be presented in 101 above may include, but is not limited to, a plurality of chart elements and a plurality of texts, one chart element being associated with at least one text. For example, the rectangular block 1 shown in fig. 4a is associated with two texts, the numerical text "94.2" located above the top of the rectangular area 1 and the corresponding coordinate axis text "category 0837". The presentation types of the text include, but are not limited to, an out-of-area text presented outside the element area corresponding to the chart element, an in-area text presented within the element area corresponding to the chart element, and a coordinate axis text. Specifically, when determining the display type of the text in the chart to be displayed, after the text in the chart to be displayed is acquired, the position relationship between the text and the chart element and/or the coordinate axis in the chart can be analyzed based on the graph structure of the chart, so that the display type of the text in the chart to be displayed is determined.
It should be noted that, in addition to the above-mentioned components including the chart area, drawing area, data series, legend, data point, coordinate axis, text (including numerical text and character text), some other components may be included in a chart, for example, grid lines, error lines, trend lines, chart titles, etc., and specific descriptions about other components that may be included in the chart may be referred to in the prior art, which is not repeated herein. In the foregoing, elements used to compose a chart, such as a legend, a data series, a trend line, etc., are referred to as drawing elements in the process of generating the chart, and are converted from the obtained supply chain operation data (such as financial data of an enterprise). The graphic structure of the chart can be used to characterize the positional relationship of drawing elements in the chart.
In order to realize that text information in a chart can be completely conveyed to a user while ensuring clear presentation of the chart when the chart is displayed, corresponding at least one text processing strategy is configured in advance for texts of different display types, and the text processing strategies correspondingly configured among the texts of different display types can be the same or different, and the embodiment is not limited herein. Specifically, the text processing strategies configured for the text outside the area include, but are not limited to, a first sub-strategy for carrying out line separation processing on the text, a second sub-strategy for extracting keywords from the text and a third sub-strategy for staggered presentation with the overlapped text, further, the text processing strategies configured for the text inside the area can include a fourth sub-strategy for hiding the text in addition to the first sub-strategy and the second sub-strategy, and further, the text processing strategies configured for the coordinate axis text can include, but are not limited to, the first sub-strategy and the second sub-strategy. The text processing policies, such as the first sub-policy, the second sub-policy, the third sub-policy, and the fourth sub-policy, may be pre-stored in a local corresponding storage medium, but not limited to, so as to be invoked when needed. For a specific description of text processing strategies see below. Based on this, in the above-mentioned step 102, after determining the presentation type of the text in the chart to be presented through step 101, the text processing policy corresponding to the presentation type may be obtained from the storage medium pre-stored with the corresponding text processing policy.
After the text processing strategy corresponding to the display type is obtained, the main reason that certain texts in the chart cannot be clearly and completely conveyed to a user when the chart is displayed is considered to be that the text is too long, the text display space is limited to a certain extent, the text with too long length cannot be completely conveyed easily under the limitation of the text display space, and/or at least two texts overlap and/or text is in a super-range, wherein the super-range refers to the range that the text exceeds the corresponding element area of the chart element associated with the text. The above-described overlapping of at least two texts and text hyper-scoping easily results in a text that is not clearly apparent to the user when the graphical representation is displayed, and the reasons for the occurrence of both are typically due to changes in the graphical structure of the diagram caused by fluctuations in the data. For example, referring to the pie chart shown in FIG. 1b, data fluctuations that result in undersize for each of the tiles 2 and 3 in the chart tend to cause overlapping of text associated with tile 2 (i.e., "sort one") with text associated with tile 3 (i.e., "other"), and further, referring to the pie chart shown in FIG. 1a (which is one of the pie charts), data fluctuations that result in undersize for tile 1 in the chart tend to cause text associated with tile 1 (i.e., "sort one") to exceed the extent of the corresponding element region of the corresponding tile 1. Based on the above, the present embodiment only processes at least one of the text with an excessively long length, the at least two texts with overlapping and the text with a super range according to the text processing policy, so as to ensure that the text with an excessively long length, the at least two texts with overlapping and the text with a super range in the chart can be clearly and obviously transmitted to the user when the chart is displayed, thereby effectively achieving the purpose of ensuring that the chart is clearly presented, and simultaneously, clearly and completely transmitting all text information in the chart to the user, and reducing the data processing amount. That is, if the target text, such as the text with a too long length, at least two texts with overlapping, and a super-range text, in the chart is processed according to the text processing policy, in the specific implementation, a long text with a length greater than a set threshold value in a plurality of texts included in the chart may be considered as a long text, and whether at least two texts with overlapping texts exist in the chart and/or whether a super-range text with a text exceeding the range of the corresponding element region of the chart element associated with the at least two texts exist in the chart may be determined based on the graph structure of the chart.
That is, in a specific implementation, the above 103 "determining the target text in the chart" may include at least one of the following:
1031. Searching whether a long text with the text length larger than a threshold value exists in a plurality of texts contained in the chart, and determining the long text as a target text when the long text is contained in the chart;
1032. Determining whether at least two texts with overlapped texts exist based on the graph structure of the chart, and determining the at least two texts as target texts when the at least two texts exist;
1032. And determining whether a hyper-range text which is beyond the range of the corresponding element area of the corresponding chart element in the chart exists or not based on the graph structure of the chart, and determining the hyper-range text as a target text when the hyper-range text exists.
In the foregoing 1031, when a plurality of texts included in the lookup table include long texts, the threshold may be flexibly set according to the actual situation, for example, the text length is set in units of in (inches), and the set threshold may be 2in, 4in, 5 in, or the like, which is not limited herein. Taking the set threshold value of 4in as an example, regarding a plurality of texts contained in the chart, after determining the text length corresponding to each text in the plurality of texts based on the character size of each text in the plurality of texts and the number of characters contained in the text, the text is regarded as a long text as long as the text length is greater than 4 in.
In the above 1032 and 1033, since the graphic structure of the chart may represent the position relationship of the chart elements, text, legend, etc. that form the chart, for this reason, by recalling the data information related to the graphic structure in the background, by analyzing the data information, it can be determined whether there are at least two texts with overlapping texts, and/or whether there are out-of-range text that is beyond the range of the corresponding element region of the corresponding chart element in the chart. Of course, in other embodiments, an image recognition algorithm may be further used to recognize the graphic structure of the chart, and a corresponding text recognition algorithm may be used to recognize the text in the chart, so as to implement the graphic structure based on the chart, determine whether there are at least two texts with overlapping texts, and/or determine whether there are hyper-range texts corresponding to the element region range of the corresponding chart element in the text chart. See the prior art for specific implementations of 1032 and 1033 described above.
Further, as can be seen from the above, there are various reasons for generally causing some texts in the chart to be unable to be clearly understood and conveyed to the user, and the present embodiment is based on these reasons that texts of different presentation types are respectively configured with a plurality of text processing strategies, that is, the text processing strategies corresponding to the target text have a plurality. Based on this, in order to ensure that the target text can be more effectively and clearly conveyed to the user when the chart is displayed, the above 104 may select at least one text processing policy adapted from a plurality of text processing policies corresponding to the target text to process the target text in combination with a reason that the target text cannot be clearly conveyed to the user when processing the target text according to the text processing policy. When the processing is specifically implemented, on the basis of acquiring the region information of the text region corresponding to the target text and the text display size of the target text, the reason that the target text cannot be clearly conveyed to the user is combined, if yes, the target text cannot be clearly conveyed to the user due to the overlapping of the target text and the surrounding text, and the adaptive at least one text processing strategy is selected from a plurality of text processing strategies corresponding to the target text according to the region information and the text display size to process the target text. Based on this, the first and second light sources,
In an implementation technical solution, in the case that the display type is an out-of-area text, and accordingly, the text processing policy corresponding to the out-of-area text includes a first sub-policy for performing a line separation process on the text, a second sub-policy for extracting keywords from the text, and a third sub-policy for displaying the overlapped text in a staggered manner, the 104 "process the target text according to the text processing policy" may specifically include:
a11, acquiring area information of a text area corresponding to a target text and the text display size of the target text;
A12, when the target text does not overlap with surrounding text, 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;
A13, when the target text is overlapped with the surrounding text, acquiring the overlapped size of the target text and the movable space of the movable control of the target text, namely the surrounding text, and adjusting and/or moving the text area corresponding to the target text by utilizing the third sub-strategy so as to be staggered with the surrounding text.
In the above a11, the region information of the text region corresponding to the target text includes, but is not limited to, information such as a size and a position of the region, and the region information may be obtained by referring to the related art content. The text presentation size of the target text may be determined based on the presentation character size (or the default character size of the system) configured by the user for the target text and the character data contained in the target text.
For the text outside the area, the reason why the text outside the area cannot be clearly and completely displayed is that the text overlaps with the surrounding text, and the text length is too long, so when the above-mentioned A12 determines that the target text does not overlap with the surrounding text, it can be considered that the target text cannot be clearly and completely displayed to the user when the chart is displayed due to the too long target text, and at this time, the target text can be processed by utilizing at least one of the first sub-strategy and the second sub-strategy according to the area information of the text corresponding to the target text and the text display size of the target text. By way of example only, and in an illustrative,
For example, according to the region information and the text display size, the number of lines of text which can be accommodated in the text region corresponding to the target text can be determined first, further, based on the number of lines of text and the text display size, the line separation processing can be performed on the target text only by selecting the first sub-strategy under the condition that the target text can be ensured to be completely and clearly displayed in the text region, so that a text display object and a display region (which are positioned in the text region) after the line separation processing of the target text are obtained, and then, when the chart is displayed, the step 105 can be implemented, the text display object after the line separation processing of the target text is displayed in the display region in the chart.
Text 1 (i.e. "northeast 3:9.84%") shown in the graph shown in fig. 5a is a text presentation object after the corresponding target text is subjected to the line division processing by using the first sub-policy, and the obtained target text is processed.
For another example, when it is determined that the target text is not completely and clearly displayed in the text region even though the target text is subjected to the line division processing according to the region information and the text display size, the first sub-policy and the second sub-policy may be selected at the same time, or the second sub-policy may be selected to process the target text. In specific processing, a second sub-strategy is used for processing a target text to extract corresponding keywords from the target text, specifically, the extraction quantity of the keywords can be determined based on region information and text display size, then the second sub-strategy is used for carrying out semantic recognition on the target text, the number of keywords which can embody the central semantics of the target text are extracted from the target text based on a semantic recognition result, and the first sub-strategy and the second sub-strategy are selected for processing the target text based on the text display size corresponding to the number of keywords (or the text display size corresponding to the number of keywords and a text display size corresponding to a reduction mark (such as an ellipsis) which needs to be added) or not, and whether the number of keywords (or the number of keywords and the reduction mark) can be clearly and completely displayed in a text region without carrying out line division processing is determined. The purpose of adding the reduction identifier in the above is to prompt the user for the reduced content of which the target content is the number of keywords. And in addition, a corresponding reduced mark can be displayed in the corresponding display area so as to prompt a user to display the reduced content of the target text by the plurality of keywords in the display area.
Text 2 (i.e. "southern............ 1435: 23%") shown in the graph shown in fig. 5a is a text display object after processing the target text 3 by processing the complete text content (i.e. the target text 3) corresponding to the text 2 by using the first sub-policy and the second sub-policy at the same time.
It should be noted that, after the processing of the target text by using the second sub-policy to obtain the text display object and the display area corresponding to the target text, when the chart is displayed by executing step 105, when the displayed text display object (or the text object and the corresponding reduced identifier) is displayed in the display area of the chart, a hover event for displaying the complete text content corresponding to the text display object may be added to the display area. With the hover event, when a user operates a mouse, such as the mouse, to move the mouse over a presentation area corresponding to the text object, a designated first function may be triggered, and after the first function is triggered, the complete text content corresponding to the text presentation object may be displayed entirely. For example, with continued reference to FIG. 5a, when the arrow representing the mouse is moved over the presentation area corresponding to text 2, a first function is triggered such that the complete text corresponding to text 2 (i.e., text 3) is displayed within the floating window. When the user operates the mouse to move out of the display area corresponding to the text object, the specified second function can be triggered, and the complete text corresponding to the displayed text 2 can be disappeared after the second function is triggered. In particular, the hover event described above may be implemented using a river method, which is a custom method that mimics a hover event (e.g., a mouse moving over and out of an object) and provides a "hold in" state for frequently used tasks, in conjunction with Tooltips tools for displaying interface-to-user cues that occur only when a user interacts with elements in a Graphical User Interface (GUI). Tooltips typically includes two types, hovering through a mouse, hovering through a keyboard, which refers to maintaining the keyboard focus on the same element for a long period of time.
It should be further noted that, when the second sub-strategy is used to extract keywords in the target text, in addition to the semantic recognition method described above, in other embodiments, the method of extracting the head and tail words of the text may be implemented by determining the number of extracted keywords based on the region information and the text display size, and extracting N keywords in the front, that is, M keywords in the tail, from the target text to obtain a number of keywords, where N and M are both natural numbers, and the sum of N and M is less than or equal to the number of extracted keywords determined above. The text 2 shown in fig. 5 adopts the mode of taking the head and tail words of the text to extract keywords such as 'south China, 4135 area: 23%' and the like shown in the text 2 from the complete text (namely the target text 3) corresponding to the text 2.
Further, in the case that the above a13 determines that the target text overlaps with the surrounding text, that is, it considers that the target text is not clearly and completely displayed to the user when the chart is displayed due to the overlapping with the surrounding text, at this time, the overlapping size of the target text, the movable space of the target text, and the movable space of the surrounding text may be obtained, so that the third sub-policy may be used to adjust and/or move the text region corresponding to the target text, so as to stagger the target text and the surrounding text. For example, when the target text overlaps with the upper text above the target text, the overlapping size may be moved downward only for the target text if the size corresponding to the movable space of the target text is determined to be greater than or equal to the overlapping size, so as to stagger the target text from the upper text, and the target text may be moved downward by an M1 size and the upper text may be moved upward by an M2 size based on the movable space of the target text and the movable space of the upper text at this time if the size corresponding to the movable space of the target text is determined to be less than the overlapping size, wherein the sum of the M1 size and the M2 size is greater than or equal to the overlapping size, and the M1 size is less than the size corresponding to the movable space of the target text, and the M2 size is less than the size corresponding to the movable space of the upper text.
The two texts of "overseas: 0.92%" and "southwest: 0.52%" within the rectangular frame 10 shown in the graph of fig. 5a represent the text display object after the processing of the two texts (not shown in the figure) of "overseas: 0.92%" and "southwest: 0.52%" that originally have overlapping, by using the third sub-policy.
In another implementation technical solution, in the case that the display type is the text in the area, and correspondingly, the text processing policy corresponding to the text in the area includes a first sub-policy for performing a line separation process on the text, a second sub-policy for extracting keywords from the text, and a fourth sub-policy for performing a hiding process on the text, the 104 "processing the target text according to the text processing policy" may specifically include:
a21, acquiring area information of a text area corresponding to a target text and the text display size of the target text;
A22, 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;
a23, processing the target text by using the selected at least one sub-strategy.
For a specific description of the above step a21, reference is made to the description of the above step a 11.
In the above-mentioned a22 and a23, for the text in the area (the text located in the sector as shown in fig. 5 b), the reason why the text in the area is not clearly displayed is generally that the text length is too long or that the size of the area corresponding to some chart elements in the chart is too small due to the fluctuation of the data. In the case that the target text cannot be clearly and completely displayed due to overlong text length, at least one of the first sub-strategy and the second sub-strategy can be adopted to process the target text. For a specific implementation of processing the target text by using at least one of the first sub-policy and the second sub-policy, refer to the related content in the steps a12 to a13, and detailed descriptions thereof are omitted herein.
The text 2 shown in the chart in fig. 5b, the first sub-policy and the second sub-policy are adopted to process the corresponding target text, and the text display object after the target text is processed is obtained.
When the size of the corresponding element area of the chart element associated with the target text in the chart is too small due to data fluctuation, and the target text cannot be clearly and completely transmitted to a user when the chart is displayed, the third sub-strategy can be adopted to hide the target text, and the target text is not displayed when the chart is displayed.
The tiles 4 and 5 shown in fig. 5b, i.e. the case where the text associated with each of the tiles 4 and 5 is hidden by a third sub-policy, are shown.
It should be noted that, in the case of hiding the target text by using the third sub-policy, the chart elements associated with the target text are added with corresponding hover events, for example, the sector 4 and the sector 5 shown in fig. 5b are added with corresponding hover events, when the user operates, for example, the mouse moves onto, for example, the sector 4, the text content associated with the sector 4 can be automatically displayed, and when the mouse moves out of, for example, the sector 4, the displayed text content associated with the sector 4 automatically disappears. For specific description of hover time, see above.
In still another implementation technical solution, when the display type is the coordinate axis text, and accordingly, the text processing policy corresponding to the coordinate axis text includes a first sub-policy for performing a line separation process on the text and a second sub-policy for extracting keywords from the text, the "process the target text according to the text processing policy" in the above 104 may specifically include:
A31, acquiring area information of a text area corresponding to a target text and the text display size of the target text;
A32, 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;
A33, processing the target text by using the selected at least one sub-strategy.
For a specific implementation of the above steps a31 to a33, see the relevant contents in the above steps a11 to a 12.
The coordinate value text within the rectangular box 20 shown in the graph of fig. 6 is a text display object obtained by processing the target text by using the first sub-policy and the second sub-policy.
Based on the text display object and the display area after the target text processing in step 104, the text display object needs to be displayed in the display area of the chart for presenting to the user. In general, an automatic process of displaying a chart is implemented by calling a graphic grammar layer through graphic data after acquiring supply chain operation data and forming the operation data into form data (also called graphic data) through Excel, so that the graphic grammar layer converts the graphic data into drawing elements to be rendered (such as legends, blocks (i.e., chart elements), broken lines and the like in the chart) and generates a graphic structure for representing the positional relationship of the drawing elements in the chart, and further, the rendering layer renders the drawing elements to display the chart to a user. The rendering layer is the bottom layer in the diagram generation framework and can be understood to be a display canvas for displaying diagrams to a user. Based on this, in 105 above, on the basis of the text display object after the target text processing obtained through 104 above, when implementing the display image, the text display object may be rendered by calling the rendering layer, so as to implement displaying the text display object at the display area of the chart.
In specific implementation, the rendering layer may render the text display object according to the graphic structure by using a drawing mode (i.e., a chart rendering mechanism) such as canvas 2D, webgl, so as to display the text display object in the display area in the drawing. And obtaining a target chart. Or alternatively
The rendering layer can also set multiple chart rendering mechanisms at the same time and call through a unified interface. In this case, the rendering layer is called according to the graphic structure, so that the rendering of the text display object is realized through the rendering layer according to the graphic structure. The rendering layer is used for rendering the text display object according to the graphic structure, and particularly, the rendering layer is called according to the graphic structure so as to determine a target chart rendering mechanism from a plurality of chart rendering mechanisms through a rendering layer calling interface, and therefore the rendering of the text display object is achieved based on the target chart rendering mechanism. The rendering mode can select the corresponding chart rendering mechanism to perform chart rendering according to different scenes, and can adapt to different scenes.
In summary, the technical solution provided in this embodiment is to process, after determining a display type of a text in a chart to be displayed and obtaining a text processing policy corresponding to the display, a target text in the determined chart according to text processing, so as to obtain a text display object and a display area after the target text processing, so as to display the text display object at a display position of the chart when the chart is displayed. When the technical scheme is used for realizing chart display, the chart can be clearly displayed, the text information in the chart can be ensured to be completely transmitted to a user, and the user experience can be improved.
Fig. 8 is a schematic flow chart diagram of a chart showing a method according to another embodiment of the present application. The execution body of the graph display method provided in this embodiment is the same as that of the graph display method shown in fig. 2, and detailed descriptions thereof will be omitted here. As shown in fig. 8. The chart display method comprises the following steps:
201. acquiring a text region of a chart to be displayed and a first text to be displayed in the text region;
202. Determining a character size of the first text;
203. Judging 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;
204. if not, extracting at least one keyword adapting to the text region from the first text;
205. and when the chart is displayed, displaying the at least one keyword in the text area.
In 201, the text region may be obtained by planning corresponding text regions for a plurality of texts in the chart information by adopting a corresponding technical means after obtaining the chart information of the chart to be displayed. After the text areas corresponding to the texts in the chart information are planned, the corresponding relation between the text areas and the texts is established, so that the first text to be displayed in the text areas can be obtained according to the corresponding relation. That is, the above 201 "obtaining a text region of a chart to be displayed and a first text to be displayed in the text region" may be implemented as follows:
2011. Acquiring chart information of a chart to be displayed;
2012. planning corresponding text areas for a plurality of texts in the chart information;
2013. based on the planning result, a first text to be presented in the text region is determined.
In particular, the chart information includes all information of the chart to be displayed, such as chart attribute information (e.g., chart type, chart size, chart coordinates, etc.), text information (e.g., title text, text associated with coordinate axes, text associated with chart elements, etc.), chart elements reflecting data information (also called data blocks, such as distance blocks in bar charts, sector blocks in pie charts, etc.), and so on. After the chart information is acquired, corresponding text areas can be planned for a plurality of texts in the chart information by combining attribute information of the chart, so that a first text to be displayed in the text areas is determined based on a planning result. For a specific implementation of planning text regions, see below.
In the foregoing 202 and 203, the character size (e.g., character width, character height) of the first text may be determined according to the size of the word size set by the user for the text in the chart or the default size of the word size of the system. The above-mentioned area information of the text area includes, but is not limited to, the shape and size (e.g., 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 lines of text which can be displayed in the text area and the number of characters which 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 that the total number of characters which can be displayed in the text area is determined, when the number of characters contained in the first text is smaller than or equal to the total number of characters which can be displayed in the text area, the first text is considered to be displayed in the text area, otherwise, if the number of words contained in the first text is larger than the total number of characters which can be displayed in the text area, the first text is considered to be unable to be displayed in the text area. Of course, in other embodiments, in addition to determining whether the text region can display the first text according to the size information of the first text and the size information of the text region, it may be further determined whether the text region can display the first text by combining the shape of the text region, which is not limited in detail in this embodiment.
In the case that the text region is judged to be incapable of displaying the first text, the first text can be displayed in the text region in a mode of extracting keywords. The keyword extraction implementation method can be, but is not limited to, extracting keywords based on recognition results of text semantic recognition and extracting keywords by adopting a text head-tail word extraction mode, wherein the text head-tail word extraction mode refers to extracting a plurality of keywords positioned at the front and a plurality of keywords positioned at the tail in a text, and the extraction quantity of the keywords can be determined according to the shape and the size of a text region. Based on this, in a specific implementation manner, the "extracting at least one keyword adapted to the text region from the first text" in 204 may include:
2041. Determining the extraction quantity of keywords based on the shape and the size of the text region;
2042. semantic recognition of the first text, extracting the number of keywords embodying the first text center semantic meaning from the first text based on the semantic recognition result, or
2043. Extracting N keywords positioned at the front part and M keywords positioned at the tail part in the text to obtain the keywords, wherein N and M are natural numbers, and the sum of N and M is equal to the number.
In implementation, the actual size of the text which can be used for displaying the text in the text area can be determined based on the shape and the size of the text area and the character size of the first text, so that the extraction quantity of the keywords is determined according to the actual size and the character size of the first text. Then, a semantic recognition mode or a text head-tail word taking mode can be adopted for the first text, and a plurality of keywords can be extracted from the first text. Specific implementations relating to extracting a number of keywords from a first text by using a semantic recognition method or a text head-to-tail word method can be seen in the existing content.
In 205 above, after extracting at least one keyword of the adapted text region from the first text, when the chart is displayed, the rendering layer may be called to render the at least one keyword, so as to display the at least one keyword in the text region. See above for details regarding the implementation in step 205.
Further, in order to ensure that the first text can be completely conveyed to the user, when the chart is displayed, at least one keyword corresponding to the first text is displayed in the text area, the corresponding text region can also be displayed a curtailed logo (e.g. ellipses ","), the reduced content for providing the first text is provided by the keywords presented in the user text region. In this case, a corresponding hover event may also be added for the text region so that when an operation is triggered for the text region (e.g., moving a mouse over the text region), the first text may be displayed in the floating window so that the user knows the entire content of the first text. For specific details regarding hover time, reference is made to the above-related matters, and no specific details are provided herein. Based on this, the method provided in this embodiment may further include the following steps:
206a, displaying a reduced mark in the text region when displaying the chart, so as to prompt a user that the keywords displayed in the text region are reduced contents of the first text;
206b, displaying the first text in a floating window in response to a user operation on the text region.
For specific implementation principles of 205 and 206, reference should be made to the above embodiments.
Further, the method provided in this embodiment may further include the following steps:
207a, if it is determined that the first text can be displayed 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, displaying rows and displaying characters in each row are laid out in the text area;
207b, displaying the first text in the text area according to the display line number and the display character number of each line when displaying the chart.
In the implementation, the maximum number of characters which can be displayed in each line in the text area can be determined according to the display size of the characters and the shape and the size of the text area, and then, the display line number and the display character number of each line are further combined with the number of characters contained in the second text, so that when the chart is displayed, the first text is displayed in the text area according to the display line number and the display character number of each line.
According to the technical scheme, on the basis of obtaining the text region of the chart to be displayed and the first text to be displayed in the text region, the first text can be displayed in the text region according to the determined character size of the first text, the character amount contained in the first text and the region information of the text region, and when the text cannot be displayed in the text region, at least one keyword matched with the text region is extracted from the first text, so that when the chart is displayed, the at least one keyword is displayed in the text region. The method for extracting the keywords can realize chart display, can effectively ensure that text information in the chart can be completely transmitted to a user while ensuring clear chart presentation, and is beneficial to improving user experience.
Considering that in the process of planning corresponding text regions for a plurality of texts in chart information by 201, there are often situations that it is difficult to plan corresponding text regions for some texts, for example, because the supply chain operation data is affected by some factors to have large volatility, resulting in large data span, so that corresponding element regions of chart elements reflecting data information are smaller (such as the block regions corresponding to the fan-shaped blocks 4 and 5 shown in fig. 5b are smaller), and for those chart elements with smaller element regions, corresponding text regions cannot be planned for texts associated with those chart elements. For the text which cannot be planned out of the corresponding text area, the hidden mode can be adopted for processing when the chart is displayed. Based on this, the chart display method provided in the embodiment may further include the following steps:
S11, obtaining chart information of a chart to be displayed;
S12, planning corresponding text areas for a plurality of texts in the chart information;
s13, when a second text which cannot be planned out of a corresponding text area exists, marking the second text as a hidden text, so that the second text is hidden when the chart is displayed;
And S12, responding to the operation of hiding the chart elements of the second text in the chart by a user, and displaying the hidden second text, wherein the chart comprises a plurality of chart elements reflecting corresponding data information.
For a specific description of the above step S11, see the above-mentioned relevant contents.
In S12, because the charts have diversity, charts of different types and/or charts belonging to the same type often have differences when laying out and planning text regions corresponding to a plurality of texts of the corresponding charts. But generally, the planning result for planning the text region corresponding to the text based on the positional relationship of the text with respect to the chart element may generally include two of planning the text region corresponding to the text outside the corresponding chart element (the coordinate axis text indicated by the part a and the outside text located above the top of the distance block in the bar chart shown in fig. 4 a), and planning the text region corresponding to the text inside the corresponding chart element (the text located inside the distance block indicated by the part C in the bar chart shown in fig. 4B). When the text region corresponding to the text is planned outside the corresponding chart element, the text region corresponding to the text is planned in the free region on the basis of determining the free region in the chart region based on the chart region and the element regions corresponding to the chart elements of the chart. Meanwhile, in the text region planning process, if at least two text regions overlap, the size of at least part of the overlapped at least two text regions can be adjusted, or at least part of the overlapped at least two text regions can be moved, so that the overlapped at least two text regions are staggered.
That is, in one possible technical solution, the step S12 "planning corresponding text regions for a plurality of texts in the chart information" may specifically include:
s121, determining a chart region and an element region corresponding to each of a plurality of chart elements displayed in the chart region;
S122, determining an idle area according to the chart area and the element areas corresponding to the chart elements;
s123, respectively defining text areas for the texts in free areas around element areas corresponding to the related chart elements based on the related chart elements of the texts;
and S124, when the text regions overlap, adjusting at least partial regions in at least two overlapped text regions to stagger the text regions.
In the implementation, after determining the free area in the chart area, the method can firstly define text areas for the texts based on the chart elements related to the texts according to the size, the shape and the like of the preset text areas, respectively define the text areas for the texts in the free area around the element area corresponding to the related chart elements, and then adjust at least two overlapped text areas to stagger the overlapped text areas.
When the text region corresponding to the text is planned in the corresponding chart element, the corresponding text region may be respectively defined for the plurality of texts based on the element regions corresponding to the chart elements included in the chart. That is, in another possible technical solution, the step S12 "planning corresponding text regions for a plurality of texts in the chart information" may specifically include:
S121', determining element areas corresponding to a plurality of chart elements contained in the chart;
and S122', respectively defining text areas for the texts in the element areas corresponding to the associated chart elements based on the chart elements associated with the texts.
It should be noted that, for the specific implementation of defining text regions for a plurality of texts in the element regions corresponding to the chart elements associated with the texts, reference may be made to the existing content. In addition, the shape, size, etc. of the text region defined for the text are not limited in this embodiment, and only the text region is ensured to be in the element region corresponding to the corresponding chart element.
In S13 and S12, when a second text (such as the text (not specifically shown in the drawing) associated with the sector 4 and the sector 5 shown in fig. 5 b) in which the corresponding text region cannot be planned is marked as a hidden text, and when the second text is subjected to hiding processing in the diagram display, a hover event may be added to a diagram element associated with the second text, so that when the user triggers an operation to hide the diagram element of the second text in the diagram through, for example, a mouse, the hidden second text may be displayed. For specific implementations of adding hover events, see above related content.
The sectors 4 and 5 in the pie chart shown in fig. 5b are chart elements with the second text hidden, and the sectors 4 and 5 are each added with a corresponding hover event.
Fig. 8 is a schematic structural diagram of a chart showing apparatus according to an embodiment of the present application. As shown in fig. 8, the chart display device comprises a determining module 31, an acquiring module 32, a processing module 33 and a display module 34. Wherein,
A determining module 31, configured to determine a presentation type of a text in a chart to be presented;
an obtaining module 32, configured to obtain a text processing policy corresponding to the presentation type;
The determining module 31 is further configured to determine a target text in the chart;
the processing module 33 is configured to process the target text according to the text processing policy, so as to obtain a text display object and a display area after the target text is processed;
a display module 34 for displaying the text display object at the display area of the chart when the chart is displayed;
Further, the determining module 31 is specifically configured to, when used for determining a target text in the chart, find whether there is a long text with a text length greater than a threshold value from a plurality of texts included in the chart, determine the long text as the target text when the chart contains the long text, determine whether there are at least two texts with text overlapping based on a graphic structure of the chart, and determine the at least two texts as the target text when there is the at least two texts.
Further, the chart comprises a plurality of chart elements, namely a plurality of texts, one chart element is associated with at least one text, and the display type of the text comprises an out-of-area text displayed outside the corresponding element area of the chart element, an in-area text displayed inside the corresponding element area of the chart element and a coordinate axis text.
Further, when the display type is the text outside the area, the text processing strategy corresponding to the text outside the area comprises a first sub-strategy for carrying out line separation processing on the text, a second sub-strategy for extracting keywords from the text, a third sub-strategy for staggering the display with the overlapped text, and
The processing module 33 is specifically configured to obtain, when the target text is processed according to the text processing policy, area information of a text area corresponding to the target text and a text display size of the target text, select at least one sub-policy from the first sub-policy and the second sub-policy according to the area information and the text display size when the target text does not overlap with surrounding text, process the target text by using the selected at least one sub-policy, obtain, when the target text overlaps with wrinkled text, an overlapping area size of the target text, a movable space of the target text, that is, a movable space of surrounding text, and adjust and/or move the text area corresponding to the target text by using the third sub-policy so as to be staggered with the surrounding text.
Further, when the display type is the text in the area, the text processing strategy corresponding to the text in the area comprises a first sub-strategy for carrying out the line separation processing on the text, a second sub-strategy for extracting keywords from the text and a fourth sub-strategy for carrying out the hiding processing on the text, and
The processing module 33 is specifically configured to obtain, when processing the target text according to the text processing policy, area information of a text area corresponding to the target text and the target text display size, select at least one sub-policy from the first sub-policy, the second sub-policy, and the third sub-policy according to the area information and the text display size, and process the target text by using the selected at least one sub-policy.
Further, when the display type is the coordinate axis text, the text processing strategy corresponding to the coordinate axis text comprises a first sub-strategy for carrying out the line separation processing on the text and a second sub-strategy for extracting keywords from the text, and
The processing module 33 is specifically configured to obtain, when processing a target text according to the text processing policy, area information of a text area corresponding to the target text and a text display size of the target text, select at least one sub-policy from the first sub-policy and the second sub-policy according to the area information and the text display size, and process the target text by using the selected at least one sub-policy.
It should be noted that, the schematic display device provided in the foregoing embodiment may implement the technical solution described in the foregoing embodiment of the schematic display method shown in fig. 1, and the specific implementation principle of each module or unit may refer to the corresponding content in the foregoing embodiment of the schematic display method shown in fig. 1, which is not repeated herein.
Fig. 9 is a schematic structural diagram of a chart showing apparatus according to an embodiment of the present application. As shown in fig. 9, the chart display device includes an acquisition module 41, a determination module 42, a decision extraction module 43, and a display module 44. Wherein,
An obtaining module 41, configured to obtain a text region of a chart to be displayed and a first text to be displayed in the text region;
a determining module 42 for determining a character size of the first text;
A judging and extracting module 43, configured to judge 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;
And a display module 44, configured to display the at least one keyword in the text region.
Further, the judgment extraction module 43 is specifically configured to determine, when extracting at least one keyword adapted to the text region from the first text, an extraction number of keywords based on a shape and a size of the text region, perform semantic recognition on the first text, extract, based on a semantic recognition result, the number of keywords reflecting the central semantic meaning of the first text from the first text, or extract N keywords located at the front and M keywords located at the tail in the text, to obtain the number of keywords, where N and M are natural numbers, and a sum of N and M is equal to the number.
Further, the display module 44 is further configured to display a reduced identifier in the text region to prompt the user that the keyword displayed in the text region is a reduced content of the first text when displaying the chart, and
The device provided by the embodiment further comprises a response module, wherein the response module is used for responding to the operation for aiming at the text area and displaying the first text in the floating window.
Further, the device provided by the embodiment further comprises a layout module, which is used for laying out the display line number, namely the display character number of 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 the size of the text area if the first text can be displayed in the text area, and correspondingly,
The display module 44 displays the first text in the text region according to the display line number and the display character number of each line when displaying the chart.
Further, the above-mentioned obtaining module 41 is further configured to obtain chart information of a chart to be displayed, and the apparatus provided in this embodiment further includes a planning marking module configured to plan a corresponding text region for a plurality of texts in the chart information, mark a second text that cannot be planned out of the corresponding text region as a hidden text when the second text exists, so as to hide the second text when the chart is displayed, and correspondingly,
The display module 44 is further configured to display the second text that is hidden in response to a user operation for hiding the chart element of the second text in the chart, where the chart includes a plurality of chart elements that reflect corresponding data information.
The planning marking module is used for determining a chart region and element regions corresponding to a plurality of chart elements displayed in the chart region when corresponding text regions are planned for a plurality of texts in the chart information, determining free regions according to the chart region and the element regions corresponding to the chart elements, respectively defining text regions for the texts in the free regions around the element regions corresponding to the chart elements based on the chart elements associated with the texts, and adjusting at least partial regions in at least two overlapped text regions to stagger the text regions when the text regions overlap.
Further, the planning identification module is specifically configured to determine element areas corresponding to a plurality of chart elements included in the chart when planning corresponding text areas for a plurality of texts in the chart information, and define text areas for the plurality of texts respectively in the element areas corresponding to the chart elements associated with the plurality of texts based on the chart elements associated with the plurality of texts.
It should be noted that, the schematic display device provided in the foregoing embodiment may implement the technical solution described in the foregoing embodiment of the schematic display method shown in fig. 2, and the specific implementation principle of each module or unit may refer to the corresponding content in the foregoing embodiment of the schematic display method shown in fig. 2, which is not repeated herein.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device comprises a processor 52 and a memory 51. Wherein the memory 51 is configured to store one or more computer instructions, and the processor 52 is coupled to the memory 51, and configured to execute the one or more computer instructions (e.g., those that implement data storage logic) to implement the steps of the various diagram illustrative method embodiments described above.
The memory 51 may be implemented by any type of volatile or non-volatile memory device or 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 or optical disk.
Further, as shown in FIG. 10, the electronic device further includes a communication component 53, a power supply component 55, a display 54, and other components. Only some of the components are schematically shown in fig. 10, which does not mean that the electronic device only comprises the components shown in fig. 10.
Yet another embodiment of the application provides a computer program product (not shown in the drawings of the specification). The computer program product comprises a computer program or instructions which, when executed by a processor, cause the processor to carry out the steps of the method embodiments described above.
Accordingly, embodiments of the present application also provide a computer-readable storage medium storing a computer program which, when executed by a computer, is capable of implementing the method steps or functions provided by the above embodiments.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.

Claims (14)

1. A chart presentation method, comprising:
determining the display type of the text in the chart to be displayed;
acquiring a text processing strategy corresponding to the display type;
determining a target text in the chart;
Processing 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;
displaying the text display object at the display area of the chart when the chart is displayed;
When the display type is the text outside the area, if the target text is overlapped with surrounding text, the text area corresponding to the target text is adjusted and/or moved so as to be displayed in a staggered manner with the surrounding text.
2. The method of claim 1, wherein determining the target text in the chart comprises at least one of:
searching whether a long text with the text length larger than a threshold value exists in a plurality of texts contained in the chart, and determining the long text as a target text when the long text is contained in the chart;
and determining whether at least two texts with overlapped texts exist or not based on the graph structure of the chart, and determining the at least two texts as target texts when the at least two texts exist.
3. The method of claim 1 or 2, wherein the chart comprises a plurality of chart elements and a plurality of texts, one chart element being associated with at least one text;
The display types of the text comprise an out-of-area text displayed outside the corresponding element area of the chart element, an in-area text displayed inside the corresponding element area of the chart element and a coordinate axis text.
4. The method of claim 3, wherein when the presentation type is an out-of-area text, the text processing policy corresponding to the out-of-area text comprises a first sub-policy for performing line processing on the text, a second sub-policy for extracting keywords from the text, a third sub-policy for staggering presentation from overlapping text, and
Processing the target text according to the text processing strategy, including:
Acquiring region information of a text region corresponding to a target text and a text display size of the target text;
When the target text does not overlap with surrounding text, 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;
When the target text is overlapped with the surrounding text, acquiring the size of the overlapped area of the target text, the movable space of the target text and the movable space of the surrounding text, and adjusting and/or moving the text area corresponding to the target text by utilizing the third sub-strategy so as to be staggered with the surrounding text.
5. The method of claim 3, wherein when the presentation type is in-region text, the text processing policy corresponding to the in-region text includes a first sub-policy for performing a line separation process on the text, a second sub-policy for extracting keywords from the text, a fourth sub-policy for performing a hiding process on the text, and
Processing the target text according to the text processing strategy, including:
Acquiring region information of a text region 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-policy.
6. The method of claim 3, wherein when the presentation type is a coordinate axis text, the text processing policy corresponding to the coordinate axis text includes a first sub-policy for performing a line separation process on the text, a second sub-policy for extracting keywords from the text, and
Processing the target text according to the text processing strategy, including:
Acquiring region information of a text region 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-policy.
7. A chart presentation method, comprising:
Acquiring a text region of a chart to be displayed and a first text to be displayed in the text region;
determining a character size of the first text;
Judging 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, extracting at least one keyword adapting to the text region from the first text;
displaying the at least one keyword in the text area when the chart is displayed;
When the text areas are overlapped, at least partial areas in at least two overlapped text areas are adjusted to stagger the text areas.
8. The method of claim 7, wherein extracting at least one keyword from the first text that fits the text region comprises:
Determining the extraction quantity of keywords based on the shape and the size of the text region;
semantic recognition of the first text, extracting the number of keywords embodying the first text center semantic meaning from the first text based on the semantic recognition result, or
Extracting N keywords positioned at the front part and M keywords positioned at the tail part in the text to obtain the keywords, wherein N and M are natural numbers, and the sum of N and M is equal to the number.
9. The method according to claim 7 or 8, further comprising:
when the chart is displayed, a reduction mark is displayed in the text area so as to prompt a user that the keywords displayed in the text area are the reduced content of the first text;
And displaying the first text in a floating window in response to the operation of the user on the text region.
10. The method according to claim 7 or 8, further comprising:
If the fact that the first text can be displayed in the text area is determined, according to the number of characters contained in the first text, the display size of the characters and the shape and the size of the text area, the display line number and the display character number of each line are distributed in the text area;
And when the chart is displayed, displaying the first text in the text area according to the display line number and the display character number of each line.
11. The method according to claim 7 or 8, further comprising:
acquiring chart information of a chart to be displayed;
Planning corresponding text areas for a plurality of texts in the chart information;
When a second text which cannot be planned out of a corresponding text area exists, marking the second text as a hidden text, so that the second text is hidden when the chart is displayed;
responsive to a user operation to hide chart elements of the second text in the chart, displaying the hidden second text;
wherein the chart comprises a plurality of chart elements reflecting corresponding data information.
12. The method of claim 11, wherein planning corresponding text regions for a plurality of texts in the chart information comprises:
determining a chart area and element areas corresponding to a plurality of chart elements displayed in the chart area respectively;
determining an idle region according to the chart region and the element regions corresponding to the chart elements;
based on the chart elements respectively associated with the texts, respectively defining text areas for the texts in free areas around element areas corresponding to the respectively associated chart elements;
when the text regions overlap, at least some of at least two text regions where the overlapping occurs are adjusted to stagger the text regions.
13. The method of claim 11, wherein planning corresponding text regions for a plurality of texts in the chart information comprises:
determining element areas corresponding to a plurality of chart elements contained in the chart;
and respectively defining text areas for the texts in element areas corresponding to the associated chart elements based on the chart elements associated with the texts.
14. An electronic device is characterized by comprising a memory and a processor, wherein,
The memory stores one or more computer instructions;
The processor, coupled to the memory, is configured to execute the one or more computer instructions for implementing the steps of the method of any of the preceding claims 1 to 6 or the steps of the method of any of the preceding claims 7 to 13.
CN202210220861.5A 2022-03-08 2022-03-08 Graphic display method and electronic device Active CN114662450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210220861.5A CN114662450B (en) 2022-03-08 2022-03-08 Graphic display method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210220861.5A CN114662450B (en) 2022-03-08 2022-03-08 Graphic display method and electronic device

Publications (2)

Publication Number Publication Date
CN114662450A CN114662450A (en) 2022-06-24
CN114662450B true CN114662450B (en) 2025-03-11

Family

ID=82028621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210220861.5A Active CN114662450B (en) 2022-03-08 2022-03-08 Graphic display method and electronic device

Country Status (1)

Country Link
CN (1) CN114662450B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3150619A1 (en) * 2023-06-28 2025-01-03 Orange Process for processing visual content

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106873925A (en) * 2015-12-10 2017-06-20 北京国双科技有限公司 The display methods and device of label text
CN110287472A (en) * 2019-06-28 2019-09-27 湖南御家科技有限公司 Report configuration method, system, equipment and computer readable storage medium
CN112084378A (en) * 2020-09-27 2020-12-15 中国建设银行股份有限公司 Single graph display method and device for data
CN113705156A (en) * 2021-08-30 2021-11-26 上海哔哩哔哩科技有限公司 Character processing method and device
CN114117164A (en) * 2021-11-03 2022-03-01 北京完美知识科技有限公司 Method, device and storage medium for simultaneously arranging multiple national government rights

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915122B (en) * 2012-07-19 2015-11-11 上海交通大学 Based on the intelligent family moving platform spelling input method of language model
CN104572822B (en) * 2014-12-04 2018-09-04 百度在线网络技术(北京)有限公司 Text shows method and device
CN108647348A (en) * 2018-05-15 2018-10-12 平安普惠企业管理有限公司 Textual presentation method, apparatus, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106873925A (en) * 2015-12-10 2017-06-20 北京国双科技有限公司 The display methods and device of label text
CN110287472A (en) * 2019-06-28 2019-09-27 湖南御家科技有限公司 Report configuration method, system, equipment and computer readable storage medium
CN112084378A (en) * 2020-09-27 2020-12-15 中国建设银行股份有限公司 Single graph display method and device for data
CN113705156A (en) * 2021-08-30 2021-11-26 上海哔哩哔哩科技有限公司 Character processing method and device
CN114117164A (en) * 2021-11-03 2022-03-01 北京完美知识科技有限公司 Method, device and storage medium for simultaneously arranging multiple national government rights

Also Published As

Publication number Publication date
CN114662450A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
US11501256B2 (en) Digital processing systems and methods for data visualization extrapolation engine for item extraction and mapping in collaborative work systems
US20220222222A1 (en) Digital processing systems and methods for draft and time slider for presentations in collaborative work systems
US10409895B2 (en) Optimizing a document based on dynamically updating content
AU2014349834B2 (en) Navigable layering of viewable areas for hierarchical content
US10545643B2 (en) User interface for data comparison
EP1703364B1 (en) Word or character boudary-based scratch-out gesture recognition
KR101811464B1 (en) Spin control user interface for selecting options
US7911465B2 (en) Techniques for displaying information for collection hierarchies
CN110362242B (en) Map display method and terminal equipment
US11080464B2 (en) Correction techniques of overlapping digital glyphs
US20090282325A1 (en) Sparklines in the grid
US10565560B2 (en) Alternative people charting for organizational charts
US20150178259A1 (en) Annotation hint display
CN114662450B (en) Graphic display method and electronic device
US11189010B2 (en) Method and apparatus for image processing
US20240265595A1 (en) Display device and method for displaying chart
US8810580B2 (en) Method and tool for creating irregular-shaped tables
CN116383545B (en) Webpage report template generation method, device, equipment and medium
CN117992602A (en) WebGL-based dynamic high-performance batch text rendering method, system and program product
CN111523288B (en) Display method and device for aerial view of PDF document
CN114489409A (en) Picture processing method and device, electronic equipment and storage medium
US20210374331A1 (en) Spreadsheet system and method for unaligned placement and evaluation of cells
JP2025025416A (en) PROGRAM, INFORMATION PROCESSING APPARATUS, AND METHOD FOR CONTROLLING INFORMATION PROCESSING APPARATUS
CN118171005A (en) A method and system for local rendering of network traffic
US20210374325A1 (en) System and method for providing a spreadsheet with cells having both text and evaluable subcells

Legal Events

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