Advertisement
hivefans

echarts-map-timeline

May 18th, 2017
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function randomData() {
  2.     return Math.round(Math.random()*500);
  3. }
  4.  
  5. var option=new Array();
  6. for (var i=0;i<3;i++){
  7. option.push(
  8. {"series": [{
  9. "data":new Array(),
  10.             "label": {
  11.                 "emphasis": {
  12.                     "show": true
  13.                 },
  14.                 "normal": {
  15.                     "show": true
  16.                 }
  17.             },
  18.             "mapType": "china",
  19.             "roam": false,
  20.             "type": "map"
  21.            }],
  22.            
  23.         visualMap: {
  24.         min: 0,
  25.         max: 500,
  26.         left: 'right',
  27.         top: 'bottom',
  28.         text: ['高','低'],           // 文本,默认为数值文本
  29.         calculable: true,
  30.         inRange: {
  31.                 color: ['#0ba800','#eac736','#d94e5d']
  32.             }
  33.     }
  34.       }
  35.  );
  36. }
  37. for(var j=0;j<option.length;j++){
  38.   for(var m=0;m<10;m++){
  39.      option[j].series[0].data.push(
  40.       {
  41.         name:'北京',
  42.         value:randomData()
  43.        }
  44.      );
  45.   }
  46. }
  47.  
  48. for(var i=0;i<3;i++){
  49.    for(var m=0;m<10;m++){
  50.      document.write(option[i].series[0].data[m].value+"<br/>")
  51.    }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement