map-and-chart.js
// Update Chart based on Click event listener
Update Chart based on Click event listener
Update Chart based on Click event listener
function selectData(e) {
    map.fitBounds(e.target.getBounds());
    var data = e.target;
    chart.data.datasets[1].label = data.feature.properties["AREA_ID"];
    chart.data.datasets[1].data[0] = data.feature.properties["AREA_NAME"];
    chart.data.datasets[1].data[1] = data.feature.properties["AREA_DESC"];
    chart.data.datasets[1].data[2] = data.feature.properties["X"];
    chart.data.datasets[1].data[3] = data.feature.properties["Y"];
    chart.data.datasets[1].data[4] = data.feature.properties["LONGITUDE"];
    chart.data.datasets[1].data[5] = data.feature.properties["LATITUDE"];
    chart.data.datasets[1].data[6] = data.feature.properties["OBJECTID"];
    chart.data.datasets[1].data[7] = data.feature.properties["Shape__Area"];
    chart.data.datasets[1].data[8] = data.feature.properties["Shape__Length"];
    chart.update();
}
function selectData ( e ) { map . fitBounds ( e . target . getBounds ( ) ) ; var data = e . target ; chart . data . datasets [ 1 ] . label = data . feature . properties [ "AREA_ID" ] ; chart . data . datasets [ 1 ] . data [ 0 ] = data . feature . properties [ "AREA_NAME" ] ; chart . data . datasets [ 1 ] . data [ 1 ] = data . feature . properties [ "AREA_DESC" ] ; chart . data . datasets [ 1 ] . data [ 2 ] = data . feature . properties [ "X" ] ; chart . data . datasets [ 1 ] . data [ 3 ] = data . feature . properties [ "Y" ] ; chart . data . datasets [ 1 ] . data [ 4 ] = data . feature . properties [ "LONGITUDE" ] ; chart . data . datasets [ 1 ] . data [ 5 ] = data . feature . properties [ "LATITUDE" ] ; chart . data . datasets [ 1 ] . data [ 6 ] = data . feature . properties [ "OBJECTID" ] ; chart . data . datasets [ 1 ] . data [ 7 ] = data . feature . properties [ "Shape__Area" ] ; chart . data . datasets [ 1 ] . data [ 8 ] = data . feature . properties [ "Shape__Length" ] ; chart . update ( ) ; }
Update Chart based on Click event listener
Update Chart based on Click event listener
// Click to Zoom into the map area // Select dataset to display based on clicked area //Of the two CityAverage datasets, update second one