Institute PDCI chart
The Institue details statisticsPDCI
contains information to render the histogram:
Extend Institue Display page with the PDCI section as shown above.
Render this section only if data is provided.
From JSP
Snippet of code that renders the current histogram in JSP is below. The data
parameter for the chart is sourced from statisticsPDCI.histogram
:
// histogram = [0, 0, 0, 0, 0, 0, 0, 34, 45, 234, 444, 272, 103, 204, 44, 751, 1465, 35, 647, 0, 0]
// Histogram contains 21 values from '0.0' to '10.0' at '0.5' intervals:
const data: object[];
// I guess this would do it:
for (let x = 0; x <= 10; x += 0.5) {
data.push([ `${x}`, histogram[x * 2] ]);
}
// use data to render histogram
function(placeholder, data) {
$.plot(placeholder, [ {
data : data,
color : '#88ba42'
} ], {
series : {
bars : {
show : true,
barWidth : 0.4,
fill : 1,
lineWidth : 0,
align : 'center'
}
},
xaxis : {
tickLength : 0
}
});
}