Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
Referring to fig. 1, the present disclosure provides a method for adjusting a dimension tag, which may be specifically executed by an electronic device, where the electronic device may be a terminal device, and the terminal device may be a desktop device or a mobile terminal, where the method includes:
step S101: determining the number M of labels in any dimension of data to be displayed, a preset first distance between the labels and the corresponding displayable length of the dimension on a display interface, wherein M is an integer greater than 0;
in the embodiment of the present disclosure, data to be displayed may be displayed from at least one dimension, and for any dimension, the labels and the distance between the labels may be adjusted by the adjustment method for dimension labels shown in the embodiment of the present disclosure, so as to implement displaying a greater number of labels for the dimension.
The terminal equipment determines that the number of the labels in any dimension is M, a preset first distance between the labels and a corresponding displayable length of the labels in the dimension when being displayed on a display interface of the terminal equipment, the displayable length is fixed, M is an integer greater than 0, and it is understood that the distance between any two labels in the dimension is the same, and the first distance is the distance between any two labels when the labels are displayed in an initial font size and initial label display mode.
Step S102, determining a first length required for displaying M labels based on the number M of the labels and the first distance;
the terminal device may determine, based on the number of tags M and the first distance, a first length required if M tags of the dimension are presented at the first distance on the presentation interface.
Step 103, if the first length is greater than the displayable length, adjusting the labels and/or the distances between the labels based on a preset label display mode, and displaying data through the adjusted labels and/or the distances between the labels, wherein the adjusted distances between the labels are smaller than the first distance.
If the first length is greater than the displayable length, the fact that the displayable length cannot display M labels is indicated, the terminal equipment adjusts the labels and/or the distance between the labels based on a preset label display mode, the distance between the labels after adjustment is smaller than the first distance, the display distance between the labels is reduced, the labels after adjustment are displayed in the dimension, the labels are in one-to-one correspondence with data to be displayed, and data display can be conducted on the data to be displayed based on the labels after adjustment and/or the distance between the labels, so that more labels can be displayed in the dimension, and further more data to be displayed can be displayed.
If the first length is smaller than or equal to the displayable length, discarding part of the labels and then displaying the labels in an initial font size and initial label display mode.
In this embodiment, the number M of the labels in any dimension of the data to be displayed, the first distance between the labels, and the corresponding displayable length of the dimension on the display interface are determined, after the first length required for displaying the M labels is determined based on the number M of the labels and the first distance between the labels, if the first length is greater than the displayable length, the distance between the labels and/or the distance between the labels is adjusted based on a preset label display adjustment mode, and the adjusted distance between the labels is smaller than the first distance, so that the display distance required for displaying the labels can be reduced, the purpose of displaying a larger number of labels in one dimension is achieved, the data to be displayed can be displayed in a larger number, the fineness of the displayed data is improved, the visual information of the data is more complete, and the method can be applied to the visual scene of large-scale data.
Optionally, the preset label display mode includes at least one of the following:
The labels are arranged in N rows, displayed at a preset angle, and displayed in a mode of reducing the font size to a specific font size, wherein N is an integer greater than 1.
In this embodiment, the preset label display manner may be a manner of arranging each label in N rows, for example, for the labels in the X dimension, each label is initially arranged in one row, and the present disclosure may be adjusted to arrange each label in N rows, where N is an integer greater than 1, that is, the distance between the labels is adjusted, and obviously, the distance between the labels after adjustment is reduced.
The preset label display mode may also be a mode of displaying labels at a preset angle, for example, for an X-dimension label, the distance between the labels is the largest when the labels are displayed in an initial lateral direction (180 degrees), the distance between the labels are displayed in an initial lateral direction (180 degrees) is the first distance, the preset angle is preferably 45 degrees, 90 degrees, 135 degrees, and the like, and the distance between the labels is reduced by the preset angle display mode. In this embodiment, when the labels are displayed at a preset angle, the labels and the distance between the labels may be adjusted (for example, the labels are displayed from 180 degrees to 45 degrees), or only the labels may be adjusted without adjusting the distance between the labels (for example, the labels are displayed from 45 degrees to 135 degrees).
The preset label display mode can also be a mode of displaying labels by reducing the font size to a specific font size, and the distance between the labels is necessarily reduced after the font size of the labels is reduced, so that the labels and the distance between the labels are adjusted under the condition.
Any dimension of the embodiment is exemplified by an X dimension, and it can be actually understood that, for a Y dimension, a label adjustment method can be referred to for a Y dimension, and the principle is the same, only for the Y dimension label, the distance between the labels is reduced by arranging the labels in multiple columns, and at the same time, for the Y dimension label, the distance between the labels is the largest when the labels are displayed at 90 degrees, and the distance between the labels is the smallest when the labels are displayed at 180 degrees.
Aiming at the preset label display mode, the algorithm rule is arranged in the terminal equipment, the labels can be adjusted in a mode of arranging the labels in N rows, and if M labels cannot be displayed in the mode, the labels are adjusted in a mode of displaying the labels at a preset angle, and the method is specific to the following:
optionally, if the preset label display mode includes a mode of arranging labels in N rows;
Before the labels and/or the distances between the labels are adjusted based on the preset label display mode, the method further comprises the following steps:
determining a second distance between the labels when the labels are distributed through N rows, wherein the second distance is smaller than the first distance;
determining a second length required to display the M labels based on the number M of labels and the second distance;
the method for adjusting the labels and/or the distance between the labels based on a preset label display mode comprises the following steps:
if the second length is smaller than or equal to the displayable length, the labels and/or the distance between the labels are adjusted in a mode of arranging the labels in N rows.
Optionally, if the preset label display mode includes a mode of displaying the label at a preset angle;
the method for adjusting the labels and/or the distance between the labels based on a preset label display adjustment mode comprises the following steps:
if the second length is greater than the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
In this embodiment, as shown in fig. 2, the length required for displaying the M labels according to the initial font size and the initial label displaying manner is a first length, if the first length is greater than the displayable length, the initial font size is kept unchanged, the terminal device determines a second distance between the labels when each label is arranged through N rows, and the second distance is smaller than the first distance, so that the terminal device can determine, based on the number M of labels and the second distance, the second length required for displaying the M labels in the dimension on the display interface.
If the second length is smaller than or equal to the displayable length, the initial font size of the labels is kept unchanged, the labels and/or the distance between the labels is adjusted in a mode of arranging the labels in N rows, so that the adjusted labels are displayed, and the data to be displayed are displayed based on the labels and the distance between the labels.
If the second length is greater than the displayable length, the mode of representing that the N rows of arranged labels adjust the labels or can not display all M labels, the terminal equipment keeps the initial font size unchanged, the distance between the labels and/or the distance between the labels is adjusted in a mode of displaying each label at a preset angle, the distance between the labels is smaller than the second distance when each label is displayed at the preset angle, and the distance between the labels is reduced correspondingly, so that more labels can be displayed in the dimension.
In this embodiment, if the display angle of each label is adjusted as described above, each label may be displayed at a preset angle, and on this basis, if all M labels cannot be displayed yet, the initial font size of each label may be adjusted, which is specific:
optionally, before adjusting the labels and/or the distance between the labels by displaying each label at a preset angle, the method further includes:
If the second length is larger than the displayable length, determining a third distance between the labels when each label is displayed at a preset angle, wherein the third distance is smaller than or equal to the second distance;
determining a third length required to display the M labels based on the number M of labels and the third distance;
the distance between the labels and/or the labels is adjusted by displaying the labels at a preset angle, comprising:
if the third length is less than or equal to the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the distance between the labels and/or the labels is adjusted by displaying the labels at a preset angle, comprising:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
The labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, determining the specific font size includes:
determining a specific font size based on a preset font size reduction rule;
wherein the particular font size is greater than the font size threshold.
Referring to fig. 2, the terminal device may determine a third distance between the labels when they are displayed at the initial font size and the preset angle, the third distance being generally smaller than the second distance, the second distance being equal to the third distance if the labels just occupy N rows when they are displayed at the preset angle, e.g. for label "123", displaying 1 number per row when displayed at 3 rows, and the second distance being the same as the third distance if the labels are adjusted to 90 degrees for display, i.e. adjusted from landscape to portrait, displaying 1 number per row when the labels are displayed at 3 rows. After the terminal equipment obtains the third distance, determining a third length required for displaying the M labels according to the third distance, if the third length is smaller than or equal to the displayable length, keeping the initial font size unchanged by the terminal equipment, adjusting the labels and/or the distance between the labels in a mode of displaying the labels at a preset angle, displaying the adjusted labels, and displaying data to be displayed based on the adjusted labels and the distance between the labels.
If the third length is greater than the displayable length, indicating that the M labels cannot be displayed completely when each label is displayed at a preset angle, further, the terminal equipment can reduce the initial font size of each label to a specific font size, the terminal equipment firstly determines the specific font size and determines a fourth distance between the labels when each label is displayed at the preset angle and the specific font size, so that the fourth length required for displaying the M labels at the fourth distance is determined, and if the fourth length is less than or equal to the displayable length, the distance between each label and the label is adjusted at the preset angle and the specific font size, so that each label after adjustment is displayed, and the data to be displayed is displayed based on the label after adjustment and the distance between the labels; and if the fourth length is greater than the displayable length, circularly executing the step of determining the specific font size so as to determine the fourth length until the determined fourth length is less than or equal to the displayable length.
In this embodiment, the initial font size may be reduced to a specific font size according to a preset font size reduction rule, specifically, the font size of the font may be reduced by 1 each time, the reduced font size is not an infinitely reduced process, it is ensured that the specific font size is greater than a font size threshold, if the specific font size is less than or equal to the font size threshold, the rest of the labels are displayed with an acceptable minimum font size and a preset angle after the partial labels in the M labels are directly deleted.
The disclosure can be applied to the display of data to be displayed in a chart, wherein the chart generally comprises two dimensions of X and Y, the data to be displayed in the chart is displayed based on dimension labels, and in summary, referring to fig. 2, the scheme of the disclosure can be summarized as the following steps:
s1: calculating the exposable length of any dimension;
s2: determining a first length required by the M labels when the M labels are displayed according to the initial font size and the initial label display mode;
s3: judging whether the first length is larger than the displayable length;
s4: if the first length is smaller than or equal to the displayable length, displaying each label in an initial font size and initial label display mode, and ending the algorithm;
FIG. 3 (a) is a diagram showing the effect of each label in the initial font size and initial label display mode;
s5: if the first length is larger than the displayable length, the font size is unchanged, and a second length required by each label when displayed in N rows is determined;
s6: judging whether the second length is larger than the displayable length;
s7: if the second length is smaller than or equal to the displayable length, displaying each label in an N line of the initial font size, and ending the algorithm;
as shown in fig. 3 (b) to show the effect of each label in the original font size N line, it is apparent that the distance between labels is reduced with respect to fig. 3 (a), and a greater number of labels can be shown.
S8: if the second length is larger than the displayable length, the font size is unchanged, and a third length required when M labels are displayed at a preset angle is determined;
s9: judging whether the third length is larger than the displayable length;
s10: if the third length is larger than the displayable length, displaying each label according to the initial font size and the preset angle, and ending the algorithm;
as shown in fig. 3 (c) for the effect diagram when each label is displayed at the initial font size and the preset angle, it is apparent that a greater number of labels can be displayed by reducing the distance between labels with respect to fig. 3 (b).
S11: if the third length is smaller than or equal to the displayable length, determining a specific font size;
s12, determining a fourth length required when M labels are displayed in a specific font size and a preset angle;
s13: judging whether the fourth length is larger than the displayable length;
s14, if the fourth length is larger than the displayable length, returning to S11;
and returning to the step S11 and the subsequent steps until the fourth length is smaller than or equal to the displayable length, and ensuring that the specific font size is larger than the font size threshold, otherwise, discarding part of the labels in a traditional way, displaying at intervals, and ending the algorithm.
S15: if the fourth length is smaller than or equal to the displayable length, displaying each label with a specific font size and a preset angle, and ending the algorithm.
As shown in fig. 3 (d) for the effect diagram when each label is displayed in a specific font size and a preset angle, it is apparent that a greater number of labels can be displayed by reducing the distance between labels with respect to fig. 3 (c).
Fig. 4 is a schematic structural diagram of an adjustment device for dimension labels according to an embodiment of the present disclosure, as shown in fig. 4, an apparatus according to an embodiment of the present disclosure may include:
a first determining module 401, configured to determine the number M of tags in any dimension of data to be displayed, a preset first distance between the tags, and a corresponding displayable length of the dimension on a display interface, where M is an integer greater than 0;
a second determining module 402, configured to determine a first length required for displaying M labels based on the number M of labels and the first distance;
the adjustment module 403 is configured to adjust the labels and/or the distances between the labels based on a preset label display mode if the first length is greater than the displayable length, and perform data display by the adjusted labels and/or the distances between the labels, where the adjusted distances between the labels are smaller than the first distance.
Optionally, the preset label display mode includes at least one of the following:
the labels are arranged in N rows, displayed at a preset angle, and displayed in a mode of reducing the font size to a specific font size, wherein N is an integer greater than 1.
Optionally, if the preset label display mode includes a mode of arranging labels in N rows;
the device further comprises a third determining module and a fourth determining module, wherein before the adjusting module 403 adjusts the labels and/or the distance between the labels based on a preset label display mode, the third determining module is used for determining a second distance between the labels when the labels are arranged in N rows, and the second distance is smaller than the first distance;
a fourth determining module, configured to determine a second length required for displaying M labels based on the number M of labels and the second distance;
the adjustment module 403 is specifically configured to, when adjusting the labels and/or the distance between the labels based on a preset label display mode:
if the second length is smaller than or equal to the displayable length, the labels and/or the distance between the labels are adjusted in a mode of arranging the labels in N rows.
Optionally, if the preset label display mode includes a mode of displaying the label at a preset angle;
the adjustment module 403 is specifically configured to, when adjusting the labels and/or the distance between the labels based on a preset label display adjustment manner:
if the second length is greater than the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, the device further includes a fifth determining module and a sixth determining module, where before the adjusting module 403 adjusts the labels and/or the distance between the labels by displaying each label at a preset angle, the fifth determining module is configured to determine a third distance between the labels when each label is displayed at the preset angle if the second length is greater than the displayable length, and the third distance is less than or equal to the second distance;
a sixth determining module, configured to determine a third length required for displaying M labels based on the number M of labels and the third distance;
the adjustment module 403 is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is less than or equal to the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the adjustment module 403 is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
The labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the adjustment module 403 is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
the labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, the adjustment module 403 is specifically configured to, when determining the specific font size:
determining a specific font size based on a preset font size reduction rule;
wherein the particular font size is greater than the font size threshold.
Referring now to fig. 5, a schematic diagram of an electronic device (e.g., the terminal device of fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 601 hereinafter, the memory may include at least one of a Read Only Memory (ROM) 602, a Random Access Memory (RAM) 603, and a storage device 608 hereinafter, as shown in detail below:
as shown in fig. 5, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperTextTransfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining the number M of labels in any dimension of data to be displayed, a preset first distance between the labels and the corresponding displayable length of the dimension on a display interface, wherein M is an integer greater than 0; determining a first length required to display the M labels based on the number M of labels and the first distance; if the first length is greater than the displayable length, adjusting the labels and/or the distance between the labels based on a preset label display mode, and displaying data through the adjusted labels and/or the distance between the labels, wherein the distance between the labels after adjustment is smaller than the first distance.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the module or the unit does not in some case limit the unit itself, for example, the first determining module may also be described as "a module for determining the number M of tags in any dimension of the data to be displayed, a preset first distance between the tags, and a corresponding displayable length of the dimension on the display interface".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
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. The 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.
According to one or more embodiments of the present disclosure, there is provided a method for adjusting a dimension tag, including:
determining the number M of labels in any dimension of data to be displayed, a preset first distance between the labels and the corresponding displayable length of the dimension on a display interface, wherein M is an integer greater than 0;
determining a first length required to display the M labels based on the number M of labels and the first distance;
if the first length is greater than the displayable length, adjusting the labels and/or the distance between the labels based on a preset label display mode, and displaying data through the adjusted labels and/or the distance between the labels, wherein the distance between the labels after adjustment is smaller than the first distance.
Optionally, the preset label display mode includes at least one of the following:
the labels are arranged in N rows, displayed at a preset angle, and displayed in a mode of reducing the font size to a specific font size, wherein N is an integer greater than 1.
Optionally, if the preset label display mode includes a mode of arranging labels in N rows;
before the labels and/or the distances between the labels are adjusted based on the preset label display mode, the method further comprises the following steps:
Determining a second distance between the labels when the labels are distributed through N rows, wherein the second distance is smaller than the first distance;
determining a second length required to display the M labels based on the number M of labels and the second distance;
the method for adjusting the labels and/or the distance between the labels based on a preset label display mode comprises the following steps:
if the second length is smaller than or equal to the displayable length, the labels and/or the distance between the labels are adjusted in a mode of arranging the labels in N rows.
Optionally, if the preset label display mode includes a mode of displaying the label at a preset angle;
the method for adjusting the labels and/or the distance between the labels based on a preset label display adjustment mode comprises the following steps:
if the second length is greater than the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, before adjusting the labels and/or the distance between the labels by displaying each label at a preset angle, the method further includes:
if the second length is larger than the displayable length, determining a third distance between the labels when each label is displayed at a preset angle, wherein the third distance is smaller than or equal to the second distance;
Determining a third length required to display the M labels based on the number M of labels and the third distance;
the distance between the labels and/or the labels is adjusted by displaying the labels at a preset angle, comprising:
if the third length is less than or equal to the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the distance between the labels and/or the labels is adjusted by displaying the labels at a preset angle, comprising:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
the labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, determining the specific font size includes:
determining a specific font size based on a preset font size reduction rule;
wherein the particular font size is greater than the font size threshold.
There is also provided, in accordance with one or more embodiments of the present disclosure, an adjustment device for a dimension tag, the device including:
the first determining module is used for determining the number M of labels in any dimension of data to be displayed, a preset first distance between the labels and the corresponding displayable length of the dimension on the display interface, wherein M is an integer greater than 0;
the second determining module is used for determining a first length required for displaying M labels based on the number M of the labels and the first distance;
and the adjusting module is used for adjusting the labels and/or the distances among the labels based on a preset label display mode if the first length is larger than the displayable length, and displaying data through the adjusted labels and/or the distances among the labels, wherein the adjusted distances among the labels are smaller than the first distance.
Optionally, the preset label display mode includes at least one of the following:
the labels are arranged in N rows, displayed at a preset angle, and displayed in a mode of reducing the font size to a specific font size, wherein N is an integer greater than 1.
Optionally, if the preset label display mode includes a mode of arranging labels in N rows;
the device also comprises a third determining module and a fourth determining module, wherein before the adjusting module adjusts the labels and/or the distance between the labels based on a preset label display mode, the third determining module is used for determining a second distance between the labels when the labels are distributed through N rows, and the second distance is smaller than the first distance;
a fourth determining module, configured to determine a second length required for displaying M labels based on the number M of labels and the second distance;
the adjustment module is specifically configured to, when adjusting the labels and/or the distance between the labels based on a preset label display mode:
if the second length is smaller than or equal to the displayable length, the labels and/or the distance between the labels are adjusted in a mode of arranging the labels in N rows.
Optionally, if the preset label display mode includes a mode of displaying the label at a preset angle;
the adjustment module is specifically configured to, when adjusting the labels and/or the distance between the labels based on a preset label display adjustment mode:
if the second length is greater than the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, the device further includes a fifth determining module and a sixth determining module, where before the adjusting module adjusts the labels and/or the distance between the labels by displaying each label at a preset angle, the fifth determining module is configured to determine a third distance between the labels when each label is displayed at the preset angle if the second length is greater than the displayable length, and the third distance is less than or equal to the second distance;
a sixth determining module, configured to determine a third length required for displaying M labels based on the number M of labels and the third distance;
the adjustment module is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is less than or equal to the displayable length, the labels and/or the distance between the labels are adjusted by displaying each label at a preset angle.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the adjustment module is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
The labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, if the preset label display mode includes a mode of displaying the label in a mode of reducing the font size to a specific font size;
the adjustment module is specifically configured to, when adjusting the labels and/or the distance between the labels by displaying each label at a preset angle:
if the third length is greater than the displayable length, executing the steps of determining the specific font size, determining a fourth distance between the labels when displaying each label in a preset angle and the specific font size, and determining a fourth length required for displaying the M labels based on the number M of the labels and the fourth distance until the fourth length obtained by determining is smaller than or equal to the displayable length, wherein the fourth distance is smaller than the third distance;
the labels and/or the distance between the labels are adjusted by displaying the labels at a preset angle and a specific font size.
Optionally, the adjusting module is specifically configured to, when determining the specific font size:
determining a specific font size based on a preset font size reduction rule;
wherein the particular font size is greater than the font size threshold.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted 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. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.