Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import matplotlib.pyplot as plt
|
| 4 |
+
|
| 5 |
+
def show_chart():
|
| 6 |
+
df = pd.DataFrame({"time": range(10), "value": [i**0.5 for i in range(10)]})
|
| 7 |
+
plt.plot(df["time"], df["value"])
|
| 8 |
+
return plt.gcf()
|
| 9 |
+
|
| 10 |
+
with gr.Blocks() as demo:
|
| 11 |
+
gr.Markdown("### 模擬 Grafana Dashboard")
|
| 12 |
+
gr.Plot(show_chart)
|
| 13 |
+
|
| 14 |
+
demo.launch()
|