I hope you are good . I need to make a custom html for one volume to show pie chart for the percent used and the percent available of the volume as shown in the attachment .could you help me in this request ?
var swql=" select colum ,row from ( select n.VolumePercentUsed as x,n.VolumePercentAvailable as y ,n.VolumeID as s ,n.caption as r
FROM Orion.Volumes n
WHERE (VolumeID = 715 AND VolumeType LIKE 'fixed%')) g unpivot ( row from colum in [ x,y,s,r]) j' "
var params = JSON.stringify({
query: swql,
parameters: {
}
});
$.ajax({
type: 'POST',
url: '/Orion/Services/Information.asmx/QueryWithParameters',
data: params,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
var i;
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'r'});
dataTable.addColumn({ type: 'number', id: 'x' });
dataTable.addColumn({ type: 'number', id: 'y' });
for(var i=0; i < response.d.Rows.length; i++){
var row = [response.d.Rows[i][0],response.d.Rows[i][1]];
dataTable.addRow(row);
}
var chart = new google.visualization.PieChart(document.getElementById('VOLUME'));
var options = {
title: 'VOLUME',
colorAxis: {colors:['#86ce76','#d61007']},
legend: {position: 'right'},
tooltip: {trigger: 'selection'},
chartArea:{left:2,top:2,width:500,height:500},
};
chart.draw(dataTable, options);
}
}
})