0% found this document useful (0 votes)
29 views1 page

Coding Python - Video Bar Race Chart

The document outlines a Python script that utilizes the sjvisualizer library to create a racing bar chart visualization from an Excel data file. It sets up a canvas, adds a title, subtitle, time indicator, and a logo, and then plays the animation at a specified frame rate. The data visualized pertains to disaster data for January 2024.

Uploaded by

wulan rahayu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Coding Python - Video Bar Race Chart

The document outlines a Python script that utilizes the sjvisualizer library to create a racing bar chart visualization from an Excel data file. It sets up a canvas, adds a title, subtitle, time indicator, and a logo, and then plays the animation at a specified frame rate. The data visualized pertains to disaster data for January 2024.

Uploaded by

wulan rahayu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# Import all modules

from sjvisualizer import DataHandler


from sjvisualizer import Canvas
from sjvisualizer import BarRace
from sjvisualizer import StaticImage
import json

# Load the data into a data frame

data = 'C:/Users/Kasubag Sungram/Desktop/Coba2 R/[Link]'


FPS = 60
DURATION = 0.5

df = [Link](excel_file=data, number_of_frames=FPS*DURATION*60).df

# Creating the canvas


canvas = [Link]()

# Adding the racing bar chart


bar_chart = BarRace.bar_race(df=df, canvas=[Link])
canvas.add_sub_plot(bar_chart)

# Adding a title
canvas.add_title("Data Bencana 2024")
canvas.add_sub_title("1-30 January 2024")

# Adding a time indicator


canvas.add_time(df=df, time_indicator='day')

# Adding a logo
canvas.add_logo(logo='C:/Users/Kasubag Sungram/Desktop/Coba2 R/LOGO [Link]')

# Play the animation


[Link](fps=FPS)

You might also like