Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tkchart

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tkchart

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

  • 2.1.4
  • PyPI
  • Socket score

Maintainers
2

tkchart

tkchart

v 2.1.5

Downloads Downloads Downloads

  • 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.

    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()
    


    Contributors

    Keywords

    FAQs


    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts

    SocketSocket SOC 2 Logo

    Product

    • Package Alerts
    • Integrations
    • Docs
    • Pricing
    • FAQ
    • Roadmap
    • Changelog

    Packages

    npm

    Stay in touch

    Get open source security insights delivered straight into your inbox.


    • Terms
    • Privacy
    • Security

    Made with ⚡️ by Socket Inc