File size: 543 Bytes
7e13702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
import pandas as pd

data=pd.DataFrame({
    'x': ['一月', '二月', '三月', '四月', '五月', '六月'],
    'y': [12000, 15000, 17000, 13000, 19000, 21000], 
    })

plot=gr.BarPlot(
    value=data, 
    x='x', 
    y='y', 
    title='上半年月銷售額變化', 
    x_title='月份', 
    y_title='銷售額(萬元)', 
    interactive=True
    )

iface=gr.Interface(
    fn=lambda: data, 
    inputs=[], 
    outputs=plot,
    title='長條圖 BarPlot() 測試',
    flagging_mode='never',
    )

iface.launch()