(1) Preface
First of all, I would like to thank Mr. Lin Feng for continuing with the content mentioned in Article 7. The CSS layout is indeed very tired and I feel like I am not able to adjust it. I will not talk much about it. Today, I will explain the content of a page. I will introduce the CSS layout in detail later.
In addition, I wrote with timeline map extended by echarts, http://echarts.baidu.com/doc/example/map19.html
(2) overall content
The topic includes the following five topics:
1) major naval battles: describes major naval battles in real time
2) Comparison of national strength: comparison of national strength between China and Japan before and after the war
3) equipment comparison: comprehensive comparison of naval strength
4) historical figures: key figures in Sino-Japanese Decision-Making
5) martyrdom generals: commemorating the martyrdom generals of the Beiyang naval forces
The layout is as follows:
(2) Describe the comparison of military power in the comparison of equipment
First:
(3) code details
To make code writing more normative, JavaScript, HTML, and CSS are completely separated.
The JS structure is as follows:
The Code of warship04test. JS is as follows:
Require. config ({paths: {echarts :'. /JS/echarts ', 'echarts/chart/bar ':'. /JS/echarts-map', 'echarts/chart/line ':'. /JS/echarts-map', 'echarts/chart/radar ':'. /JS/echarts-map'}); require (['echarts', 'echarts/chart/bar', 'echarts/chart/line ', 'echarts/chart/radar '], function (EC) {// data ', 'artillery qty ', 'average speed'] var mychart1bottom = EC. init (document. getelementbyid ('warship01 _ bottom '); mychart1bottom. setoption ({tooltip: {trigger: 'axis ', formatter: function (a, B, c) {var res_jiawu = A [0] [0] + '<br/>' + A [0] [3]; for (VAR I = 0; I <. length; I ++) {Switch (A [0] [3]) {Case 'total displacement ': res_jiawu + = '<br/>' + A [I] [1] + ':' + A [I] [2] + 'tount'; break; case 'formation horsepower ': res_jiawu + =' <br/> '+ A [I] [1] +': '+ A [I] [2] + 'pi '; break; Case 'large caliber artillery number': res_jiawu + = '<br/>' + A [I] [1] + ': '+ A [I] [2] + 'Gateway'; break; Case 'artillery: the number of shots in one minute ': res_jiawu + = '<br/>' + A [I] [1] + ':' + A [I] [2] + 'pass'; break; Case 'artillery: one-minute projection weight ': res_jiawu + =' <br/> '+ A [I] [1] +': '+ A [I] [2] + 'kg '; break; Case 'number of shoes ': res_jiawu + =' <br/> '+ A [I] [1] + ': '+ A [I] [2] + 'Gateway'; break;} return res_jiawu ;}, Legend: {Orient: 'vertical', X: 'right ', y: 'bottom ', data: ['beiyang fleet', 'Japan joint arms']}, toolbox: {Show: True, feature: {MARK: {Show: true }, dataview: {Show: True, readonly: false}, restore: {Show: true}, saveasimage: {Show: True }}, polar: [{indicator: [{text: 'Total displacement ', Max: 50000 },{ text: 'formation horsepower', Max: 70000 },{ text: 'large caliber artillery number', Max: 200 },{ text: 'artillery: number of shots per minute ', Max: 300 },{ text: 'artillery: Projection weight per minute', Max: 6000 },{ text: 'number of shoes ', Max: 100}], calculable: True, Series: [{Name: 'beiyang fleet vs. Japanese Joint Fleet ', type: 'radar', data: [{value: [32100,422 00, 58, 22,186 4, 0], name: 'beiyang fleet '}, {value: [40840,689 00, 104,232,596 5, 89], Name: 'Japanese joint Army', itemstyle: {normal: {label: {Show: True, textstyle: {color: 'green'}, formatter: function (a, B, c) {Switch (B) {Case 'total water': var res = C + 'tount'; break; Case 'fleet horsepower ': var res = C + 'pi'; break; case 'large caliber artillery number': var res = C + 'Gateway'; break; Case 'artillery: quantity of one-minute bombs ': var res = C + 'qak'; break; case 'artillery: one-minute projection weight': var res = C + 'kg '; break; Case 'number of shoes': var res = C + 'Gateway'; break ;} return res ;}}}}]});
The military expense comparison page is as follows:
The Code is as follows:
Require. config ({paths: {echarts :'. /JS/echarts ', 'echarts/chart/bar ':'. /JS/echarts-map', 'echarts/chart/line ':'. /JS/echarts-map', 'echarts/chart/map ':'. /JS/echarts-map'}); require (['echarts', 'echarts/chart/bar', 'echarts/chart/line ', 'echarts/chart/Map', 'echarts/chart/Pie'], function (EC) {var mychart4 = EC. init (document. getelementbyid ('warship04 '); mychart4.setoption ({tooltip: {trigger: 'axis'}, toolbox: {Show: True, feature: {MARK: {Show: true }, dataview: {Show: True, readonly: false}, magictype: {Show: True, type: ['line', 'bar']}, restore: {Show: true }, saveasimage: {Show: True }}, calculable: True, Legend: {data: ['overseas fleet military spending ', 'Japanese naval military spending', 'Japanese-Japanese military spending ratio ']}, xaxis: [{type: 'category ', data: ['August 11', 'August 11', 'August 11', 'August 11', 'August 11', 'August 11 ', 'October ', 'October']}], yaxis: [{type: 'value', Name: 'baibai', axislabel: {formatter: '{value} '}}, {type: 'value', name: 'Japanese military/Beiyang military spending '}], Series: [{Name: 'North ocean fleet military spending ', type: 'bar', data: [200.0, 200.0, 57.0, 57.2, 410.6, 160.7, 210.6, 600.2, 198.6, 200.0, 200.4, 210.3], markline: {data: [{type: 'average', name: 'average'}] },{ name: 'Japanese naval military spending ', type: 'bar', data: [400.0, 401.0, 200.0, 230.4, 600.7, 360.7, 670.6, 830.2, 760.7, 818.8], // data: [1100.0, 760.3, 200.0, 57.0, 57.2, 410.6, 160.7, 210.6, 600.2, 198.6, 200.0, 200.4, 210.3] markline: {data: [{type: 'average', Name: 'average'}] },{ name: 'Japan-China Military overput', type: 'line', yaxisindex: 1, data: [2.0, 2.005, 3.5, 4.03, 1.462, 2.245, 3.184, 1.383, 3.830, 4.094, 5.49, 3.62]}) ;});
Other content will be shared next time. Thank you! This week, we will write it here first.