SoFunction
Updated on 2024-10-29

python visualization big_screen library big_screen example details

在这里插入图片描述

For those who are engaged in the field of data, when it is necessary to explain your point of view and show the results of the project, we need to let others know your ideas in the shortest possible time. I believe that monotonous language is difficult for others to quickly understand. The most direct and effective way is to visualize the data as shown in the figure above.

The details are as follows:

big_screen Features

Convenience tool, simple structure, you only need to pass the data to realize the data large screen display.

installation environment

pip install -i /simple flask

input data

In the folder You can update the data you need to display in the following part of the data display:

self.echart1_data = {
            'title': 'Industry distribution',
            'data': [
                {"name": "Superstore", "value": 47},
                {"name": "Education and training", "value": 52},
                {"name": "Real estate.", "value": 90},
                {"name": "Life Services", "value": 84},
                {"name": "Car sales", "value": 99},
                {"name": "Tourist Hotel", "value": 37},
                {"name": "Hardware and Building Materials", "value": 2},
            ]
        }
        self.echart2_data = {
            'title': 'Provincial distribution',
            'data': [
                {"name": "Zhejiang", "value": 47},
                {"name": "Shanghai.", "value": 52},
                {"name": "Jiangsu.", "value": 90},
                {"name": "Guangdong", "value": 84},
                {"name": "Beijing.", "value": 99},
                {"name": "Shenzhen", "value": 37},
                {"name": "Anhui.", "value": 150},
            ]
        }
        self.echarts3_1_data = {
            'title': 'Age distribution',
            'data': [
                {"name": "Under 0", "value": 47},
                {"name": "20-29 years old", "value": 52},
                {"name": "30-39 years old", "value": 90},
                {"name": "40-49 years old", "value": 84},
                {"name": "Over 50 years old", "value": 99},
            ]
        }
        self.echarts3_2_data = {
            'title': 'Occupational distribution',
            'data': [
                {"name": "E-commerce", "value": 10},
                {"name": "Education", "value": 20},
                {"name": "IT/Internet", "value": 20},
                {"name": "Finance", "value": 30},
                {"name": "Student.", "value": 40},
                {"name": "Other", "value": 50},
            ]
        }

local operation

cd big_screen-master;
python ;

Online Deployment

You can run the script directly as if it were local, which will run successfully, or if we want it to run all the time, we can deploy it online. Use the following command:

nohup python 

At this point you can view the process

ps -ef | grep python

We will see that the code we just Code has been running, this is running in the background, after closing the connection will run the same, which is reassuring.

However, if an error occurs, we have no way of knowing what went wrong, so we specify the log output file

nohup python -u  >  2>&1 &

One more question, what if I want to stop running online? You can use this command

kill PID

The above is python visualization big_screen library big_screen example details, more about python visualization big_screen library big_screen information please pay attention to my other related articles!