CN113012258A - Method and device for generating multi-segment line graph, electronic equipment and readable medium - Google Patents

Method and device for generating multi-segment line graph, electronic equipment and readable medium Download PDF

Info

Publication number
CN113012258A
CN113012258A CN202110272493.4A CN202110272493A CN113012258A CN 113012258 A CN113012258 A CN 113012258A CN 202110272493 A CN202110272493 A CN 202110272493A CN 113012258 A CN113012258 A CN 113012258A
Authority
CN
China
Prior art keywords
sub
line graph
data list
node
type
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.)
Granted
Application number
CN202110272493.4A
Other languages
Chinese (zh)
Other versions
CN113012258B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110272493.4A priority Critical patent/CN113012258B/en
Publication of CN113012258A publication Critical patent/CN113012258A/en
Application granted granted Critical
Publication of CN113012258B publication Critical patent/CN113012258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Generation (AREA)

Abstract

A method, a device, an electronic device and a readable storage medium for generating a segment line graph are provided, which relate to the technical field of computers, in particular to the technical field of data processing. The method comprises the following steps: acquiring a data list used for generating a segmented line graph, wherein the data list comprises a plurality of data items, each data item comprises a type value, each data item corresponds to one node of the segmented line graph to be generated, and the type value is used for representing the node type of the corresponding node in the segmented line graph; acquiring one or more subdata lists from the data list according to different type values, wherein each subdata list corresponds to a node type; acquiring configuration information of each subdata list, and generating a sub-line graph corresponding to the subdata list based on the configuration information; and generating a segmentation line graph based on the sub line graphs corresponding to each sub data list.

Description

