在为对象的每次点击分配值时,图表不起作用

时间:2019-05-16 07:43:49

标签: php graph charts jscript

map.on('click', 'off-leash-areas', function (e) { var coordinates = 
e.features[0].geometry.coordinates.slice(); var description =   
e.features[0].properties.compname; var inpormasyon =   
e.features[0].properties.inpormasyon; var datapogi =   
e.features[0].properties.datapogi;     
 document.getElementById('features').innerHTML = '<br /><br   
 /><b><input name="station" id="station"   
 value="'+description+'"/></b><br />'+inpormasyon+'Chart <div   
 id="container"></div>'; var chart =   
 anychart.column(datapogi);//--->this one is not changing the values,  
 cant interpret the new value assigned.

        chart.title(datapogi);//but this line appeared instantly on the graph
        chart.container("container").draw(chart);
        while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {    coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360; }
        new mapboxgl.Popup() .setLngLat(coordinates)    .setHTML('<strong>'+description+'</strong><br />'+inpormasyon)   
 .addTo(map);
        });

        // Change the cursor to a pointer when the mouse is over the places    layer. map.on('mouseenter', 'places', function () {   
 map.getCanvas().style.cursor = 'pointer'; });  
        map.on('mouseleave', 'places', function () {    map.getCanvas().style.cursor = '';
        });
        });


        map.on('click', 'off-leash-areas', function (e) {
        var coordinates = e.features[0].geometry.coordinates.slice(); var    description = e.features[0].properties.compname; var
 inpormasyon =    e.features[0].properties.inpormasyon; var datapogi = 
 e.features[0].properties.datapogi;     
 document.getElementById('features').innerHTML = '<br /><br   
 /><b><input name="station" id="station"   
 value="'+description+'"/></b><br />'+inpormasyon+'Chart <div   
 id="container"></div>'; var chart = anychart.column(datapogi);
        chart.title(datapogi);
        chart.container("container").draw(chart);

如果单击该测站,则该测站的属性值应该显示在图形中,但没有条形图出现。

0 个答案:

没有答案