Python notes: making dashboard to monitor sales achievement rate

Our department will hold a monthly operation analysis meeting every month, so it is necessary to make a PPT report. As we all know, it will be more persuasive to quote data in PPT according to the facts. However, adding some cool and reasonable visual charts will add a lot of color (more visual impact)!

First, install the pyecharts and Gauge modules in Anaconda. The instructions are as follows:

pip install pyecharts
pip install Gauge

Next, you can write code to realize visualization:

#Dashboard
from pyecharts import options as opts
from pyecharts.charts import Gauge, Page



c = (
        Gauge()
        .add("",
             [("Comprehensive achievement rate", 66.67)]
             #Set color
            #,axisline_opts=opts.AxisLineOpts(linestyle_opts=opts.LineStyleOpts(color=[(0.3, "#67e0e3"), (0.7, "#37a2da"), (1, "#fd666d")], width=30))
            )
        .set_global_opts(title_opts=opts.TitleOpts(title="4 Month actual sales"))
)
c.render_notebook()

#Dashboard
from pyecharts import options as opts
from pyecharts.charts import Gauge, Page



c = (
        Gauge()
        .add("",
             [("Vegetable yield", 98.8)]
             #Set color
            #,axisline_opts=opts.AxisLineOpts(linestyle_opts=opts.LineStyleOpts(color=[(0.3, "#67e0e3"), (0.7, "#37a2da"), (1, "#fd666d")], width=30))
            )
        .set_global_opts(title_opts=opts.TitleOpts(title="4 Month actual sales"))
)
c.render_notebook()

#Dashboard
from pyecharts import options as opts
from pyecharts.charts import Gauge, Page



c = (
        Gauge()
        .add("",
             [("Achievement rate of aquatic products", 11.1)]
             #Set color
            #,axisline_opts=opts.AxisLineOpts(linestyle_opts=opts.LineStyleOpts(color=[(0.3, "#67e0e3"), (0.7, "#37a2da"), (1, "#fd666d")], width=30))
            )
        .set_global_opts(title_opts=opts.TitleOpts(title="4 Month actual sales"))
)
c.render_notebook()

Summary: using the dashboard to express the progress (achievement rate / completion rate) can give the audience a new visual feeling. As long as you need to use it, copy and paste this code, modify the parameters, and run the results to get the desired visual chart of the above types.

Tags: Big Data pip Anaconda

Posted on Tue, 05 May 2020 16:41:59 -0700 by invisionx