Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,8 @@ import pandas as pd
|
|
| 3 |
import pandas_bokeh
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
from pyecharts.charts import Bar
|
|
|
|
|
|
|
| 6 |
#from pyg2plot import Plot
|
| 7 |
#plt.rcParams['font.sans-serif']=['SimHei']
|
| 8 |
#plt.rcParams['axes.unicode_minus']=False
|
|
@@ -35,6 +37,9 @@ def pyecharts1():
|
|
| 35 |
bar.add_yaxis("ๅๅฎถA", [5, 20, 36, 10, 75, 90])
|
| 36 |
bar.render('test.html')
|
| 37 |
return 'test.html'
|
|
|
|
|
|
|
|
|
|
| 38 |
#def pyg2plot_chart():
|
| 39 |
# bar = Plot("Column")
|
| 40 |
# bar.set_options({"height": 600,"width":800,"data": [{ "ๅนด": "2001", "้้": 3 },{ "ๅนด": "2002", "้้": 4 },{ "ๅนด": "2003", "้้": 5.5 },{"ๅนด": "2004", "้้": 7 },{ "ๅนด": "2005", "้้": 8.9 },{ "ๅนด": "2006", "้้": 10}],"xField": "ๅนด","yField": "้้","label": {}})
|
|
@@ -63,6 +68,10 @@ with demo:
|
|
| 63 |
ehc_button=gr.Button("pyecharts>>")
|
| 64 |
ehc_output=gr.File(label="pyecharts_chart")
|
| 65 |
ehc_button.click(pyecharts1, inputs=[], outputs=ehc_output,api_name='pyecharts')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
# with gr.TabItem("pyg2plot"):
|
| 67 |
# pyg2_button=gr.Button("pyg2plot>>")
|
| 68 |
# pyg2_output=gr.Plot(label="pyg2plot_chart")
|
|
|
|
| 3 |
import pandas_bokeh
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
from pyecharts.charts import Bar
|
| 6 |
+
import cufflinks as cf
|
| 7 |
+
|
| 8 |
#from pyg2plot import Plot
|
| 9 |
#plt.rcParams['font.sans-serif']=['SimHei']
|
| 10 |
#plt.rcParams['axes.unicode_minus']=False
|
|
|
|
| 37 |
bar.add_yaxis("ๅๅฎถA", [5, 20, 36, 10, 75, 90])
|
| 38 |
bar.render('test.html')
|
| 39 |
return 'test.html'
|
| 40 |
+
def cff():
|
| 41 |
+
cfft=cf.datagen.lines(4,10).iplot(mode='lines+markers',theme='solar')
|
| 42 |
+
return cfft
|
| 43 |
#def pyg2plot_chart():
|
| 44 |
# bar = Plot("Column")
|
| 45 |
# bar.set_options({"height": 600,"width":800,"data": [{ "ๅนด": "2001", "้้": 3 },{ "ๅนด": "2002", "้้": 4 },{ "ๅนด": "2003", "้้": 5.5 },{"ๅนด": "2004", "้้": 7 },{ "ๅนด": "2005", "้้": 8.9 },{ "ๅนด": "2006", "้้": 10}],"xField": "ๅนด","yField": "้้","label": {}})
|
|
|
|
| 68 |
ehc_button=gr.Button("pyecharts>>")
|
| 69 |
ehc_output=gr.File(label="pyecharts_chart")
|
| 70 |
ehc_button.click(pyecharts1, inputs=[], outputs=ehc_output,api_name='pyecharts')
|
| 71 |
+
with gr.TabItem("cufflinks"):
|
| 72 |
+
cff_button=gr.Button("cufflinks>>")
|
| 73 |
+
cff_output=gr.File(label="cufflinks_chart")
|
| 74 |
+
cff_button.click(cff, inputs=[], outputs=cff_output,api_name='cuffl')
|
| 75 |
# with gr.TabItem("pyg2plot"):
|
| 76 |
# pyg2_button=gr.Button("pyg2plot>>")
|
| 77 |
# pyg2_output=gr.Plot(label="pyg2plot_chart")
|