First look at the car's big screen (cell phone traffic caution!) : https: //datav.aliyun.com/share/20acd88491367bf262fcb1e862ee8f1c
Must-have product: DataV
I am a technical man, but also a car lover, last month bought a BMW, but found that the road “BMW more and more” (⊙﹏⊙)b ......
I like to study the technology, also like to study the car, recently studied the data visualization, found that the datav can play some tricks, this time I will share my experience to do automotive data big screen.
No data is no good, first put together some car data, and then ......
Cleaning data
The data I found is like this
Size
Number of people
4567mm*1786mm*1454mm
1
5300*1800*1600
1
length 4369mm *width 1802mm *height 1445mm
1
4670mm*1780mm*1435mm
1
4430*1793*1399
1
4671*1815*1478
1
4929mm*1898mm*1655mm
1
4430mm*1793mm*1399mm
1
4714*1810*1442
1
length 4484mm *width 1798mm *height 1577mm
1
5090×1926×1900
1
I threw up when I saw the dimensions ...... It's really any format.
Being a front-end, it was easy to use javascript to simply convert it into a uniform, clean format, and the number of people with the same dimensions was counted (and added up)
var car = {};
require(“tongji.txt”)
.split(“\n”)
.forEach(function(v){
var [size, num] = v.split(“\t”);
size = size.replace(/^\D*(\d{4})\D*? (\d{4})\D*? (\d{4})\D*$/g, '$1*$2*$3')
if (!car[size]) car[size] = 0;
car[size] += num*1;
});
/*
car = {
4369*1802*1445: 1,
4430*1793*1399: 2,
4484*1798*1577: 1,
4567*1786*1454: 1,
4670*1780*1435: 1, 4671*1815*1478
4671*1815*1478: 1, 4714*1810*1442: 1, 4670*1780*1435: 1
4714*1810*1442: 1, 4929*1898*1616: 1, 4671*1815*1478: 1
4929*1898*1655: 1, 5090*1926*1950: 1, 5090*1926*1950: 1
5090*1926*1900: 1, 5300*1800*1600: 1, 4929*1898*1655: 1
5300*1800*1600: 1,
//...
}
*/
The cleaned data is then stored in the database
Matching vehicle model
The data is clean, but I'm still a bit uneasy... can I really find the model year by the vehicle dimensions?
I found a model database and wrote a simple SQL to test it.
select
concat(`length(mm)`, '*', `width(mm)`, '*', `height(mm)`) as size, count(distinct vehicle model) as
count(distinct car family) as cnt,
group_concat(distinct trim level)
from models
group by size
order by cnt desc
limit 1000
The results are the same as in the table below, they are all similar models of the same brand, which should not affect the results too much.
Connecting to my test data, the results are pretty much just the difference between domestic and imported.
size
cnt
group_concat(distinct car models)
4629*1880*1653
2
AUDI Q5,AUDI Q5(Import)
4638*1803*1598
2
INFINITI EX,INFINITI QX50(Import)
4624*1811*1460
2
BMW 3 Series,BMW 3 Series(Import)
4660*1852*1400
2
Infiniti G-Series,Infiniti Q60
In order to calculate the convenience, I then the size directly into the model id, so the data is ready.
DataV on the field
First of all, I chose the most pleasant template (technical men generally like cold colors, unless you live in the heart of a little sheep, only to choose the “double 11” the same type of big screen)
I do not have any geographic data for the time being, so everyone's favorite map, this time on the deletion, if someone wants to see the operation of the map to share, you can leave me a message, I will do anomalies on the map visualization of the share.
First think of the indicators, change the title of the module to the desired indicators, do not know what indicators you want to see, just like me, mystery point - data exploration.
In the middle you want a car lineage distribution, you can list a lot of cars in such a large area.
Add a pie chart, adjust the position and select it directly to the already built database, the
Enter the sql
select sum (l.num) as y, car series as x
from stats as l
left join models as c on c.id = l.car
group by x order by y desc
limit 30.
What to do if you are not satisfied with the result? I'll teach you another design trick
Then add some more components to enrich it
Then add a few more queries:
/* total value */
select sum(num * price)*10000 as value from stats as l
left join models as c on c.id = l.car;
/* Total number of vehicles */
select sum(num) as value from stats
/* Average vehicle price */
select sum(num*price)/sum(num) as value from stats
left join models as car on car.id = stats.car;
/* Displacement distribution */
select sum(l.num) as y, `displacement(L)` as x
from stats as l
left join models as c on c.id = l.car
group by `displacement(L)`
order by x asc
limit 20
/* Price distribution up to 600,000 */
select sum(l.num) as y, concat(ceil(price/5)*5, “lakh”) as x
from stats as l
left join models as c on c.id = l.car
where price < 60
group by FLOOR(price/5)
order by FLOOR(price/5) asc
This completes the center.
The same way to add data to the left side, the above two components is not my style. first replaced, note that when you replace the components, the data source should be re-selected once.
The right side and so on, in fact, do not have to wait until you have thought of all the indicators before doing it. In doing this screen, when the data output into the moment of the chart, I often get more interesting ideas. At this time, I change the sql, maybe even better indicators will come out.
The important thing to do big screen is design and data:
Design:
If you are like me, a bit of a personal enthusiast, you can go to see more Hollywood blockbusters to improve the data aesthetic.
If you are in a company with design resources, then let him help you do a visual orientation. It's usually the center metrics that are the most critical, then the left column of metrics is a line of business and the right column of metrics is a line of business for easy interpretation.
Data:
If it's a personal study, find some public data online or edit static data directly on the page.
If it is a business, then according to the business requirements of the indicators calculated, and then read from the data read real-time to read, DataV data column can be set how often to read the library.
In addition, I am actually a data analyst, if you have data do not know how to analyze, you can also leave me a message, I can help you use DataV in-depth analysis. Remember, automotive data comes first!
Leave a portal to DataV, people who have not yet bought it can look at it, 1 dollar for 3 months, general people I do not tell him.
Next share: “You leave a message, I'll write” -> -> Goodbye!