Project

General

Profile

« Previous | Next » 

Revision 481aa701

Added by sbeaver about 10 years ago

diag_logs_filter_summary improved per SH

Thanks for the suggestion. Can’t believe I didn’t see that :(

View differences:

usr/local/www/diag_logs_filter_summary.php
109 109
// Todo: Be good to investigate building this with json_encode and friends some time
110 110
function pie_block($summary, $stat, $num, $chartnum) {
111 111
	global $fields, $segcolors, $gotlines, $numcolors;
112

  
113
	echo <<<PIEEND
112
?>
114 113
<script>
115
var pie = new d3pie("pieChart
116
PIEEND;
117
print($chartnum);
118
	echo <<<PIEEND2
119
", {
114
var pie = new d3pie("pieChart<?=$chartnum?>", {
120 115
	"header": {
121 116
		"title": {
122 117
			"text": "",
......
144 139
	"data": {
145 140
		"sortOrder": "value-desc",
146 141
		"content": [
147
PIEEND2;
148

  
142
<?php
149 143
	uasort($summary[$stat] , 'cmp');
150 144
	$k = array_keys($summary[$stat]);
151 145
	$total = 0;
......
177 171
		print(', "color": "' . $segcolors[$i % $numcolors] . '"');
178 172
		print("}");
179 173
	}
180

  
181
echo <<<PIEEND3
174
?>
182 175
		]
183 176
	},
184 177
	"labels": {
......
222 215
	"callbacks": {}
223 216
});
224 217
</script>
225

  
226
PIEEND3;
218
<?php
227 219
}
228 220

  
229 221
foreach ($filterlog as $fe) {

Also available in: Unified diff