本人大学刚毕业,目前在一家互联网公司从事产品运营工作。一季度刚过,公司需要我出一份产品运营数据报表。由于产品用户数据、订单数据等数据量较大,希望能找到一款ThisBi产品,支持我做出精美的可视化报表,也能让我直接在报表内容中查看原始数据文档。我从以下两点逐渐体会到自己的需求:1.数据可视化:我在网上找了一些BI工具,无一例外是需要收费的。最后还是决定试试pyecharts来实现。好在自己有自学Python的基础,实现起来并不难;查看,需要直接在网页上查看原始excel文档。这个实现难度比较大。在网上找了三天无果,在快要放弃的时候,找到了永中云预览插件版。拿到宝物最重要的是只需要2行。代码完成所有工作,而且完全免费!下面是我的数据可视化报告截图:先简单说说如何实现:1.数据可视化报告importpandasasppdfrompyechartsimportoptionsasoptsfrompyecharts.chartsimportGeo,Page,Gridfrompyecharts.globalsimportChartType,SymbolTypefrompyecharts.chartsimportLiquidfrompyecharts.chartsimportFunnelfrompyecharts.globalsimportThemeTypefrompyecharts.chartsimportBar,Bar3Dfrompyecharts.chartsimportPiefrompyecharts.chartsimportLine,EffectScatterfrompyechartsimportchartsPython库:Pandas:主要是读取excel源数据;Pyechartscolumnar:BarGraph、Pie饼图、Geomap、Liquidwaterdropchart、Funnel漏斗图、Line折线图,当然还有其他用不到的图标。如果需要,可以到官网查看相关文档:https://pyecharts.org/#/zh-cn...以其中一个数据视图产品渠道推广和渠道激活为例,我需要做一个饼图展示pie_moblie=(Pie().add("推广费",[list(z)forzinzip(qudao_mobile,cost_mobile)],radius=["20%","45%"],center=["22%","50%"],rosetype="radius",label_opts=opts.LabelOpts(is_show=True,formatter='{b}:{d}%'),).add("激活量",[list(z)forzinzip(qudao_mobile,jihuo_mobile)],radius=["20%","45%"],center=["70%","50%"],rosetype="area",label_opts=opts.LabelOpts(is_show=True,formatter='{b}:{d}%'),).set_global_opts(title_opts=opts.TitleOpts(title="2022年第一季度各渠道消费&激活情况"),legend_opts=opts.LegendOpts(is_show=True,)))效果为如下:完成每个查看页面后。add(bar3,c3,pie_mobile)page.render('test.html')通过page.add()把之前做的view放在一个页面上,最后通过page.render()生成一个html页面,然后对生成的html进行适当的样式调整,就得到了我上面展示的最终效果。目录,根据示例代码在新生成的html中添加相应的代码
