data-for-change / anyway

ANYWAY - Car accidents map
http://www.anyway.co.il
MIT License
77 stars 242 forks source link

EURO DEMO severe\fatal bicycle\scooter involvers (group_bar+line) #1555

Open yuvalbar23 opened 3 years ago

yuvalbar23 commented 3 years ago

Bar chart JSON: { "name": "severe_bicycle_scooter_bar", "data": { "items": [ { "accident_year": 2008, "type": "אופניים", "involvers": 7 }, { "accident_year": 2009, "type": "אופניים", "involvers": 13 }, { "accident_year": 2010, "type": "אופניים", "involvers": 9 }, { "accident_year": 2011, "type": "אופניים", "involvers": 9 }, { "accident_year": 2012, "type": "אופניים", "involvers": 23 }, { "accident_year": 2013, "type": "אופניים", "involvers": 16 }, { "accident_year": 2014, "type": "אופניים", "involvers": 14 }, { "accident_year": 2014, "type": "אופניים חשמליים", "involvers": 4 }, { "accident_year": 2014, "type": "קורקינט חשמלי", "involvers": 2 }, { "accident_year": 2015, "type": "אופניים", "involvers": 11 }, { "accident_year": 2015, "type": "אופניים חשמליים", "involvers": 13 }, { "accident_year": 2016, "type": "אופניים", "involvers": 26 }, { "accident_year": 2016, "type": "אופניים חשמליים", "involvers": 19 }, { "accident_year": 2016, "type": "קורקינט חשמלי", "involvers": 4 }, { "accident_year": 2017, "type": "אופניים", "involvers": 15 }, { "accident_year": 2017, "type": "אופניים חשמליים", "involvers": 19 }, { "accident_year": 2017, "type": "קורקינט חשמלי", "involvers": 2 }, { "accident_year": 2018, "type": "אופניים", "involvers": 14 }, { "accident_year": 2018, "type": "אופניים חשמליים", "involvers": 22 }, { "accident_year": 2018, "type": "קורקינט חשמלי", "involvers": 10 }, { "accident_year": 2019, "type": "אופניים", "involvers": 15 }, { "accident_year": 2019, "type": "אופניים חשמליים", "involvers": 21 }, { "accident_year": 2019, "type": "קורקינט חשמלי", "involvers": 19 } ] } }

Line chart

JSON: { "name": "severe_bicycle_scooter_line", "data": { "items": [ { "accident_year": 2008, "involvers": 7 }, { "accident_year": 2009, "involvers": 13 }, { "accident_year": 2010, "involvers": 9 }, { "accident_year": 2011, "involvers": 9 }, { "accident_year": 2012, "involvers": 23 }, { "accident_year": 2013, "involvers": 16 }, { "accident_year": 2014, "involvers": 20 }, { "accident_year": 2015, "involvers": 24 }, { "accident_year": 2016, "involvers": 49 }, { "accident_year": 2017, "involvers": 36 }, { "accident_year": 2018, "involvers": 46 }, { "accident_year": 2019, "involvers": 55 } ] } }

image

galraij commented 3 years ago

to complex to show, I think it would be better to show stacked bar chart, it will also serve the idea of showing the combined number which is showed here by the regression line. stacked-bar-example-1

yuvalbar23 commented 3 years ago

But then you can't notice the trend for each group. for example, in my chart, you can easily notice a decrease in regular bicycles and an increase in e-bikes and scooters. with stacked bar chart it will be possible to easily notice a trend for only the bottom group and for all groups together.

I'll add stacked bar chart so you could choose which one you want.

atalyaalon commented 3 years ago

I agree with @yuvalbar23 - it should either be 3 different graphs - or non-stack graph with colors the way he created OR sum them all. We can also create a few different infographics - one which is the stack bar for all, and others which are unique for each type including it's regression line @galraij @MichalOren any thoughts?

We need to remember we're creating infographics for the public, and not for Data Analysts or Data Scientists, so we do need to look carefully at each infographics and make sure that it's clear.

MichalOren commented 3 years ago

I support the idea of each type individually. And if to unite something then electric tool( scooter and bike). regular bikes display separately.

atalyaalon commented 3 years ago

Thank you @MichalOren! @yuvalbar23 any thoughts?

yuvalbar23 commented 3 years ago

LMK what you think

Line stacked bar category bar

atalyaalon commented 3 years ago

@yuvalbar23 the 3 look very good - I suggest adding the 3 graphs as 3 different widgets. @galraij @MichalOren any thoughts?

atalyaalon commented 3 years ago

@MichalOren can you open Widgets for the above 3 graphs?

yuvalbar23 commented 3 years ago

SQL query for line chart

SQL query for stacked bar chart

SQL query for e-bikes bar chart