Pie chart
-
Hi
i want to find an easy and fast way to show a pie chart (or a 2d circular dashboard) for cpu usage in system information widget.
Can you help me?
Thanks in advance -
Look at Diagnostics > States Summary.
Though I think that pie chart code used Prototype and the GUI is almost all Jquery now, it should be easy to find one.
A pie chart for the CPU usage seems… odd. If you want to use multiple things for system/user/nice/etc then a stacked bar would make more sense to show the same thing in less area.
-
states summary doesn't have any charts…
that's right. pie chart is not appropriate.
it's better to create a widget like this for dashboard: -
Sorry not states summary, I forgot it's the firewall log summary. Status > System Logs, Firewall tab, summary view link.
I'm not too crazy about the speedometer view. It seems crowded/cluttered and hard to interpret. (and too large)
-
Thanks jim,
I have another question,
Why cpu usage is zero in system information widget? -
It is initialized to 0 and then updated by AJAX
-
Excuse me jim,
you didn't use cpu_usage() function in system_information.widget.php.How this code can update cpu usage?
var url = "/widgets/widgets/system_information.widget.php"; var pars = 'getupdatestatus=yes'; jQuery.ajax( url, { type: 'get', data: pars, complete: activitycallback });
-
https://github.com/pfsense/pfsense/blob/master/usr/local/www/javascript/index/ajax.js#L183
https://github.com/pfsense/pfsense/blob/master/usr/local/www/javascript/index/ajax.js#L8
https://github.com/pfsense/pfsense/blob/master/usr/local/www/includes/functions.inc.php#L13
-
You want a tool for creating 2D piecharts or dashboard charts which supports jquery,for this you should use Koolchart. Because it supports Javascript functionality and you can create any type of chart with it. Its really good as far as 2D charting is concerned.