index.htm 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Highcharts Example</title>
  7. <style type="text/css">
  8. #container {
  9. min-width: 360px;
  10. max-width: 650px;
  11. margin: 0 auto;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <script src="../../code/highcharts.js"></script>
  17. <script src="../../code/modules/heatmap.js"></script>
  18. <script src="../../code/modules/tilemap.js"></script>
  19. <script src="../../code/modules/exporting.js"></script>
  20. <div id="container"></div>
  21. <script type="text/javascript">
  22. Highcharts.chart('container', {
  23. chart: {
  24. type: 'tilemap',
  25. inverted: true,
  26. height: '80%'
  27. },
  28. title: {
  29. text: 'U.S. states by population in 2016'
  30. },
  31. subtitle: {
  32. text: 'Source:<a href="https://simple.wikipedia.org/wiki/List_of_U.S._states_by_population">Wikipedia</a>'
  33. },
  34. xAxis: {
  35. visible: false
  36. },
  37. yAxis: {
  38. visible: false
  39. },
  40. colorAxis: {
  41. dataClasses: [{
  42. from: 0,
  43. to: 1000000,
  44. color: '#F9EDB3',
  45. name: '< 1M'
  46. }, {
  47. from: 1000000,
  48. to: 5000000,
  49. color: '#FFC428',
  50. name: '1M - 5M'
  51. }, {
  52. from: 5000000,
  53. to: 20000000,
  54. color: '#FF7987',
  55. name: '5M - 20M'
  56. }, {
  57. from: 20000000,
  58. color: '#FF2371',
  59. name: '> 20M'
  60. }]
  61. },
  62. tooltip: {
  63. headerFormat: '',
  64. pointFormat: 'The population of <b> {point.name}</b> is <b>{point.value}</b>'
  65. },
  66. plotOptions: {
  67. series: {
  68. dataLabels: {
  69. enabled: true,
  70. format: '{point.hc-a2}',
  71. color: '#000000',
  72. style: {
  73. textOutline: false
  74. }
  75. }
  76. }
  77. },
  78. series: [{
  79. name: '',
  80. data: [{
  81. 'hc-a2': 'AL',
  82. name: 'Alabama',
  83. region: 'South',
  84. x: 6,
  85. y: 7,
  86. value: 4849377
  87. }, {
  88. 'hc-a2': 'AK',
  89. name: 'Alaska',
  90. region: 'West',
  91. x: 0,
  92. y: 0,
  93. value: 737732
  94. }, {
  95. 'hc-a2': 'AZ',
  96. name: 'Arizona',
  97. region: 'West',
  98. x: 5,
  99. y: 3,
  100. value: 6745408
  101. }, {
  102. 'hc-a2': 'AR',
  103. name: 'Arkansas',
  104. region: 'South',
  105. x: 5,
  106. y: 6,
  107. value: 2994079
  108. }, {
  109. 'hc-a2': 'CA',
  110. name: 'California',
  111. region: 'West',
  112. x: 5,
  113. y: 2,
  114. value: 39250017
  115. }, {
  116. 'hc-a2': 'CO',
  117. name: 'Colorado',
  118. region: 'West',
  119. x: 4,
  120. y: 3,
  121. value: 5540545
  122. }, {
  123. 'hc-a2': 'CT',
  124. name: 'Connecticut',
  125. region: 'Northeast',
  126. x: 3,
  127. y: 11,
  128. value: 3596677
  129. }, {
  130. 'hc-a2': 'DE',
  131. name: 'Delaware',
  132. region: 'South',
  133. x: 4,
  134. y: 9,
  135. value: 935614
  136. }, {
  137. 'hc-a2': 'DC',
  138. name: 'District of Columbia',
  139. region: 'South',
  140. x: 4,
  141. y: 10,
  142. value: 7288000
  143. }, {
  144. 'hc-a2': 'FL',
  145. name: 'Florida',
  146. region: 'South',
  147. x: 8,
  148. y: 8,
  149. value: 20612439
  150. }, {
  151. 'hc-a2': 'GA',
  152. name: 'Georgia',
  153. region: 'South',
  154. x: 7,
  155. y: 8,
  156. value: 10310371
  157. }, {
  158. 'hc-a2': 'HI',
  159. name: 'Hawaii',
  160. region: 'West',
  161. x: 8,
  162. y: 0,
  163. value: 1419561
  164. }, {
  165. 'hc-a2': 'ID',
  166. name: 'Idaho',
  167. region: 'West',
  168. x: 3,
  169. y: 2,
  170. value: 1634464
  171. }, {
  172. 'hc-a2': 'IL',
  173. name: 'Illinois',
  174. region: 'Midwest',
  175. x: 3,
  176. y: 6,
  177. value: 12801539
  178. }, {
  179. 'hc-a2': 'IN',
  180. name: 'Indiana',
  181. region: 'Midwest',
  182. x: 3,
  183. y: 7,
  184. value: 6596855
  185. }, {
  186. 'hc-a2': 'IA',
  187. name: 'Iowa',
  188. region: 'Midwest',
  189. x: 3,
  190. y: 5,
  191. value: 3107126
  192. }, {
  193. 'hc-a2': 'KS',
  194. name: 'Kansas',
  195. region: 'Midwest',
  196. x: 5,
  197. y: 5,
  198. value: 2904021
  199. }, {
  200. 'hc-a2': 'KY',
  201. name: 'Kentucky',
  202. region: 'South',
  203. x: 4,
  204. y: 6,
  205. value: 4413457
  206. }, {
  207. 'hc-a2': 'LA',
  208. name: 'Louisiana',
  209. region: 'South',
  210. x: 6,
  211. y: 5,
  212. value: 4649676
  213. }, {
  214. 'hc-a2': 'ME',
  215. name: 'Maine',
  216. region: 'Northeast',
  217. x: 0,
  218. y: 11,
  219. value: 1330089
  220. }, {
  221. 'hc-a2': 'MD',
  222. name: 'Maryland',
  223. region: 'South',
  224. x: 4,
  225. y: 8,
  226. value: 6016447
  227. }, {
  228. 'hc-a2': 'MA',
  229. name: 'Massachusetts',
  230. region: 'Northeast',
  231. x: 2,
  232. y: 10,
  233. value: 6811779
  234. }, {
  235. 'hc-a2': 'MI',
  236. name: 'Michigan',
  237. region: 'Midwest',
  238. x: 2,
  239. y: 7,
  240. value: 9928301
  241. }, {
  242. 'hc-a2': 'MN',
  243. name: 'Minnesota',
  244. region: 'Midwest',
  245. x: 2,
  246. y: 4,
  247. value: 5519952
  248. }, {
  249. 'hc-a2': 'MS',
  250. name: 'Mississippi',
  251. region: 'South',
  252. x: 6,
  253. y: 6,
  254. value: 2984926
  255. }, {
  256. 'hc-a2': 'MO',
  257. name: 'Missouri',
  258. region: 'Midwest',
  259. x: 4,
  260. y: 5,
  261. value: 6093000
  262. }, {
  263. 'hc-a2': 'MT',
  264. name: 'Montana',
  265. region: 'West',
  266. x: 2,
  267. y: 2,
  268. value: 1023579
  269. }, {
  270. 'hc-a2': 'NE',
  271. name: 'Nebraska',
  272. region: 'Midwest',
  273. x: 4,
  274. y: 4,
  275. value: 1881503
  276. }, {
  277. 'hc-a2': 'NV',
  278. name: 'Nevada',
  279. region: 'West',
  280. x: 4,
  281. y: 2,
  282. value: 2839099
  283. }, {
  284. 'hc-a2': 'NH',
  285. name: 'New Hampshire',
  286. region: 'Northeast',
  287. x: 1,
  288. y: 11,
  289. value: 1326813
  290. }, {
  291. 'hc-a2': 'NJ',
  292. name: 'New Jersey',
  293. region: 'Northeast',
  294. x: 3,
  295. y: 10,
  296. value: 8944469
  297. }, {
  298. 'hc-a2': 'NM',
  299. name: 'New Mexico',
  300. region: 'West',
  301. x: 6,
  302. y: 3,
  303. value: 2085572
  304. }, {
  305. 'hc-a2': 'NY',
  306. name: 'New York',
  307. region: 'Northeast',
  308. x: 2,
  309. y: 9,
  310. value: 19745289
  311. }, {
  312. 'hc-a2': 'NC',
  313. name: 'North Carolina',
  314. region: 'South',
  315. x: 5,
  316. y: 9,
  317. value: 10146788
  318. }, {
  319. 'hc-a2': 'ND',
  320. name: 'North Dakota',
  321. region: 'Midwest',
  322. x: 2,
  323. y: 3,
  324. value: 739482
  325. }, {
  326. 'hc-a2': 'OH',
  327. name: 'Ohio',
  328. region: 'Midwest',
  329. x: 3,
  330. y: 8,
  331. value: 11614373
  332. }, {
  333. 'hc-a2': 'OK',
  334. name: 'Oklahoma',
  335. region: 'South',
  336. x: 6,
  337. y: 4,
  338. value: 3878051
  339. }, {
  340. 'hc-a2': 'OR',
  341. name: 'Oregon',
  342. region: 'West',
  343. x: 4,
  344. y: 1,
  345. value: 3970239
  346. }, {
  347. 'hc-a2': 'PA',
  348. name: 'Pennsylvania',
  349. region: 'Northeast',
  350. x: 3,
  351. y: 9,
  352. value: 12784227
  353. }, {
  354. 'hc-a2': 'RI',
  355. name: 'Rhode Island',
  356. region: 'Northeast',
  357. x: 2,
  358. y: 11,
  359. value: 1055173
  360. }, {
  361. 'hc-a2': 'SC',
  362. name: 'South Carolina',
  363. region: 'South',
  364. x: 6,
  365. y: 8,
  366. value: 4832482
  367. }, {
  368. 'hc-a2': 'SD',
  369. name: 'South Dakota',
  370. region: 'Midwest',
  371. x: 3,
  372. y: 4,
  373. value: 853175
  374. }, {
  375. 'hc-a2': 'TN',
  376. name: 'Tennessee',
  377. region: 'South',
  378. x: 5,
  379. y: 7,
  380. value: 6651194
  381. }, {
  382. 'hc-a2': 'TX',
  383. name: 'Texas',
  384. region: 'South',
  385. x: 7,
  386. y: 4,
  387. value: 27862596
  388. }, {
  389. 'hc-a2': 'UT',
  390. name: 'Utah',
  391. region: 'West',
  392. x: 5,
  393. y: 4,
  394. value: 2942902
  395. }, {
  396. 'hc-a2': 'VT',
  397. name: 'Vermont',
  398. region: 'Northeast',
  399. x: 1,
  400. y: 10,
  401. value: 626011
  402. }, {
  403. 'hc-a2': 'VA',
  404. name: 'Virginia',
  405. region: 'South',
  406. x: 5,
  407. y: 8,
  408. value: 8411808
  409. }, {
  410. 'hc-a2': 'WA',
  411. name: 'Washington',
  412. region: 'West',
  413. x: 2,
  414. y: 1,
  415. value: 7288000
  416. }, {
  417. 'hc-a2': 'WV',
  418. name: 'West Virginia',
  419. region: 'South',
  420. x: 4,
  421. y: 7,
  422. value: 1850326
  423. }, {
  424. 'hc-a2': 'WI',
  425. name: 'Wisconsin',
  426. region: 'Midwest',
  427. x: 2,
  428. y: 5,
  429. value: 5778708
  430. }, {
  431. 'hc-a2': 'WY',
  432. name: 'Wyoming',
  433. region: 'West',
  434. x: 3,
  435. y: 3,
  436. value: 584153
  437. }]
  438. }]
  439. });
  440. </script>
  441. </body>
  442. </html>