aboutsummaryrefslogtreecommitdiffstats
path: root/src/static/scripts.js
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-05-16 17:48:22 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-05-16 17:48:22 +0100
commit665bf3fe78aa28f91090783d35db3666e10258a8 (patch)
tree9b0d9e2fda9f41067bcafa36b9468f1a2bda9588 /src/static/scripts.js
parent953dc5ef8652a0b7e8ae2c7db3535f1bd157cdd4 (diff)
downloadUKGenderPayGap-665bf3fe78aa28f91090783d35db3666e10258a8.tar.gz
UKGenderPayGap-665bf3fe78aa28f91090783d35db3666e10258a8.zip
Added company size visualization backend
Diffstat (limited to 'src/static/scripts.js')
-rw-r--r--src/static/scripts.js26
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