Skip to main content

Python library for creating live updating line charts in Tkinter.

Project description

Chinese

tkchart

tkchart

v 2.1.8

Downloads Downloads last 6 month Downloads Downloads

PyPI - License LOC

  • tkchart is a Python library for creating live updating line charts in tkinter.

  • Features

    • Live Update: Display live data with line charts.
    • Multiple Lines: Support for plotting multiple lines on the same chart for easy comparison.
    • Color Customization: Customize colors to match your application's design or data representation.
    • Font Customization: Adjust fonts for text elements to enhance readability.
    • Dimension Customization: Customize chart dimensions to fit various display sizes and layouts.

    Check out what's new | Changes


    Importing & Installation

    • Installation

      pip install tkchart
      
    • Importing

      import tkchart
      

    Simple Guide

    • import package

      import tkchart
      
    • Create Line Chart and place the chart

      chart = tkchart.LineChart(
          master=root,
          x_axis_values=("a", "b", "c", "d", "e", "f"),
          y_axis_values=(100, 900)
      )
      chart.place(x=10, y=10)
      
    • Create Line

      line = tkchart.Line(master=chart)
      
    • Display Data display data using a loop

      def loop():
          while True:
              random_data = random.choice(range(100, 900))
              chart.show_data(line=line, data=[random_data])
              time.sleep(1)
      
      #call the loop as thead
      theading.Thread(target=loop).start()
      

    Full Code Example

    import tkchart #  <- import the package
    import tkinter
    import random
    import threading
    import time
    
    #create window
    root = tkinter.Tk()
    
    #create chart
    chart = tkchart.LineChart(
        master=root,
        x_axis_values=("a", "b", "c", "d", "e", "f"),
        y_axis_values=(100, 900)
    )
    chart.place(x=10, y=10) #place chrt
    
    #create line
    line = tkchart.Line(master=chart)
    
    def loop():
        while True:
            random_data = random.choice(range(100, 900)) #get random data
            chart.show_data(line=line, data=[random_data]) # <- display data using chart 
            time.sleep(1) #wait 1 sec
            
    #call the loop as thead
    threading.Thread(target=loop).start()
    
    root.mainloop()
    

    Links


    Contributors

    Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    tkchart-2.1.8.tar.gz (31.1 kB view details)

    Uploaded Source

    Built Distribution

    tkchart-2.1.8-py3-none-any.whl (28.0 kB view details)

    Uploaded Python 3

    File details

    Details for the file tkchart-2.1.8.tar.gz.

    File metadata

    • Download URL: tkchart-2.1.8.tar.gz
    • Upload date:
    • Size: 31.1 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/6.1.0 CPython/3.12.6

    File hashes

    Hashes for tkchart-2.1.8.tar.gz
    Algorithm Hash digest
    SHA256 097a22ac69e4592b88fcf64ccbcd326330f34fec0e411dd68a64d11e8759fd44
    MD5 3a6e6859e19fb3c65d817fa1a6995f5d
    BLAKE2b-256 75a0f15c87386c97dca409e9f8b20053e7722fe62418a96e56abe63067c6e872

    See more details on using hashes here.

    File details

    Details for the file tkchart-2.1.8-py3-none-any.whl.

    File metadata

    • Download URL: tkchart-2.1.8-py3-none-any.whl
    • Upload date:
    • Size: 28.0 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/6.1.0 CPython/3.12.6

    File hashes

    Hashes for tkchart-2.1.8-py3-none-any.whl
    Algorithm Hash digest
    SHA256 cf99bd029c816074d8cea16737da29d632fe11beda5a2833d72afd34c0643fcd
    MD5 3d04d46c29da66a65cfaf30c32e0eb6b
    BLAKE2b-256 9dfd66e1f5a0f513633f86eb4bd051cf01ac4e9167145ee24e89c017bf593a25

    See more details on using hashes here.

    Supported by

    AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page