Skip to content

Commit 6439ed0

Browse files
authored
Merge pull request #19 from Thisal-D/v2.1.8-patch-for-v2.1.7
v2.1.8-patch-for-v2.1.7
2 parents 7d8443e + 3f60d49 commit 6439ed0

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[![Chinese](https://img.shields.io/badge/Language-中文-red)](README_zh.md)
22

3-
43
<div align="center">
54

65
[![ctkchart](https://snyk.io/advisor/python/ctkchart/badge.svg)](https://snyk.io/advisor/python/ctkchart)

documentation/DOCUMENTATION_en.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,12 @@ linechart = ctkchart.CTkLineChart()
124124
| get_line_area | Get the are of specific line | line: `ctkchart.CTkLine` | ``float`` |
125125
| get_lines_area | Get the are of all lines | - | ``float`` |
126126
| destroy | Destroy the chart | - | ``None`` |
127-
| 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]]` |
128-
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]` |
129-
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
130-
| 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]]` |
131-
| get_line_visible_data | Retrieves currently visible data points for a specific line. | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |
132-
133-
134-
135-
127+
| 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`` |
128+
| 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]]` |
129+
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]` |
130+
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
131+
| 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]]` |
132+
| get_line_visible_data | Retrieves currently visible data points for a specific line. | line: `ctkchart.CTkLine` | `Tuple[int \| float]` |
136133

137134
</div>
138135

@@ -157,7 +154,7 @@ line = ctkchart.CTkLine()
157154
| [size](#line_color_size) | Optional | Size of the line | ``int`` | 1<= |
158155
| [style](#line_style) | Optional | Style of the line | ``str`` ("normal", "dashed", "dotted") | "normal" |
159156
| [style_type](#line_style_type) | Optional | Style type for the line | ``tuple[int, int]`` | (10, 5),... |
160-
| [point_highlight](#point_highlight) m | Optional | State of point highlighting | ``str`` ("enabled", "disabled") | "disabled" |
157+
| [point_highlight](#point_highlight) | Optional | State of point highlighting | ``str`` ("enabled", "disabled") | "disabled" |
161158
| [point_highlight_size](#point_highlight) | Optional | Size of the highlighted point | ``int`` | 1<= |
162159
| [point_highlight_color](#point_highlight) | Optional | Color of the highlighted point | ``tuple[str, str]`` \| ``str`` | "#768df1" |
163160
| [fill](#fill) | Optional | State of filling | ``str`` ("enabled", "disabled") | "disabled" |
@@ -175,10 +172,12 @@ line = ctkchart.CTkLine()
175172
| reset | reset line object | - | ``None`` |
176173
| set_visible | change the visibility of the line | state: ``bool`` | ``None`` |
177174
| get_visibility | get the visibility of the line | - | ``bool`` |
175+
| 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`` |
178176
| destroy | Destroy the line | - | ``None`` |
179-
| 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]` |
180-
| 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]` |
181-
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
177+
| 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]` |
178+
| 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]` |
179+
| get_x_axis_visible_point_count | Retrieves the maximum number of data points that can be visible along the X-axis. | - | `int` |
180+
182181
</div>
183182

184183
---

documentation/DOCUMENTATION_zh.md

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

134135
<div id="create-line">
@@ -169,11 +170,11 @@ line = ctkchart.CTkLine()
169170
| reset | 重置线对象 | - | ``None`` |
170171
| set_visible | 改变线条的可见度 | state: ``bool`` | ``None`` |
171172
| get_visibility | 获得线路的可见度 | - | ``bool`` |
172-
| 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`` |
173+
| clear_data | 清除特定线的数据,确保只保留最新的可见数据点。如果线的数据超过最大可见点,则会修剪旧数据。此方法允许每条线独立清除其数据,确保它始终保持在可见范围内。 | - | ``None`` |
173174
| destroy | 破坏线 | - | ``None`` |
174-
| get_data | 获取指定范围的数据点,可以选择步长值。如果没有提供参数,将返回所有可用数据。 | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
175-
| get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
176-
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
175+
| get_data | 获取指定范围的数据点,可以选择步长值。如果没有提供参数,将返回所有可用数据。 | start: `int` <br> end: `int` <br> step: `int` | `Tuple[int \| float]` |
176+
| get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
177+
| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
177178

178179
</div>
179180

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='ctkchart', # Replace with your package name
5-
version='2.1.7', # Replace with your package version
5+
version='2.1.8', # Replace with your package version
66
author='Thisal-D', # Replace with your name
77
author_email='khtdilmith@example.com', # Replace with your email
88
description='Line-chart Widget for customtkinter, Python library for creating live updating line charts in CustomTkinter.',

src/ctkchart/CTkLine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def configure(
151151
self.__master._CTkLineChart__apply_line_configuration()
152152

153153
def get_id(self) -> int:
154-
return self.__current_usable_id
154+
return self.__id
155155

156156
def __reset_positions(self) -> None:
157157
"""
@@ -329,6 +329,7 @@ def get_visibility(self) -> bool:
329329

330330
def __del__(self) -> None:
331331
"""Destructor method to delete instance attributes."""
332+
del self.__id
332333
del self.__master
333334
del self.__color
334335
del self.__size

src/ctkchart/CTkLineChart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ def get_lines_visible_data(self) -> Dict[CTkLine, Tuple[int | float]]:
18131813
if maximum_data > max_visible_points:
18141814
lines_data[line] = tuple(line._CTkLine__data[maximum_data - max_visible_points::])
18151815
else:
1816-
lines_data[line] = ()
1816+
lines_data[line] = tuple(line._CTkLine__data)
18171817
return lines_data
18181818

18191819
def get_line_visible_data(self, line: CTkLine) -> Tuple[int | float]:

src/ctkchart/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
ctkchart: a library for create live update chart for customtkinter guis.
1818
"""
1919
__title__ = "ctkchart"
20-
__version__ = "2.1.7"
20+
__version__ = "2.1.8"
2121
__authors__ = ("Thisal Dilmith", "childeyouyu (有语)")

0 commit comments

Comments
 (0)