banjtheman / defundthepolice

Defund The Police
Apache License 2.0
20 stars 30 forks source link

Create a Stacked Bar Chart Visualization #45

Closed banjtheman closed 4 years ago

banjtheman commented 4 years ago

What is the Task

Create a streamgraph for the data

Why do we want to do this

To have another viz

How can I get started?

  1. Add a new viz to https://github.com/banjtheman/defundthepolice/blob/main/apps/viz.py
  2. Here is an example code of a steam graph https://altair-viz.github.io/gallery/streamgraph.html

Definition of Done

Can select a streamgraph for the budget visualization

taratip commented 4 years ago

@banjtheman can I work on this issue?

taratip commented 4 years ago

I have a question regarding the graph. I understand that the y axis should be percent and it should show percent for each item in color. What would be the x axis?

banjtheman commented 4 years ago

Can use year

taratip commented 4 years ago

Currently there is only one year for each state so not sure how to plot it.

banjtheman commented 4 years ago

Good point lets pivot to a stacked bar chart

x-axis should be the sum of the percent y-axis should be the source and color should be the items

Example code https://altair-viz.github.io/gallery/horizontal_stacked_bar_chart.html

image