I do not really know how to code. I am primarily a policy analyst who just loves data. I have been having trouble getting the demo version of a Divergent Stacked Bar Chart to render using the Amcharts plugin. My googling led me to this simple answer on StackOverflow regarding D3. I tried it with a D3 demo. It worked! First, try. I tried it with Amcharts. Once I got the file saved properly (I am missing something when combining all the pieces that I still have not yet figured out), it worked! So even if I do not know what is wrong with the Amcharts plugin for some of these types of charts, I can make it work. It takes longer and it is harder to debug, but if I want to do it I can.

Here is the code I used. Just change the URL to the URL of the code that you uploaded to your media section of the WordPress site.

`<iframe
  style="border: 0px;"
  src="www.yourwebsite.com/wp-content/uploads/2015/11/d3page.html"
  scrolling="no"
  width="100%"
  height="500px">
</iframe>`

Here is the graph. I used the 2019 Maryland Comprehensive Assessment Program (MCAP) data from 2019.

As I was working on trying to figure out how to make this graph render I read that is controversial and is not considered a good way to visualize data. But by that point, I was too far in. I wanted to see how it looked and judge for myself. I have not made any conclusions about the data or the visualization yet. I am just happy I figured out how to make the code work. This experience also means I will be able to try out D3 visualizations, which is a whole other rabbit hole. Enough explanation. I am going to test this webpage and take it live. The analysis is for another day.

Sources: Maryland State Department of Education, MCAP ELA and Math Performance Data.

1 thought on “Divergent Stacked Bars Using AmCharts

  1. Pingback: Split bar chart

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>