StarterCode/assets/js/app.js
// Function used for updating x-scale variable upon click on axis label.
Function used for updating x-scale variable upon click on axis label.
Function used for updating x - scale variable upon click on axis label .
function xScale(data, chosenXAxis) {
    var xLinearScale = d3.scaleLinear()
        .domain([d3.min(data, d => d[chosenXAxis]) * 0.8,
             d3.max(data, d => d[chosenXAxis]) * 1.2
        ])
        .range([0, width]);
    return xLinearScale;
}
function xScale ( data , chosenXAxis ) { var xLinearScale = d3 . scaleLinear ( ) . domain ( [ d3 . min ( data , d => d [ chosenXAxis ] ) * 0.8 , d3 . max ( data , d => d [ chosenXAxis ] ) * 1.2 ] ) . range ( [ 0 , width ] ) ; return xLinearScale ; }
Function used for updating x-scale variable upon click on axis label.
Function used for updating x - scale variable upon click on axis label .
// Create Scales.