I want to create few graphs like Top 25 vulnerability, top 20 vulnerable hosts, segregation of vulnerability on a particular host or OS. how can i write queries for this and achieve desired graphs (pie/bar)
I would look at the Dashboards available for import here:
Dashboards and Reporting Resources - Start Here
and then look at the examples provided in those dashboards widgets.
Retrieving data ...