June 2017
Beginner to intermediate
368 pages
8h 31m
English
The final step in this section is to allow the user to click on a chart segment to take them to the relevant activity. To achieve this, we need to cache the activity URLs. Add a new links array variable to the closure as follows:
define(['jquery'], function($) { var links = []; var t = { ...
Next, find the for loop code that extracts each activity's label and status and add in a line to cache that activity's URL:
for (var i = 0; i < array_len; i++) { labels.push(completion_data.activities[i].name); // Note that the pie chart segments will all be the same size data.push('1'); links.push(completion_data.activities[i].link); var status = completion_data.activities[i].status; ...
Finally, we can use jQuery ...
Read now
Unlock full access