长沙租房价格地图 (长沙租房价格趋势)

长沙耍耍 05-26 阅读:28 评论:0

图例

  • <1000元/月
  • 长沙租房价格地图 (长沙租房价格趋势)
  • 1000-1500元/月
  • 1500-2000元/月
  • 2000-2500元/月
  • >2500元/月

租房价格趋势

script.js javascript // 创建地图 var map = L.map('map').setView([28.2282, 112.9388], 11);// 加载瓦片 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{maxZoom: 19,attribution: '© OpenStreetMap contributors'} ).addTo(map);// 加载租房价格数据 $.getJSON('data.json', function(data) {// 创建图层组var markers = L.featureGroup();// 遍历数据$.each(data, function(index) {// 创建标记var marker = L.marker(data[index].location);// 设置标记图标marker.setIcon(L.icon({iconUrl: 'marker.png',iconSize: [25, 41],iconAnchor: [12, 41],popupAnchor: [0, -41]}));// 设置标记弹出框内容marker.bindPopup(` ${data[index].name}
租金:${data[index].price} 元/月`);// 添加标记到图层组markers.addLayer(marker);});// 添加图层组到地图map.addLayer(markers); });// 创建图表 var chart = c3.generate({bindto: 'chart',data: {x: 'x',columns: [['x', '2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],['租金', 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100]]},axis: {x: {type: 'timeseries',tick: {format: '%Y-%m'}}} });
版权声明

本文仅代表作者观点,不代表长沙桑拿立场。
本文系作者授权发表,未经许可,不得转载。