Hi Streamlit Community`s everyone.
Here I got A Problem:I am now making a Django Server Source Monitor Platform.It based On Streamlit.
But here is my code and the what i hope is one refreshing, animated craft,not creating too much craft on a single website.So what shoud i do now?
Code HERR:
import pickle
from re import X
from time import time
from numpy.core.fromnumeric import size
import streamlit as st
from psutil import *
import pandas as pd
import plotly.express as px
import datetime as dt
def MonitorWatchDog():
usage = []
while True:
usage.append(cpu_percent())
if len(usage) == 10:
return usage
def render():
while True:
frame = pd.DataFrame(MonitorWatchDog(),columns=["cpu_usage"])
st.area_chart(data=frame["cpu_usage"])
st.markdown(render())
Hey thanks for your solution but here is antoher appeds is that:
when i try to ploting the read&write speed of Severs(Also same as the Down/Up load speed on networking),then the APP Will just ploting of one of them,not both.What should i do?I try to moving my code in so many ways,no matter metion a class or a function.
I got it,which means that not matter how may data source i add it to my code,finally it need to intialize by one dataframe and render this dataframe into many plot charts,right?
Yes, you can create one dataframe and add each source as a unique column (provided that columns have the same length). Next, initialize/render individual charts with st.area_chart(df.column_name) and then add rows to each of the charts.