# Data chart analysis model of Java programming development

Time：2021-6-28

### Implementation of multi curve chart analysis

#### Basic needs analysis

Suppose that at the age of monsters and the end of the year, we need to make statistical analysis on the traffic flow in and out of each road checkpoint, mainly from the perspective of traffic flow and license plate location. Business requirements as shown in the figure:

1. Mainly from the two latitude of traffic flow and license plate to analyze and statistics the corresponding traffic data
2. Horizontal and vertical analysis: x-axis and y-axis have 3 curves respectively [total number = entry number + exit number]
3. Different time latitude: statistics by day [default day and last 30 days] and statistics by month
4. Statistics of different road bayonets: Statistics of different bayonets and bayonet groups

###### Traffic flow analysis of road bayonet

1. Statistical time dimension: daily statistics [statistics of the last 30 days and the current day] and monthly statistics
2. Horizontal comparative analysis: Taking the acquisition time as the x-axis, it shows the number of vehicles entering and leaving the Customs on the whole day and half an hour, as well as the total number of traffic flow
3. Longitudinal comparative analysis: Taking the traffic flow as the y-axis, it shows the number of vehicles entering and leaving the Customs at the hour and half an hour of a day, as well as the total traffic flow
4. Chart data indicators: the total number of traffic flow, the number of entry and exit

1. Statistical time dimension: daily statistics [statistics of the last 30 days and the current day] and monthly statistics
2. Horizontal comparative analysis: with the license plate ownership as the x-axis, the number of relevant vehicles entering and leaving the customs and the total number of traffic flow in the corresponding area are displayed
3. Longitudinal comparative analysis: Taking the traffic flow as the y-axis, the number of relevant vehicles entering and leaving the customs and the total number of traffic flow in the corresponding region are displayed
4. Chart data indicators: the total number of traffic flow, the number of entry and exit
5. Data sorting: according to the risk level, the corresponding license plate traffic analysis

#### Analysis and implementation of coding logic

1. Define chart analysis data model
``````//Define data model
Map dataModel =Maps.newConcurrentMap();
//Define X and Y axis data models
Map dataMap = Maps.newConcurrentMap();
//Total traffic volume
dataModel.put("total", dataMap);
//Total number of entry
dataModel.put("enter", dataMap);
//Total number of customs clearance
dataModel.put("leave", dataMap);``````
1. Determine the x-axis and y-axis coordinate system data:
``````//Define X and Y axis data models
Map dataMap = Maps.newConcurrentMap();
//Define X-axis data model
//Define the y-axis data model
//Define index data model
BigDecimal count = BigDecimal.ZERO;
dataMap.put("xAxis",xlist);
dataMap.put("yAxis",yList);
dataMap.put("count",count.intValue());``````

[ ⚠️ [precautions]
1. The above model belongs to composite data analysis list data model
2. Simple data model analysis, generally using only:

``````//Define X and Y axis data models
Map dataMap = Maps.newConcurrentMap();
//Define X-axis data model
//Define the y-axis data model
dataMap.put("xAxis",xlist);
dataMap.put("yAxis",yList);``````

### Implementation of pie chart analysis

Suppose that at the age when monsters appear and the end of the year is around the corner, it is necessary to make statistical analysis on the proportion of traffic flow in and out of each road checkpoint, mainly from the perspective of risk level and risk area. Business requirements as shown in the figure:

Risk level analysis

1. Mainly from the risk level [high, medium, low] statistical analysis of the proportion of data
2. Statistical time dimension: statistics by day [the day], by week [the last seven days], and by month [the data of the last 30 days]

Proportion of risk areas

1. Mainly from the risk area dimension statistics license plate ownership analysis data proportion
2. Statistical time dimension: statistics by day [the day], by week [the last seven days], and by month [the data of the last 30 days]