Actions
Feature #1278
closedHave pie chart graphs link to the hosts the slices represent
Description
Currently the pie graph reports do not link to anything. If you click on a slice it only 'pulls' it out from the rest of the pie to highlight it. What would be nice is some functionality to link to the hosts that the chart is representing, or at least provide links near the chart to be able to click on.
Example, if I have a chart generated with data such as:
"os_count":{"SLES 11.1":225,"SLES 10.4":36}
Then clicking on the slice for SLES 11.1 would bring up the hosts tab with all of those 225 systems.
Currently, I have hacked the following to achieve functionally what I want, but outside of the pie chart. In app/views/statistics/index.html.erb
<td> <%= pie_chart("os_dist" ,"OS Distribution", @os_count) %> <% @os_count.each do |os_dist,os_dist_count| -%> <% os_name, os_ver = os_dist.split(" ") -%> <%= link_to os_dist, "/hosts?search=facts.operatingsystem%3D#{os_name}+and+f acts.operatingsystemrelease%3D#{os_ver}" %>: <%= os_dist_count %> <% end -%> </td>
I'm sure there are better ways to achieve this, I'm just a novice coder. :P
Having this for all charts would be the ultimate goal.
Actions