function initializeCharts() {

        // define the parts of the axis that aren't dependent on width or height
        xScale = d3.time.scale()
            .domain(d3.extent(data, function (d) { return d.date; }));

        yScale = d3.scale.log()
            .domain([30, 420]);

        xScale2 = d3.time.scale()
            .domain(d3.extent(data, function (d) { return d.date; }));

        yScale2 = d3.scale.log()
            .domain([36, 420]);

        xAxis = d3.svg.axis()
            .scale(xScale)
            .ticks(4)
            .orient('top');

        yAxis = d3.svg.axis()
            .scale(yScale)
            .tickFormat(d3.format('d'))
            .tickValues([40, 60, 80, 120, 180, 300, 400])
            .orient('left');

        xAxis2 = d3.svg.axis()
            .scale(xScale2)
            .ticks(4)
            .orient('bottom');

        yAxis2 = d3.svg.axis()
            .scale(yScale2)
            .tickFormat(d3.format('d'))
            .tickValues([40, 60, 80, 120, 180, 300, 400])
            .orient('right');

        // setup a brush
        brush = d3.svg.brush()
            .x(xScale2)
            .on('brushstart', brushStarted)
            .on('brush', brushed)
            .on('brushend', brushEnded);

        updateChart(true);
    }
// initial setup of chart when data is first made available
initial setup of chart when data is first made available
initial setup of chart when data is first made available
function initializeCharts() {
        xScale = d3.time.scale()
            .domain(d3.extent(data, function (d) { return d.date; }));
        yScale = d3.scale.log()
            .domain([30, 420]);
        xScale2 = d3.time.scale()
            .domain(d3.extent(data, function (d) { return d.date; }));
        yScale2 = d3.scale.log()
            .domain([36, 420]);
        xAxis = d3.svg.axis()
            .scale(xScale)
            .ticks(4)
            .orient('top');
        yAxis = d3.svg.axis()
            .scale(yScale)
            .tickFormat(d3.format('d'))
            .tickValues([40, 60, 80, 120, 180, 300, 400])
            .orient('left');
        xAxis2 = d3.svg.axis()
            .scale(xScale2)
            .ticks(4)
            .orient('bottom');
        yAxis2 = d3.svg.axis()
            .scale(yScale2)
            .tickFormat(d3.format('d'))
            .tickValues([40, 60, 80, 120, 180, 300, 400])
            .orient('right');
        brush = d3.svg.brush()
            .x(xScale2)
            .on('brushstart', brushStarted)
            .on('brush', brushed)
            .on('brushend', brushEnded);
        updateChart(true);
    }
function initializeCharts ( ) { xScale = d3 . time . scale ( ) . domain ( d3 . extent ( data , function ( d ) { return d . date ; } ) ) ; yScale = d3 . scale . log ( ) . domain ( [ 30 , 420 ] ) ; xScale2 = d3 . time . scale ( ) . domain ( d3 . extent ( data , function ( d ) { return d . date ; } ) ) ; yScale2 = d3 . scale . log ( ) . domain ( [ 36 , 420 ] ) ; xAxis = d3 . svg . axis ( ) . scale ( xScale ) . ticks ( 4 ) . orient ( 'top' ) ; yAxis = d3 . svg . axis ( ) . scale ( yScale ) . tickFormat ( d3 . format ( 'd' ) ) . tickValues ( [ 40 , 60 , 80 , 120 , 180 , 300 , 400 ] ) . orient ( 'left' ) ; xAxis2 = d3 . svg . axis ( ) . scale ( xScale2 ) . ticks ( 4 ) . orient ( 'bottom' ) ; yAxis2 = d3 . svg . axis ( ) . scale ( yScale2 ) . tickFormat ( d3 . format ( 'd' ) ) . tickValues ( [ 40 , 60 , 80 , 120 , 180 , 300 , 400 ] ) . orient ( 'right' ) ; brush = d3 . svg . brush ( ) . x ( xScale2 ) . on ( 'brushstart' , brushStarted ) . on ( 'brush' , brushed ) . on ( 'brushend' , brushEnded ) ; updateChart ( true ) ; }
initial setup of chart when data is first made available
initial setup of chart when data is first made available
// define the parts of the axis that aren't dependent on width or height // setup a brush