pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖_第1頁(yè)
pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖_第2頁(yè)
pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖_第3頁(yè)
pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖_第4頁(yè)
pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖_第5頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

第pyecharts繪制時(shí)間輪播圖柱形圖+餅圖+玫瑰圖+折線圖目錄1、pyecharts繪制時(shí)間輪播柱形圖2、pyecharts繪制時(shí)間輪播餅圖3、pyecharts繪制時(shí)間輪播玫瑰圖4、pyecharts繪制時(shí)間輪播折線圖

1、pyecharts繪制時(shí)間輪播柱形圖

fromrandomimportrandint

frompyechartsimportoptionsasopts

frompyecharts.chartsimportBar,Timeline

frompyecharts.globalsimportThemeType

data={'x':['葡萄','芒果','草莓','雪梨','西瓜','香蕉','橙子'],

'沃爾瑪':dict(zip(range(2010,2025),[[randint(100,1000)forfruitinrange(7)]foryearinrange(10)])),

'大潤(rùn)發(fā)':dict(zip(range(2010,2025),[[randint(100,1000)forfruitinrange(7)]foryearinrange(10)]))

deftimeline_bar()-Timeline:

x=data['x']

tl=Timeline(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))

foriinrange(2010,2025):

bar=(

Bar(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))

.add_xaxis(x)

.add_yaxis('沃爾瑪',data['沃爾瑪'][i])

.add_yaxis('大潤(rùn)發(fā)',data['大潤(rùn)發(fā)'][i])

.set_global_opts(title_opts=opts.TitleOpts("{}年?duì)I業(yè)額".format(i)))

tl.add(bar,"{}年".format(i))

returntl

timeline_bar().render("timeline_bar.html")

2、pyecharts繪制時(shí)間輪播餅圖

#導(dǎo)入模塊

fromrandomimportrandint

frompyechartsimportoptionsasopts

frompyecharts.chartsimportPie,Timeline

frompyecharts.globalsimportThemeType

attr=["學(xué)習(xí)","娛樂(lè)","休息","運(yùn)動(dòng)","交流"]

list1=[2025,2025,2025,2025,2025]

list2=[[randint(100,1000)fortimeinrange(7)]foryearinrange(5)]#嵌套列表

data={'x':attr,

'時(shí)長(zhǎng)':dict(zip(list1,list2))

deftimeline_pie1()-Timeline:

x=data['x']

tl=Timeline(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))

foriinlist1:

c=(

Pie(init_opts=opts.InitOpts(theme=ThemeType.WONDERLAND))#主題風(fēng)格

.add("",[list(z)forzinzip(attr,data['時(shí)長(zhǎng)'][i])])

.set_global_opts(title_opts=opts.TitleOpts(title="活動(dòng)時(shí)長(zhǎng)占比",pos_top="top",pos_left="left"),

legend_opts=opts.LegendOpts(pos_left="right",orient="vertical"))#設(shè)置標(biāo)題

.set_series_opts(label_opts=opts.LabelOpts(formatter=':wllvuhn%')))#顯示百分比

tl.add(c,"{}".format(i))

returntl

timeline_pie1().render("timeline_pie.html")

3、pyecharts繪制時(shí)間輪播玫瑰圖

#導(dǎo)入模塊

fromrandomimportrandint

frompyechartsimportoptionsasopts

frompyecharts.chartsimportPie,Timeline

frompyecharts.globalsimportThemeType

attr=["學(xué)習(xí)","娛樂(lè)","休息","運(yùn)動(dòng)","交流"]

list1=[2025,2025,2025,2025,2025]

list2=[[randint(100,1000)fortimeinrange(7)]foryearinrange(5)]#嵌套列表

data={'x':attr,

'時(shí)長(zhǎng)':dict(zip(list1,list2))

deftimeline_bar1()-Timeline:

x=data['x']

tl=Timeline(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))

foriinlist1:

c=(

Pie(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))#主題風(fēng)格

.add("",[list(z)forzinzip(attr,data['時(shí)長(zhǎng)'][i])],radius=["25%","75%"],rosetype="radius")

.set_global_opts(title_opts=opts.TitleOpts(title="活動(dòng)時(shí)長(zhǎng)占比",pos_top="top",pos_left="left"),

legend_opts=opts.LegendOpts(pos_left="right",orient="vertical"))#設(shè)置標(biāo)題

.set_series_opts(label_opts=opts.LabelOpts(formatter=':7ck3nls%')))#顯示百分比

tl.add(c,"{}".format(i))

returntl

timeline_bar1().render("玫瑰圖.html")

4、pyecharts繪制時(shí)間輪播折線圖

#導(dǎo)入模塊

fromrandomimportrandint

frompyechartsimportoptionsasopts

frompyecharts.chartsimportLine,Timeline

frompyecharts.globalsimportThemeType

list1=[2025,2025,2025,2025,2025]

list2=[[randint(100,1000)fortimeinrange(7)]foryearinrange(5)]#嵌套列表

data={'x':['學(xué)習(xí)','娛樂(lè)','休息','運(yùn)動(dòng)','交流'],

'時(shí)長(zhǎng)':dict(zip(list1,list2))

deftimeline_bar()-Timeline:

x=data['x']

tl=Timeline()

foriinlist1:

bar=(

Line()

.add_xaxis(x)

.add_yaxis('時(shí)長(zhǎng)(min)',data['時(shí)長(zhǎng)'][i])

.set_global_opts(title_opts=opts.TitleOpts("{}年活動(dòng)時(shí)長(zhǎng)統(tǒng)計(jì)".format(i)))

tl

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論