diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-05-16 17:48:22 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-05-16 17:48:22 +0100 |
commit | 665bf3fe78aa28f91090783d35db3666e10258a8 (patch) | |
tree | 9b0d9e2fda9f41067bcafa36b9468f1a2bda9588 /src/static | |
parent | 953dc5ef8652a0b7e8ae2c7db3535f1bd157cdd4 (diff) | |
download | UKGenderPayGap-665bf3fe78aa28f91090783d35db3666e10258a8.tar.gz UKGenderPayGap-665bf3fe78aa28f91090783d35db3666e10258a8.zip |
Added company size visualization backend
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/scripts.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/static/scripts.js b/src/static/scripts.js index 9b52215..dd57c39 100644 --- a/src/static/scripts.js +++ b/src/static/scripts.js @@ -11,7 +11,8 @@ function collapseTogglePress(elem, a_elem, num_hidden) { const PLOT_FUNC_MAPPINGS = { "years": draw_plot_years, "sic_sec": draw_plot_sic_sections, - "heatmap": draw_heatmap + "heatmap": draw_heatmap, + "size": draw_plot_size, } $(document).ready(function() { @@ -258,11 +259,11 @@ function draw_heatmap(containerName, filters) { data.forEach(row => { data2.push([row[0], row[2]]); }); - console.log(data2); + // console.log(data2); $.getJSON("/static/ukcounties.json", function(geojson) { - console.log(geojson); + // console.log(geojson); Highcharts.mapChart(containerName, { chart: { @@ -316,4 +317,23 @@ function draw_heatmap(containerName, filters) { }); }); }) +} + + +function draw_plot_size(containerName, filters) { + fetch(form_api_url(containerName, filters)).then(resp => { + resp.json().then((data) => { + console.log(data); + + Highcharts.chart(containerName, { + chart: { + type: 'column' + }, + + title: { + text: null + }, + }); + }); + }) }
\ No newline at end of file |