-#define HTML_TEMPLATE \
-"<html>\n\
- <head>\n\
- <script type='text/javascript'\
- src='https://www.google.com/jsapi'></script>\n\
- <script type='text/javascript'>\n\
- google.load('visualization', '1', {packages:['corechart']});\
- google.setOnLoadCallback(drawChart);\n\
- function drawChart() {\n\
- var data = new google.visualization.DataTable();\n\
- data.addColumn('string', 'Date');\n\
-%s\
- data.addRows(%s);\n\
- data.sort(0);\n\
- var chart = new google.visualization.LineChart\
- (document.getElementById('chart_div'));\n\
- chart.draw(data, {width: 1024, height: 768,\
- title: 'PPA Statistics'});\n\
- }\n\
- </script>\n\
- </head>\n\
-\n\
- <body>\n\
- <div id='chart_div'></div>\n\
- </body>\n\
-</html>\n"
-
-static json_object *
-get_count_array(json_object *data, const char *date)
-{
- int n, i;
- json_object *o, *o_date;
- const char *date2;
-
- n = json_object_array_length(data);
- for (i = 0; i < n; i++) {
- o = json_object_array_get_idx(data, i);
- o_date = json_object_array_get_idx(o, 0);
- date2 = json_object_get_string(o_date);
-
- if (!strcmp(date2, date))
- return o;
- }
-
- return NULL;
-}
-
-static json_object *count_array_new(json_object *data, const char *d, int n)
-{
- json_object *result = json_object_new_array();
- int i;
-
- json_object_array_add(result, json_object_new_string(d));
-
- for (i = 0; i < n; i++)
- json_object_array_add(result, json_object_new_int(0));
-
- json_object_array_add(data, result);
-
- return result;
-}
-
-static char *
-build_package_display_name(struct binary_package_publishing_history *b)