-
installation
-
pip install tkchart
-
-
importing
-
import tkchart
-
- LineChart
- Line
- Creating a LineChart
- Creating a Line
- Display of data
linechart = tkchart.LineChart()
-
- master :
tkinter | customtkinter (Frame | Canvas | Tk)
- width :
int
- height :
int
- axis_size :
int
- x_space :
int
- y_space :
int
- line_width :
int | str
- "auto"
- 10
- pointer_size :
int
- x_axis_section_count :
int
- y_axis_section_count :
int
- x_axis_label_count :
int
- y_axis_label_count :
int
- x_axis_display_values_indices :
tuple[int, ...]
- x_axis_data :
any
- y_axis_data :
any
- x_axis_values :
tuple(any, ...)
- ("2020 Year", "2021 Year", "2022 Year", "2023 Year", "2024 Year")
- (0.1, 0.2, 0.3, 0.4, 0.5)
- y_axis_values :
tuple(int | float, int | float)
- (0 ,1000)
- (-1000, 1000)
- y_axis_precision :
int
- pointing_values_precision :
int
y_axis_max_value: Deprecated
- bg_color :
str
- fg_color :
str
- axis_color :
str
- x_axis_font_color :
str
- "#ffffff"
- "white"
- y_axis_font_color :
str
- x_axis_data_font_color :
str
- y_axis_data_font_color :
str
- y_axis_section_color :
str
- x_axis_section_color :
str
- pointer_color :
str
section_color: Deprecated
- data_font_style :
tuple[str, int, str]
- ("arial", 10, "bold")
- ("arial", 20, "normal")
- axis_font_style :
tuple
- x_axis_data_position :
str
- "top"
- "side"
- y_axis_data_position :
str
- x_axis_section_style :
str
- "normal"
- "dashed"
- y_axis_section_style :
str
- x_axis_section_style_type :
tuple(int, int)
- (50, 10)
- (10, 10)
- y_axis_section_style_type :
tuple(int, int)
- pointing_callback_function :
function
- function_name(*args)
- function_name(x ,y)
- pointer_state :
str
- "enabled"
- "disabled"
- pointer_lock :
str
- "enabled"
- "disabled"
-
y_axis_max_value :Deprecatedint | float
-
replaced with y_axis_values :
tuple(int | float, int | float)
The y_axis_values parameter is a tuple where the value at index 0 represents the starting value of the Y-axis, and the value at index 1 represents the ending value of the Y-axis.
-
-
section_color :Deprecatedstr
- replaced with x_axis_section_color :
str
- replaced with y_axis_section_color :
str
- replaced with x_axis_section_color :
- master :
-
-
Support parameters
- width
- height
- axis_size
- x_space
- y_space
- line_width
- pointer_size
- x_axis_section_count
- y_axis_section_count
- x_axis_label_count
- y_axis_label_count
- x_axis_display_values_indices
- x_axis_data
- y_axis_data
- x_axis_values
- y_axis_values
- y_axis_precision
- pointing_values_precision
- bg_color
- fg_color
- axis_color
- x_axis_font_color
- y_axis_font_color
- x_axis_data_font_color
- y_axis_data_font_color
- y_axis_section_color
- x_axis_section_color
- pointer_color
- data_font_style
- axis_font_style
- x_axis_data_position
- y_axis_data_position
- x_axis_section_style
- y_axis_section_style
- x_axis_section_style_type
- y_axis_section_style_type
- pointing_callback_function
- pointer_state
- pointer_lock
y_axis_max_value: Removedsection_color: Removed
-
Support parameters
- data :
tuple
- line :
tkchart.Line
- data :
-
Support parameters
- x
- y
- rely
- relx
- anchor
-
Support parameters
- pady
- padx
- before
- after
- side
- anchor
-
Support parameters
- column
- columnspan
- padx
- pady
- row
- rowspan
- sticky
-
Support parameters
- state :
bool
- state :
-
Support parameters
- line :
tkchart.Line
- state :
bool
- line :
-
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis__max_value=(0, 1000),
y_axis_precision=5
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis__max_value=(0, 1000),
y_axis_precision=5
x_axis_section_color="#404040",
y_axis_section_color="#404040",
x_axis_font_color="#707070",
y_axis_font_color="#707070",
x_axis_data_font_color="lightblue",
y_axis_data_font_color="lightblue",
bg_color="#202020",
fg_color="#202020",
axis_color="#707070"
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis__max_value=(0, 1000),
y_axis_precision=5
x_axis_section_color="#404040",
y_axis_section_color="#404040",
x_axis_font_color="#707070",
y_axis_font_color="#707070",
x_axis_data_font_color="lightblue",
y_axis_data_font_color="lightblue",
bg_color="#202020",
fg_color="#202020",
axis_color="#707070"
data_font_style=("Arial", 15, "bold"),
axis_font_style=("Arial", 10, "bold")
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis__max_value=(0, 1000),
y_axis_precision=5
x_axis_section_color="#404040",
y_axis_section_color="#404040",
x_axis_font_color="#707070",
y_axis_font_color="#707070",
x_axis_data_font_color="lightblue",
y_axis_data_font_color="lightblue",
bg_color="#202020",
fg_color="#202020",
axis_color="#707070"
data_font_style=("Arial", 15, "bold"),
axis_font_style=("Arial", 10, "bold"),
x_space=20,
y_space=20
)
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis__max_value=(0, 1000),
y_axis_precision=5
x_axis_section_color="#404040",
y_axis_section_color="#404040",
x_axis_font_color="#707070",
y_axis_font_color="#707070",
x_axis_data_font_color="lightblue",
y_axis_data_font_color="lightblue",
bg_color="#202020",
fg_color="#202020",
axis_color="#707070"
data_font_style=("Arial", 15, "bold"),
axis_font_style=("Arial", 10, "bold"),
x_space=20,
y_space=20,
x_axis_data_position="side",
y_axis_data_position="side"
)
linechart.pack()
line = tkchart.Line()
-
- master :
tkchart.LineChart
- color :
str
- "white"
- "#10f0f0"
- size :
int
- style :
str
- "normal"
- "dashed"
- "dotted"
- style_type :
tuple(int, int)
- (5,10)
- (10,5)
- point_highlight:
str
- "disabled"
- "enabled"
- point_highlight_size:
int
- point_highlight_color:
str
- master :
-
-
Support parameters
- size
- color
- style
- style_type
- point_highlight
- point_highlight_size
- point_highlight_color
-
Support parameters
line = tkchart.Line(master=linechart,
color="lightblue",
size=2,
style="dashed",
style_type=(4,10))
import customtkinter
import tkchart
import random
root = customtkinter.CTk()
linechart = tkchart.LineChart(master=root,
width=800,
height=400,
axis_size=5,
y_axis_section_count=5,
x_axis_section_count=5,
y_axis_label_count=5,
x_axis_label_count=10,
y_axis_data="GB",
x_axis_data="S",
x_axis_values=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y_axis_values=(0, 1000),
y_axis_precision=5,
x_axis_section_color="#404040",
y_axis_section_color="#404040",
x_axis_font_color="#707070",
y_axis_font_color="#707070",
x_axis_data_font_color="lightblue",
y_axis_data_font_color="lightblue",
bg_color="#202020",
fg_color="#202020",
axis_color="#707070",
data_font_style=("Arial", 15, "bold"),
axis_font_style=("Arial", 10, "bold"),
x_space=20,
y_space=20,
x_axis_data_position="side",
y_axis_data_position="side"
)
linechart.pack()
line = tkchart.Line(master=linechart,
color="lightblue",
size=2,
style="dashed",
style_type=(4, 10))
data = [0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]
def loop():
linechart.show_data(data=tuple([random.choice(data)]), line=line)
root.after(250, loop)
loop()
root.mainloop()
output-9.mov
-
PyPi.org : tkchart
-
GitHub.com : tkchart
Thank you for considering contributing to tkchart! Please follow these guidelines to contribute effectively.
- Fork the repository.
- Clone your forked repository:
git clone https://github.com/Thisal-D/tkchart.git
- Create a new branch for your changes:
git checkout -b feature-branch
- Make your changes and ensure they follow the project's coding standards.
- Test your changes locally.
- Commit your changes:
git commit -m "Brief description of your changes"
- Push your changes to your forked repository:
git push origin feature-branch
- Create a pull request on the main repository.
Please adhere to the Code of Conduct to maintain a respectful and inclusive community.
If you encounter issues or have questions, please check the issue tracker or start a discussion in the GitHub Discussions section.
By contributing, you agree that your contributions will be licensed under the project's LICENSE.
Thank you for your contribution!
Added new parameters to Line object
Try on : Tests/Main - Test.py
- point_highlight:
str
- point_highlight_size:
int
- point_highlight_color:
str
:: before
:: after
- point_highlight = "enabled"
- point_highlight_size = 10
- point_highlight_color = "#00FFFF"