We find the data feed, and it is composed of nested objects. We'll need to manipulate the remote data quite a bit to get it in the format we need. We achieve this by executing the following steps:
We start by including the
donutRenderer
plugin file. With donut charts, we can useseriesColors
for each ring, so we createarrSeriesColors
to store the colors of our outer rings. Then, we createinnerRingColors
to hold the matching colors for our inner ring wedges:<script src="../js/jqplot.donutRenderer.min.js"></script> <script src="../js/functions.js"></script> <script> var arrSeriesColors = "#4bb2c5", "#F4CA4A", "#EAA228", "#E4CAAB", "#00CC55", "#AED8D0", "#F2C185"]; var innerRingColors = [];
Next, we create our function to parse our remote data. Since we have multiple levels in our JSON, we decide to store the
browsers
andversions
objects in variables to make our code a little easier to read. We pass the browser...