Method and device for generating multi-segment line graph, electronic equipment and readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a multi-segment line graph, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The line graph reflects the trend of changes of things with time or ordered categories, and is a data expression mode frequently used in real life. The attractive and complex line graph can bear more data expression contents, and the data contents expressed by a single simple line graph are also single.
In the related art, various line graphs are usually required to be customized in the production of a Web end, and a single-style line graph cannot meet the actual business requirement.
Disclosure of Invention
According to an aspect of the present disclosure, a method of generating a segment line graph is provided. The method comprises the following steps: acquiring a data list used for generating a segmented line graph, wherein the data list comprises a plurality of data items, each data item comprises a type value, each data item corresponds to one node of the segmented line graph to be generated, and the type value is used for representing the node type of the corresponding node in the segmented line graph; acquiring one or more subdata lists from the data list according to different type values, wherein each subdata list corresponds to a node type; acquiring configuration information of each subdata list, and generating a sub-line graph corresponding to the subdata list based on the configuration information; and generating a segmentation line graph based on the sub line graphs corresponding to each sub data list.
According to another aspect of the present disclosure, there is provided an apparatus for generating a multi-segment line graph, including: the device comprises an acquisition unit, a first generation unit, a second generation unit and a third generation unit. The acquisition unit is configured to acquire a data list for generating a segment line graph. The data list includes a plurality of data items, each data item including a type value, and wherein each data item corresponds to a node of the segmented line graph to be generated, the type value being used to represent a node type of the respective node in the segmented line graph. The first generation unit is configured to obtain one or more sub data lists from the data list according to different type values, wherein each sub data list corresponds to a node type. The second generation unit is configured to acquire, for each sub data list, configuration information of the sub data list, and generate a sub line graph corresponding to the sub data list based on the configuration information. The third generation unit is configured to generate a segment line graph based on the sub line graph corresponding to each sub data list.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing a computer program is provided. The computer program, when executed by a processor of a computer, is operative to cause the computer to perform a method according to an embodiment of the disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program. The computer program, when executed by a processor of a computer, is operative to cause the computer to perform a method according to an embodiment of the disclosure.
According to one or more embodiments of the present disclosure, a polyline graph can be drawn in segments according to a type value in a given data list, so that each segment of sub-polyline graph has different configuration information, and a segment statistical graph meeting business requirements can be drawn.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of a method of generating a multi-segment line graph according to an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a multi-segment line graph according to an embodiment of the present disclosure;
FIG. 4 shows a schematic diagram of a multi-segment line graph according to an embodiment of the present disclosure;
FIG. 5 shows a schematic diagram of a method of generating a multi-segment line graph according to an embodiment of the present disclosure;
FIG. 6 shows a block diagram of an apparatus for generating a multi-segment line graph according to an embodiment of the present disclosure; and
FIG. 7 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, the timing relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
The line graph reflects the trend of changes of things with time or ordered categories, and is a data expression mode frequently used in real life. At present, the existing line graph generation method can only draw a single simple line graph and cannot meet the actual business requirements.
Therefore, the present disclosure provides a method for generating a segmented broken line graph, which can perform segmented drawing on the broken line graph according to the type value in a given data list, so that each segment of sub-broken line graph has different configuration information, and thus a segmented statistical graph meeting business requirements can be drawn.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with embodiments of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the method of generating a segmentation line graph of the present disclosure to be performed.
In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In certain embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may report an error log of the applet using the client devices 101, 102, 103, 104, 105, and/or 106. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft WINDOWS, APPLE iOS, UNIX-like operating systems, LINUX, or LINUX-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT WINDOWS Mobile OS, iOS, WINDOWS Phone, ANDROID. Portable handheld devices may include cellular telephones, smart phones, tablets, Personal Digital Assistants (PDAs), and the like. Wearable devices may include head mounted displays and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The data store 130 may reside in various locations. For example, the data store used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The data store 130 may be of different types. In certain embodiments, the data store used by the server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Fig. 2 shows a flow diagram of a method 200 of generating a segmentation line graph according to an embodiment of the present disclosure. The method 200 may be performed at a client device (e.g., any of the client devices 101-106 shown in fig. 1). In some embodiments, method 200 may be performed at a server (e.g., server 120 shown in fig. 1). In other embodiments, method 200 may be performed by a client device (e.g., any of client devices 101-106) in combination with a server (e.g., server 120). As shown in fig. 2, method 200 may include the following steps.
In step 201, a data list for generating a segment line graph is obtained.
For example, a data list may include a plurality of data items, each data item including an abscissa value, an ordinate value, and a type value of the data item. Each data item corresponds to a node of the segmented line graph to be generated, and the type value may be used to represent the node type of the corresponding node in the segmented line graph.
At step 202, one or more sub data lists are obtained from the data list according to the different type values.
Illustratively, each child data list may correspond to a node type.
In step 203, for each sub data list, the configuration information of the sub data list is obtained, and based on the configuration information, a sub line graph corresponding to the sub data list is generated.
At step 204, a segmented line graph is generated based on the sub-line graphs corresponding to each sub-data list.
Therefore, the broken line graph can be drawn in a segmented mode according to the type value in the given data list, each segment of sub-broken line graph has different configuration information, and therefore the segmented statistical graph meeting the business requirements can be drawn.
In some examples, a sub-line graph may refer to one of the segments of the line graph, which may be understood as a portion of the segment line graph. In other examples, the sub-line graph may be the same as the segment line graph when the segment line graph has only one segment.
In some embodiments, the data items in the data list may have the following form:
1604160000,// the abscissa value of the data item
"robustness"/the ordinate value of the data item
"period": XX period,// the type value of the data item }.
Illustratively, data list a may have the form: [ { "date":1604160000, "priority": 2, "period": XX phase "}, {" date ":1604246400," priority ":3," priority ": XX phase" }, { "date":1604851200, "priority": 14, "priority": YY phase "}, {" date ":1604937600," priority ":18," priority ": YY phase" }, { "date": 29, "priority": ZZ phase "}, {" date ":1605196800," priority ":36," priority ": ZZ phase" }.
In some embodiments, one or more sub data lists may be obtained from the data list based on different type values in the data list. In some examples, each child data list further includes: the starting serial number of the node type corresponding to the sub data list, the name of the node type, the content of the interval in the preset interval and the broken line type of the sub broken line graph corresponding to the sub data list.
The preset interval is formed based on the starting sequence number of the node type corresponding to the subdata list and the starting sequence number of the node type corresponding to the next adjacent subdata list. The section content includes abscissa and ordinate values of the data items in the data list. Therefore, according to the content included in the sub data list, the information expressed by the generated segmented polyline graph can be richer. In some examples, the preset interval may be composed of a start sequence number of a node type corresponding to the sub data list and a start sequence number-1 of a node type corresponding to a next adjacent sub data list.
Illustratively, for the above data list a, 3 sub data lists a1, a2 and A3 may be obtained, sorted by the type value period. Illustratively, child data list A1 may be: [ { "indexNum":0, "status": "XX 'stage", "value": 2,3], "lineType": solid "} ], wherein" 0 "may represent the start sequence number of the node type corresponding to the sub-data list a1," XX' stage "may represent the name of the node type," [2,3] may represent the content of the numerical range within the preset range, and "solid" may represent the broken line type, e.g., a solid line, of the sub-broken line diagram corresponding to the sub-data list a 1. Sub-data list A2 may be: [ { "indexNum":2, "status": "YY 'period", "value": 14,18], "lineType": solid "} ], where" 2 "may represent the start sequence number of the node type corresponding to the sub-data list a2," YY' period "may represent the name of the node type," [14,18] "may represent the content of the numerical interval within the preset interval, and" solid "may represent the broken line type, e.g., a solid line, of the sub-broken line graph corresponding to the sub-data list a 2. Sub-data list A3 may be: [ { "indexNum":4, "status": "ZZ' stage", "value": 29,36, "" lineType ": dotted" }. Where "4" may represent the starting sequence number of the node type corresponding to the sub data list A3, "ZZ' period" may represent the name of the node type, "[ 29,36 ]" may represent the content of the numerical range within the preset range, and "dotted" may represent the broken line type of the sub broken line diagram corresponding to the sub data list A3, for example, a dotted line.
In some examples, the polyline line type may include, for example, a solid line, a dashed line, a dotted line, and the like. For a given data list used to generate a line graph, each data item in the data list may be a node in the line graph, and a node may be a point that makes up the line graph. For example, the abscissa value of the data item may represent information such as time, the ordinate value of the data item may represent information such as a numerical value, and the type value of the data item may represent a node type of the segment line graph.
In some examples, the node types may be types of points that make up a line graph, such as plus signs, small circles, asterisks, solid points, cross signs, diamonds, triangles up, triangles down, triangles right, triangles left, squares, regular hexagons, regular pentagons, and so forth.
In some embodiments, the configuration information of each sub data list includes attribute information of the sub line graph corresponding to the sub data list. The attribute information may include: one or more of color information of a node of the sub-line drawing, top color information of a region corresponding to the sub-line drawing, and bottom color information of a region corresponding to the sub-line drawing. Therefore, the colors and the area representation of the generated line graph are richer through the color information, the top color information and the bottom color information of the nodes of the segmented line graph, and the various customization requirements are met. In some examples, the color information of the nodes of the sub-line graph may represent the colors of the nodes of the sub-line graph. Colors may include, for example, red, green, blue, cyan, yellow, black, white, magenta, and the like.
Fig. 3 shows a schematic diagram of a segment line graph 300 according to an embodiment of the present disclosure. As shown in FIG. 3, the segmented line graph 300 includes three sub-line graphs 301-303, each sub-line graph 301-303 corresponding to one segment of the segmented line graph 300. The node type of the sub-line graph 301 may be an open circle, the node type of the sub-line graph 302 may be a filled circle, and the node type of the sub-line graph 303 may be a star. In some examples, the open circles of the sub-line diagram 301 may be, for example, red, etc., the filled circles of the sub-line diagram 302 may be, for example, yellow, etc., and the stars of the sub-line diagram 303 may be, for example, magenta, etc.
In some examples, the region corresponding to the sub-line drawing may refer to a region constituted by a line segment, left and right boundary lines, and an abscissa axis of the sub-line drawing. Fig. 4 shows a schematic diagram of a segmented line graph 400 according to an embodiment of the present disclosure. As shown in fig. 4, the segmented line graph 400 includes sub-line graphs 401 and 402. The area corresponding to the sub-line drawing 401 may be an area formed by a broken line segment, left and right boundary lines, and an abscissa axis of the sub-line drawing 401, for example, the area 4011. The region corresponding to the sub-line diagram 402 may be a region formed by a broken line segment, left and right boundary lines, and an abscissa axis of the sub-line diagram 402, for example, the region 4021. The top color of the region 4011 may be light gray, for example, and the bottom color of the region 4011 may be near white, for example. The top color of region 4021 may be dark gray, for example, and the bottom color of region 4011 may be near white, for example.
In some embodiments, generating the sub-line graph corresponding to the sub-data list based on the configuration information may include: generating a sub-line graph based on one or more of the color information of the node, the top color information, and the bottom color information. Therefore, the segmented line graphs formed by one or more sub-line graphs have different color configurations, so that the customization requirements of business requirements are met, and the generated segmented line graphs can express richer information.
Fig. 5 shows a schematic diagram of a method 500 of generating a segmentation line graph according to an embodiment of the present disclosure. As shown in fig. 5, method 500 may include the following flow.
An input data list 501 may be obtained, each data item in the input data list 501 including an X-coordinate value, a Y-coordinate value, and a type value for the data item. The input data list 501 is traversed circularly, and the type list 502 and the data list 503 can be obtained according to different type values in the input data list 501. The data list 503 may be one or more, and the number of types corresponding to the type value is the same. Looping through the type list 502 may obtain a transition list 504. Transition list
In 504 are recorded: starting sequence number, type name, and corresponding value list for each type in type list 502
503 (section contents corresponding to a section "[ starting sequence number of current type, starting sequence number-1 of next type ]" in the input data list 501) and a polyline type (e.g., solid line, dotted line, etc.). After the transition list 504 is obtained, the list may be looped and combined with an empty list template 506 (e.g., a list with data item content of "-"), a chart style template 505 (including information for chart name, X-axis attribute, Y-axis attribute, etc.), and segment color configuration information 507 into a new chart data template 508. By rendering the new graph data template 508, a segmented polyline statistical graph may be generated.
As an example, the input data list 501 is represented as: [ { "date":1604160000, "priority": 2, "period": "menstrual period" }, { "date":1604246400, "priority": 3, "period": "menstrual period" }, { "date":1604851200, "priority": 14, "period": "safe period" }, { "date":1604937600, "priority": 18, "priority": safe period "}, {" date "}, {" ovulation ":1605110400," date ":1605196800," priority ":36," period ": ovulation" }.
Accordingly, based on the different type values in the input data list 501, a type list 502 can be obtained, which can be expressed as: [ { "indexNum":0, "status": "menstrual period", "lineType": "solid" }, { "indexNum":2, "status": "safety period", "lineType": "solid" }, { "indexNum":4, "status": "ovulation period", "lineType": "solid" } ], wherein indexNum may represent the starting sequence number of the type in the type list 502, status may represent the type name, and lineType may represent the broken line type. Accordingly, 3 data lists 503 may also be obtained, which may include, for example: [2,3],[14,18],[29,36]. Accordingly, transition list 504 may be represented as: [ { "indexNum":0, "status": "menstrual period", "value": 2,3, "" lineType ": solid" }, { "indexNum":2, "status": "safety period", "value": [14,18], "lineType": "solid" }, { "indexNum":4, "status": "ovulation period", "value": [29,36], "lineType": "solid" }.
Illustratively, an example of an empty list template 506 may be represented as: ["-","-","-","-","-","-"]. It will be appreciated that where there is only one data list 503, the empty list template 506 is the same length as the data list 503, and where there are only a plurality of data lists 503, the empty list template 506 is the same as the sum of the lengths of each of the plurality of data lists 503.
Illustratively, the segmentation color configuration information 507 may be expressed as: { color: 'rgba (255,191,41,1)', topColor: 'rgba (255,191,41,0.2)', bottomColor: 'rgba (255,191,41,0)' }, safety phase: { color: "rgba (183,151,248,1)", topColor: "rgba (183,151,248,0.2)", bottomColor: "rgba (183,151,248,0)" }, menstrual period: "rgba (255,117,149,1)", topColor: "rgba (255,101,136,0.15)", bottomColor: "rgba (255,101,136,0)" }.
Therefore, the broken line graph can be drawn in a segmented mode according to the type value in the given data list, each segment of sub-broken line graph has different configuration information, the generated segmented broken line graph is richer, and diversified customization requirements are met.
The method according to the exemplary embodiment of the present disclosure is explained above. Although the operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, nor that all illustrated operations be performed, to achieve desirable results.
Fig. 6 shows a block diagram of an apparatus 600 for generating a multi-segment line graph according to an embodiment of the present disclosure. As shown in fig. 6, the apparatus 600 includes an acquisition unit 601, a first generation unit 602, a second generation unit 603, and a third generation unit 604.
The acquisition unit 601 is configured to acquire a data list for generating a segment line graph. The data list includes a plurality of data items, each of which may include an abscissa value, an ordinate value, and a type value of the data item. Each data item corresponds to a node of the segmented line graph to be generated, and the type value is used for representing the node type of the corresponding node in the segmented line graph.
The first generating unit 602 is configured to obtain one or more sub data lists from the data list according to different type values, where each sub data list corresponds to a node type.
The second generation unit 603 is configured to acquire, for each sub data list, configuration information of the sub data list, and generate a sub line graph corresponding to the sub data list based on the configuration information.
The third generating unit 604 is configured to generate a segment line graph based on the sub line graph corresponding to each sub data list.
In some examples, the operations of the obtaining unit 601, the first generating unit 602, the second generating unit 603, and the third generating unit 604 respectively correspond to the steps 201 and 204 of the method 200 described above with respect to fig. 2, and thus are not described in detail herein.
Although specific functionality is discussed above with reference to particular modules, it should be noted that the functionality of the various modules discussed herein may be divided into multiple modules and/or at least some of the functionality of multiple modules may be combined into a single module. Performing an action by a particular module discussed herein includes the particular module itself performing the action, or alternatively the particular module invoking or otherwise accessing another component or module that performs the action (or performs the action in conjunction with the particular module). Thus, a particular module that performs an action can include the particular module that performs the action itself and/or another module that the particular module invokes or otherwise accesses that performs the action.
An exemplary embodiment of the present disclosure also provides an electronic device including: at least one processor and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
Exemplary embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a computer program. The computer program, when executed by a processor of a computer, is operative to cause the computer to perform a method according to an embodiment of the disclosure.
Exemplary embodiments of the present disclosure also provide a computer program product, comprising a computer program. The computer program, when executed by a processor of a computer, is operative to cause the computer to perform a method according to an embodiment of the disclosure.
Referring to fig. 7, a block diagram of a structure of an electronic device 700, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the device 700, and the input unit 706 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote controller. Output unit 707 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 708 may include, but is not limited to, magnetic or optical disks. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 1302.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 701 performs the various methods and processes described above, such as the methods 200 and/or 500. For example, in some embodiments, methods 200 and/or 500 may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of methods 200 and/or 500 described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by way of firmware) to perform the methods 200 and/or 500.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (13)

1. A method of generating a segmented line graph, comprising:
obtaining a data list for generating a segment line graph, wherein the data list comprises a plurality of data items, each data item comprises a type value, and each data item corresponds to a node of the segment line graph to be generated, and the type value is used for representing the node type of the corresponding node in the segment line graph;
acquiring one or more subdata lists from the data list according to different type values, wherein each subdata list corresponds to a node type;
acquiring configuration information of each subdata list, and generating a sub-line graph corresponding to the subdata list based on the configuration information; and
and generating the segmentation line graph based on the sub line graph corresponding to each sub data list.
2. The method of claim 1, wherein each child data list further comprises: the starting serial number of the node type corresponding to the sub data list, the name of the node type, the content of the interval in the preset interval and the broken line type of the sub broken line graph corresponding to the sub data list,
the preset interval is formed based on the starting serial number of the node type corresponding to the sub data list and the starting serial number of the node type corresponding to the next adjacent sub data list, and the interval content comprises an abscissa value and an ordinate value of a data item in the data list.
3. The method of claim 1 or 2, wherein the configuration information of each sub data list includes attribute information of a sub line graph corresponding to the sub data list, and wherein,
the attribute information includes: one or more of color information of a node of the sub-line drawing, top color information of a region corresponding to the sub-line drawing, and bottom color information of a region corresponding to the sub-line drawing.
4. The method of claim 3, wherein generating a sub-line graph corresponding to a sub-data list based on the configuration information comprises:
generating the sub-line graph based on one or more of the color information of the node, the top color information, and the bottom color information.
5. The method of claim 1 or 2, wherein the node type comprises a node color.
6. An apparatus to generate a segmented line graph, comprising:
an obtaining unit configured to obtain a data list for generating a segment line graph, wherein the data list includes a plurality of data items, each data item includes a type value, and each data item corresponds to a node of the segment line graph to be generated, and the type value is used for representing a node type of the corresponding node in the segment line graph;
the first generation unit is configured to obtain one or more sub data lists from the data list according to different type values, wherein each sub data list corresponds to one node type;
the second generation unit is configured to acquire configuration information of each sub data list and generate a sub line graph corresponding to the sub data list based on the configuration information; and
a third generating unit configured to generate the segment line graph based on a sub line graph corresponding to each sub data list.
7. The apparatus of claim 6, wherein each sub data list further comprises: the starting serial number of the node type corresponding to the sub data list, the name of the node type, the content of the interval in the preset interval and the broken line type of the sub broken line graph corresponding to the sub data list,
the preset interval is formed based on the starting serial number of the node type corresponding to the sub data list and the starting serial number of the node type corresponding to the next adjacent sub data list, and the interval content comprises an abscissa value and an ordinate value of a data item in the data list.
8. The apparatus of claim 6 or 7, wherein the configuration information of each sub data list includes attribute information of a sub line graph corresponding to the sub data list, and wherein,
the attribute information includes: one or more of color information of a node of the sub-line drawing, top color information of a region corresponding to the sub-line drawing, and bottom color information of a region corresponding to the sub-line drawing.
9. The apparatus of claim 8, wherein the second generating unit is further configured to:
generating the sub-line graph based on one or more of the color information of the node, the top color information, and the bottom color information.
10. The apparatus of claim 6 or 7, wherein the node type comprises a node color.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform the method of any of claims 1-5.
12. A non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is operable to cause the computer to perform the method of any of claims 1-5.
13. A computer program product comprising a computer program, wherein the computer program is operative, when executed by a processor of a computer, to cause the computer to perform the method according to any of claims 1-5.
CN202110272493.4A 2021-03-12 2021-03-12 Method, device, electronic equipment and readable medium for generating multi-section line graph Active CN113012258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110272493.4A CN113012258B (en) 2021-03-12 2021-03-12 Method, device, electronic equipment and readable medium for generating multi-section line graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110272493.4A CN113012258B (en) 2021-03-12 2021-03-12 Method, device, electronic equipment and readable medium for generating multi-section line graph

Publications (2)

Publication Number Publication Date
CN113012258A true CN113012258A (en) 2021-06-22
CN113012258B CN113012258B (en) 2023-07-28

Family

ID=76406553

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110272493.4A Active CN113012258B (en) 2021-03-12 2021-03-12 Method, device, electronic equipment and readable medium for generating multi-section line graph

Country Status (1)

Country Link
CN (1) CN113012258B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143480A (en) * 2021-12-10 2022-03-04 北京百度网讯科技有限公司 Chart video generation method, device, equipment, storage medium and program

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150325015A1 (en) * 2014-05-06 2015-11-12 Mitsubishi Electric Research Laboratories, Inc. Method for Generating Representations Polylines Using Piecewise Fitted Geometric Primitives
US20150332487A1 (en) * 2014-05-19 2015-11-19 Google Inc. Encoding polygon data for fast retrieval and rendering
US20170076492A1 (en) * 2014-04-01 2017-03-16 Landmark Graphics Corporation Multi-z polyline to single-z horizons conversion
CN110569774A (en) * 2019-08-30 2019-12-13 武汉大学 Automatic line graph image digitalization method based on image processing and pattern recognition
CN110675471A (en) * 2019-10-15 2020-01-10 深圳前海微众银行股份有限公司 Method, device and equipment for generating node connecting line and storage medium
CN111815740A (en) * 2020-07-27 2020-10-23 城云科技(中国)有限公司 Map drawing method, system, terminal and storage medium
CN111831707A (en) * 2020-07-14 2020-10-27 昆明理工大学 Time sequence motif discovering and expressing method based on piecewise linear representation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170076492A1 (en) * 2014-04-01 2017-03-16 Landmark Graphics Corporation Multi-z polyline to single-z horizons conversion
US20150325015A1 (en) * 2014-05-06 2015-11-12 Mitsubishi Electric Research Laboratories, Inc. Method for Generating Representations Polylines Using Piecewise Fitted Geometric Primitives
US20150332487A1 (en) * 2014-05-19 2015-11-19 Google Inc. Encoding polygon data for fast retrieval and rendering
CN110569774A (en) * 2019-08-30 2019-12-13 武汉大学 Automatic line graph image digitalization method based on image processing and pattern recognition
CN110675471A (en) * 2019-10-15 2020-01-10 深圳前海微众银行股份有限公司 Method, device and equipment for generating node connecting line and storage medium
CN111831707A (en) * 2020-07-14 2020-10-27 昆明理工大学 Time sequence motif discovering and expressing method based on piecewise linear representation
CN111815740A (en) * 2020-07-27 2020-10-23 城云科技(中国)有限公司 Map drawing method, system, terminal and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
宋美娜;崔丹阳;鄂海红;欧中洪;: "一种通用的数据可视化模型设计与实现", 计算机应用与软件, no. 09 *
牛泽杰;李启南;李强军;: "基于矩形树图和折线图的网络流量分析", 兰州交通大学学报, no. 06 *
谭桂龙;陈谊;: "基于平行坐标的信息可视化方法的应用研究", 北京工商大学学报(自然科学版), no. 02 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143480A (en) * 2021-12-10 2022-03-04 北京百度网讯科技有限公司 Chart video generation method, device, equipment, storage medium and program

Also Published As

Publication number Publication date
CN113012258B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN112532748B (en) Message pushing method, device, equipment, medium and computer program product
CN115631251B (en) Method, device, electronic equipment and medium for generating image based on text
CN113485820A (en) Task scheduling system and implementation method, device and medium thereof
CN116306396A (en) Chip verification method and device, equipment and medium
CN113012258B (en) Method, device, electronic equipment and readable medium for generating multi-section line graph
CN113326403A (en) Flowchart rendering method and device, electronic equipment and medium
CN112328225A (en) Page operation method and operation system thereof
CN114510308B (en) Method, device, equipment and medium for storing application page by mobile terminal
CN113641929B (en) Page rendering method, device, electronic equipment and computer readable storage medium
CN114676062B (en) Differential data testing method and device for interface, electronic equipment and medium
CN115756696A (en) Information processing method, device, equipment and medium
CN113126928B (en) File moving method and device, electronic equipment and medium
CN114359017A (en) Multimedia resource processing method and device and electronic equipment
CN113312050B (en) Content display method, device, equipment and medium
CN112764828B (en) Business logic management method and device, computer equipment and medium
CN113836021B (en) Test method, test device, electronic equipment and medium
CN114842474B (en) Character recognition method, device, electronic equipment and medium
CN113568797B (en) Testing method and device of intelligent interaction system, electronic equipment and medium
CN112667196B (en) Information display method and device, electronic equipment and medium
CN115334159B (en) Method, apparatus, device and medium for processing stream data
CN113961189A (en) Webpage editing method and device
CN116016373A (en) Method, device, equipment and medium for sending data processing request
CN118821676A (en) Chip verification method and device, equipment and medium
CN118819846A (en) Data processing method and device, equipment and medium applied to distributed system
CN118821675A (en) Chip verification method and device, equipment and medium

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