diff --git a/README.md b/README.md
index 485446c..0c32572 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
[![Chinese](https://img.shields.io/badge/Language-中文-red)](README_zh.md)
-
[![ctkchart](https://snyk.io/advisor/python/ctkchart/badge.svg)](https://snyk.io/advisor/python/ctkchart)
diff --git a/documentation/DOCUMENTATION_en.md b/documentation/DOCUMENTATION_en.md
index ef15030..10d2c93 100644
--- a/documentation/DOCUMENTATION_en.md
+++ b/documentation/DOCUMENTATION_en.md
@@ -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`
end: `int`
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`
start: `int`
end: `int`
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`
end: `int`
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`
start: `int`
end: `int`
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]` |
@@ -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" |
@@ -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`
end: `int`
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`
end: `int`
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` |
+
---
diff --git a/documentation/DOCUMENTATION_zh.md b/documentation/DOCUMENTATION_zh.md
index a84c173..f82f092 100644
--- a/documentation/DOCUMENTATION_zh.md
+++ b/documentation/DOCUMENTATION_zh.md
@@ -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`
end: `int`
step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
- | get_line_data | 获取指定范围和步长值下某一条线的数据点。 | line: `ctkchart.CTkLine`
start: `int`
end: `int`
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`
end: `int`
step: `int` | `Dict[ctkchart.CTkLine, Tuple[int]]` |
+| get_line_data | 获取指定范围和步长值下某一条线的数据点。 | line: `ctkchart.CTkLine`
start: `int`
end: `int`
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]` |
+
@@ -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`
end: `int`
step: `int` | `Tuple[int \| float]` |
- | get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
- | get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
+| get_data | 获取指定范围的数据点,可以选择步长值。如果没有提供参数,将返回所有可用数据。 | start: `int`
end: `int`
step: `int` | `Tuple[int \| float]` |
+| get_current_visible_data | 根据所有线条的最大数据长度和最大可见点数,返回当前可见的数据点。 | - | `Tuple[int \| float]` |
+| get_x_axis_visible_point_count | 获取X轴上可见数据点的最大数量。 | - | `int` |
diff --git a/setup.py b/setup.py
index 792076e..d7caa8f 100644
--- a/setup.py
+++ b/setup.py
@@ -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.',
diff --git a/src/ctkchart/CTkLine.py b/src/ctkchart/CTkLine.py
index 625e2b2..f2602e7 100644
--- a/src/ctkchart/CTkLine.py
+++ b/src/ctkchart/CTkLine.py
@@ -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:
"""
@@ -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
diff --git a/src/ctkchart/CTkLineChart.py b/src/ctkchart/CTkLineChart.py
index 7315a48..c8eba5f 100644
--- a/src/ctkchart/CTkLineChart.py
+++ b/src/ctkchart/CTkLineChart.py
@@ -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]:
diff --git a/src/ctkchart/__init__.py b/src/ctkchart/__init__.py
index d661ece..f6535ad 100644
--- a/src/ctkchart/__init__.py
+++ b/src/ctkchart/__init__.py
@@ -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 (有语)")