Answer the question
In order to leave comments, you need to log in
Why did the graph stop displaying after rounding?
Hello.
I am preparing an array of data for the KPI chart
data preparation function
function culcJson() {
var jsonObj = ${json_text};
var newJSON=[];
var KPI=[];
var jsonResult = [];
var a = 0;
do {
var value=jsonObj.SucceededCount[a].SucceededCount_MEAS_VALUE/(jsonObj.SucceededCount[a].SucceededCount_MEAS_VALUE+jsonObj.FailedCount[a].FailedCount_MEAS_VALUE)*100;
KPI.push(value);
a += 1;
} while (a < jsonObj.FailedCount.length)
return KPI;
}
$(function () {
var KPI=[];
var jsonObj = ${json_text};
if (jsonObj!=null){KPI=culcJson();}
$('#container4').highcharts({
chart: {
zoomType: 'x'
},
title: {
text: '${TITLE}'
},
xAxis: {
categories: [<c:forEach var="row" items="${SCRIPT_FailedCount.rows}">"${row.DATE__CURRENT__CHECK}",</c:forEach>]
},
yAxis: {
title: {
text: ''
}
},
plotOptions: {
area: {
fillColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: {
radius: 2
},
lineWidth: 1,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
},
series: [
{
name: 'KPI',
data: KPI
}
]
});
});
KPI.push(value.toFixed(2));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question