Skip to content

Commit

Permalink
Merge pull request #19 from Thisal-D/v2.1.8-patch-for-v2.1.7
Browse files Browse the repository at this point in the history
v2.1.8-patch-for-v2.1.7
  • Loading branch information
Thisal-D authored Jan 17, 2025
2 parents 7d8443e + 3f60d49 commit 6439ed0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Chinese](https://img.shields.io/badge/Language-中文-red)](README_zh.md)


<div align="center">

[![ctkchart](https://snyk.io/advisor/python/ctkchart/badge.svg)](https://snyk.io/advisor/python/ctkchart)
Expand Down
25 changes: 12 additions & 13 deletions documentation/DOCUMENTATION_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,12 @@ linechart = ctkchart.CTkLineChart()
| get_line_area | Get the are of specific line | line: `ctkchart.CTkLine` | ``float`` |
| get_lines_area | Get the are of all lines | - | ``float`` |
| destroy | Destroy the chart | - | ``None`` |
| get_lines_data | Retrieves data points for all lines within a specified range with an optional step value. | start: `int` <br> end: `int` <br> step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
get_line_data | Retrieves data points for a specific line within a specified range and step. | line: `ctkchart.CTkLine` <br> start: `int` <br> end: `int`<br> step: `int` | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
| get_lines_visible_data | Retrieves currently visible data points for all lines based on the maximum data length and visible points. | - | `Dict[ctkchart.CTkLine, Tuple[int \| float]]` |
| get_line_visible_data | Retrieves currently visible data points for a specific line. | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |




| clear_data | Clears the data for all lines within the chart, ensuring that only the most recent visible data points are retained. If the total data points exceed the maximum visible points, the older data is removed from each line's data. This method ensures that the chart displays only the relevant portion of data based on the maximum visible range. | - | ``None`` |
| get_lines_data | Retrieves data points for all lines within a specified range with an optional step value. | start: `int` <br> end: `int` <br> step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
get_line_data | Retrieves data points for a specific line within a specified range and step. | line: `ctkchart.CTkLine` <br> start: `int` <br> end: `int`<br> step: `int` | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
| get_lines_visible_data | Retrieves currently visible data points for all lines based on the maximum data length and visible points. | - | `Dict[ctkchart.CTkLine, Tuple[int \| float]]` |
| get_line_visible_data | Retrieves currently visible data points for a specific line. | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |

</div>

Expand All @@ -157,7 +154,7 @@ line = ctkchart.CTkLine()
| [size](#line_color_size) | Optional | Size of the line | ``int`` | 1<= |
| [style](#line_style) | Optional | Style of the line | ``str`` ("normal", "dashed", "dotted") | "normal" |
| [style_type](#line_style_type) | Optional | Style type for the line | ``tuple[int, int]`` | (10, 5),... |
| [point_highlight](#point_highlight) m | Optional | State of point highlighting | ``str`` ("enabled", "disabled") | "disabled" |
| [point_highlight](#point_highlight) | Optional | State of point highlighting | ``str`` ("enabled", "disabled") | "disabled" |
| [point_highlight_size](#point_highlight) | Optional | Size of the highlighted point | ``int`` | 1<= |
| [point_highlight_color](#point_highlight) | Optional | Color of the highlighted point | ``tuple[str, str]`` \| ``str`` | "#768df1" |
| [fill](#fill) | Optional | State of filling | ``str`` ("enabled", "disabled") | "disabled" |
Expand All @@ -175,10 +172,12 @@ line = ctkchart.CTkLine()
| reset | reset line object | - | ``None`` |
| set_visible | change the visibility of the line | state: ``bool`` | ``None`` |
| get_visibility | get the visibility of the line | - | ``bool`` |
| clear_data | Clears the data for a specific line, ensuring that only the most recent visible data points are retained. If the line's data exceeds the maximum visible points, the older data is trimmed. This method allows each line to independently clean its data, ensuring it remains within the visible range. | - | ``None`` |
| destroy | Destroy the line | - | ``None`` |
| get_data | Retrieves data points from a specified range with an optional step value. If no parameters are given, it returns all available data. | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
| get_current_visible_data | Returns the currently visible data points based on the maximum data length across all lines and the maximum number of visible points. | - | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
| get_data | Retrieves data points from a specified range with an optional step value. If no parameters are given, it returns all available data. | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
| get_current_visible_data | Returns the currently visible data points based on the maximum data length across all lines and the maximum number of visible points. | - | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |

</div>

---
Expand Down
21 changes: 11 additions & 10 deletions documentation/DOCUMENTATION_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ linechart = ctkchart.CTkLineChart()
| grid_info | 获取网格信息 | attribute_name: ``str`` \| "\_\_all\_\_" | ``any`` |
| get_line_area | 获取特定线的面积 | line: `ctkchart.CTkLine` | `float` |
| get_lines_area | 获取所有线的面积 | - | `float` |
| clear_data | 清除图表中所有线的数据,确保只保留最新的可见数据点。如果数据点总数超过最大可见点,则会从每条线的数据中移除旧数据。此方法确保图表仅显示基于最大可见范围的相关数据部 | - | ``None`` |
| clear_data | 清除图表中所有线的数据,确保只保留最新的可见数据点。如果数据点总数超过最大可见点,则会从每条线的数据中移除旧数据。此方法确保图表仅显示基于最大可见范围的相关数据部分。 | - | ``None`` |
| destroy | 销毁图表 | - | ``None`` |
| get_lines_data | 获取指定范围内所有线条的数据点,可以选择步长值。 | start: `int` <br> end: `int` <br> step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
| get_line_data | 获取指定范围和步长值下某一条线的数据点。 | line: `ctkchart.CTkLine` <br> start: `int` <br> end: `int`<br> step: `int` | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
| get_lines_visible_data | 获取所有线条当前可见的数据点,基于最大数据长度和可见点数。 | - | `Dict[ctkchart.CTkLine, Tuple[int \| float]]` |
| get_line_visible_data | 获取某一条线当前可见的数据点。 | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |
| get_lines_data | 获取指定范围内所有线条的数据点,可以选择步长值。 | start: `int` <br> end: `int` <br> step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
| get_line_data | 获取指定范围和步长值下某一条线的数据点。 | line: `ctkchart.CTkLine` <br> start: `int` <br> end: `int`<br> step: `int` | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
| get_lines_visible_data | 获取所有线条当前可见的数据点,基于最大数据长度和可见点数。 | - | `Dict[ctkchart.CTkLine, Tuple[int \| float]]` |
| get_line_visible_data | 获取某一条线当前可见的数据点。 | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |

</div>

<div id="create-line">
Expand Down Expand Up @@ -169,11 +170,11 @@ line = ctkchart.CTkLine()
| reset | 重置线对象 | - | ``None`` |
| set_visible | 改变线条的可见度 | state: ``bool`` | ``None`` |
| get_visibility | 获得线路的可见度 | - | ``bool`` |
| clear_data | Clears the data for a specific line, ensuring that only the most recent visible data points are retained. If the line's data exceeds the maximum visible points, the older data is trimmed. This method allows each line to independently clean its data, ensuring it remains within the visible range. | - | ``None`` |
| clear_data | 清除特定线的数据,确保只保留最新的可见数据点。如果线的数据超过最大可见点,则会修剪旧数据。此方法允许每条线独立清除其数据,确保它始终保持在可见范围内。 | - | ``None`` |
| destroy | 破坏线 | - | ``None`` |
| get_data | 获取指定范围的数据点,可以选择步长值。如果没有提供参数,将返回所有可用数据。 | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
| get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
| get_data | 获取指定范围的数据点,可以选择步长值。如果没有提供参数,将返回所有可用数据。 | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
| get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |

</div>

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='ctkchart', # Replace with your package name
version='2.1.7', # Replace with your package version
version='2.1.8', # Replace with your package version
author='Thisal-D', # Replace with your name
author_email='khtdilmith@example.com', # Replace with your email
description='Line-chart Widget for customtkinter, Python library for creating live updating line charts in CustomTkinter.',
Expand Down
3 changes: 2 additions & 1 deletion src/ctkchart/CTkLine.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def configure(
self.__master._CTkLineChart__apply_line_configuration()

def get_id(self) -> int:
return self.__current_usable_id
return self.__id

def __reset_positions(self) -> None:
"""
Expand Down Expand Up @@ -329,6 +329,7 @@ def get_visibility(self) -> bool:

def __del__(self) -> None:
"""Destructor method to delete instance attributes."""
del self.__id
del self.__master
del self.__color
del self.__size
Expand Down
2 changes: 1 addition & 1 deletion src/ctkchart/CTkLineChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ def get_lines_visible_data(self) -> Dict[CTkLine, Tuple[int | float]]:
if maximum_data > max_visible_points:
lines_data[line] = tuple(line._CTkLine__data[maximum_data - max_visible_points::])
else:
lines_data[line] = ()
lines_data[line] = tuple(line._CTkLine__data)
return lines_data

def get_line_visible_data(self, line: CTkLine) -> Tuple[int | float]:
Expand Down
2 changes: 1 addition & 1 deletion src/ctkchart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
ctkchart: a library for create live update chart for customtkinter guis.
"""
__title__ = "ctkchart"
__version__ = "2.1.7"
__version__ = "2.1.8"
__authors__ = ("Thisal Dilmith", "childeyouyu (有语)")

0 comments on commit 6439ed0

Please sign in to comment.