I introduced a data visualization tool, DataEase, and found that people are interested in this kind of visualization tool. Recently, I found a data visualization tool Metabase with a very good interface. Compared with DataEase, this tool can be built in only 5 minutes without complex configuration and is very convenient to use. This really out of the box good tool, today recommended to everyone!

SpringBoot e-commerce project mall (50K + STAR) address: github.com/macrozheng/…

Introduction to the

Metabase is a simple and fast BI (data visualization) tool, with 27K +Star on Github, it is very popular.

Metabase has the following characteristics:

  • It is very fast to build with Docker, which can be completed in 5 minutes.
  • Data visualization tools for everyone, you don’t need to know SQL;
  • Provides a rich dashboard interface, real appearance level online tools, support automatic data refresh;
  • Support custom SQL query, suitable for SQL people to use;
  • Powerful data perspective function, can automatically generate dashboard according to the data;
  • Association analysis of multiple table data can be performed without handwritten SQL.

Here is a dashboard generated by Metabase, which is quite cool.

The installation

Installing Metabase using Docker is very simple and we will install it this way.

  • First download Metabase Docker image, only400MSize, very small;
docker pull metabase/metabase
Copy the code
  • Next run the Metabase service with the following command;
docker run -p 3000:3000 --name metabase \
-v /mydata/metabase-data:/metabase-data \
-e "MB_DB_FILE=/metabase-data/metabase.db" \
-d metabase/metabase
Copy the code
  • You can run the following command to view logs.
docker logs -f metabase
Copy the code
  • From the log, it is easy to see that Metabase is another Java development artifact. When the following log is output, it means that the startup is successful.

  • Last to turn on the firewall3000Port for external access.
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload
Copy the code

configuration

Before Metabase can be used, we still need some configuration.

  • First through the following address access Metabase, there is a welcome screen, access address: http://192.168.3.105:3000/

  • Then choose a language, Metabase internationalization is good, support a lot of languages;

  • Next create an administrator account;

  • Then choose a database, Metabase support database types are also quite rich;

  • Configure database connection information.

  • Select whether to allow anonymous collection to use events;

  • After setting up, you can enter the main screen of Metabase.

use

Metabase has a built-in H2 database with some sample data. Let’s use this data to demonstrate the basic usage of Metabase.

  • First of all, let’s open the sample database to see what data there is, basically is the order, goods, users these data tables;

  • We openOrdersTable you can view the data in the table.

  • In Metabase, a visual chart is calledThe problemLet’s make oneChart of merchandise sales growth trends for 2019-2020First, through theThe filterSet the filter criteria toCreated At;

  • Then set conditions and add filters;

  • Then throughThe aggregationFunction to set the aggregation condition toCombined - > Total;

  • Set the grouping condition toCreated AtAnd grouped by month;

  • And then you’re going to have a trend line graph, which is in the lower leftvisualizationButton, we can toggle charts;

  • There are a lot of charts to support. Click heresaveButton can be saved;

  • We can also use the top oneA plus signButton to create dashboard;

  • Then add all the charts to the dashboard, oneSales board of e-commerce platformAnd you’re done.

senior

Metabase does much more than that, but here are some more advanced uses.

Pivot table

Perspective is an amazing feature that automatically generates charts when you have a bunch of data and you don’t know how to analyze it.

  • So let’s put it in perspectiveOrdersTable, click the lightning button to use;

  • Metabase will automatically generate a dashboard, analyze some data, such as total order quantity, sales of each commodity, sales of each commodity category, we can find the data you are interested in;

  • Click the zoom button on the right for a more detailed analysis based on conditions, such as time, where various conditions of the order are analyzed according to the time dimension.

Customize the Home Page

Tagging allows us to anchor interesting content to the home page.

  • Let’s say we did the previous oneAn e-commerce platform sells kanbanIf you’re interested, you can mark it;

  • Once the tag is complete, you can easily view it on the home page.

Customize SQL queries

Sometimes the data we analyze is complex and can be implemented by custom SQL.

  • You can click on theCreate a problemButton, and then createNative queries;

  • Then select a good database, input custom SQL can be queried.

Table association

Sometimes when we need data from multiple tables for data analysis, we can use the data table association function without handwritten SQL.

  • Let’s say we want toStatistics the sales of goods by category, classification information inProductsIn the table, the sales information is inOrdersIn the table, we can passDisplay editorTo select theassociatedFunction;

  • Then the managementOrdersTable andProductsTable, and then the sum of sales can be achieved by grouping according to commodity classification;

  • Next, we can see the sales statistics of each product by category.

Administrator Settings

With the administrator Settings function, we can modify Metabase system Settings, such as language Settings, user management, database management, etc.

  • Click on theSettings -> AdministratorYou can switch to the administrator for setting;

  • inSet up theIn, we can do some basic setup;

  • inpersonnelCan be used for user management;

  • inThe data sourceTo manage the connection information of various databases, the sample data we have been using before existsH2In the database;

  • inpermissionsCan be used for permission management.

conclusion

Today I experienced a Metabase, it is really a good tool out of the box, it only takes 5 minutes to set up. Metabase-generated charts are also beautiful and easy to use, and there is no need for handwritten SQL for multi-table analysis. If you have data visualization needs, give it a try!

The resources

  • Project address: github.com/metabase/me…
  • The official document: www.metabase.com/docs/latest…

In this paper, making github.com/macrozheng/… Already included, welcome everyone Star!