This is a simple widget that lets you render pie charts in Dashing. It looks a little bit like this:
dashboard.erb:
<li data-row="2" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="links" data-view="Pie" data-title="Managed Links"></div>
</li>my_job.rb:
link_data = {}
link_types = ["Wired","Wireless","Wifi"]
SCHEDULER.every '2s' do
one = rand
two = ((1-one) * rand)
three = 1 - one - two
values = [one, two, three]
link_types.each_with_index do |link, i|
link_data[link] = { label: link, value: values[i]*100 }
end
send_event 'links', { value: link_data.values }
endI hope you like it! If you have any questions/comments feel free to contact me at about.me/Jon.Koehmstedt
