Make Campaign Results Pie Chart Consistent with Dashboard (#1272)

pull/1323/head
Jordan Wright 2018-11-11 15:37:49 -06:00 committed by GitHub
parent 7fd0657a91
commit 3b248d25c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -518,7 +518,7 @@ var renderPieChart = function (chartopts) {
pie = chart.series[0],
left = chart.plotLeft + pie.center[0],
top = chart.plotTop + pie.center[1];
this.innerText = rend.text(chartopts['data'][0].y, left, top).
this.innerText = rend.text(chartopts['data'][0].count, left, top).
attr({
'text-anchor': 'middle',
'font-size': '24px',
@ -529,7 +529,7 @@ var renderPieChart = function (chartopts) {
},
render: function () {
this.innerText.attr({
text: chartopts['data'][0].y
text: chartopts['data'][0].count
})
}
}
@ -553,7 +553,7 @@ var renderPieChart = function (chartopts) {
if (this.key == undefined) {
return false
}
return '<span style="color:' + this.color + '">\u25CF</span>' + this.point.name + ': <b>' + this.y + '</b><br/>'
return '<span style="color:' + this.color + '">\u25CF</span>' + this.point.name + ': <b>' + this.y + '%</b><br/>'
}
},
series: [{
@ -677,11 +677,12 @@ function poll() {
}
email_data.push({
name: status,
y: count
y: Math.floor((count / campaign.results.length) * 100),
count: count
})
email_data.push({
name: '',
y: campaign.results.length - count
y: 100 - Math.floor((count / campaign.results.length) * 100)
})
var chart = $("#" + statusMapping[status] + "_chart").highcharts()
chart.series[0].update({
@ -862,11 +863,12 @@ function load() {
}
email_data.push({
name: status,
y: count
y: Math.floor((count / campaign.results.length) * 100),
count: count
})
email_data.push({
name: '',
y: campaign.results.length - count
y: 100 - Math.floor((count / campaign.results.length) * 100)
})
var chart = renderPieChart({
elemId: statusMapping[status] + '_chart',