var OnBeforeDrawingChart = function(sender, args) {
// Pie차트
if(args.Id === 'V1__CHT_LGSRFULXCCN7D4JA') {
//console.log(args);
var option = args.Option;
// 첫번째 계열의 데이터라벨 포맷을 변경한다.
option.series[0].dataLabels.formatter = function() {
//console.log(this);
var value = parseInt(this.y);
var percent = this.percentage.toFixed(2);
var color = this.color;
return '<span data-z-index="1" style="position: absolute; font-size: 11px; white-space: nowrap; color: rgb(0, 0, 0); font-weight: bold; margin-left: 0px; margin-top: 0px; left: 5px; top: 5px;"><div style="border-width: 2px; border-style: solid; border-color: ' + color + '; border-radius: 3px; padding: 2px; background-color: rgb(255, 255, 255); opacity: 0.8; color: rgb(0, 0, 0); font-size: 9px; font-style: normal; font-weight: normal;"><span style="color: rgb(0, 0, 0);">'
+ value + '</br>' + percent + '</span></div></span>';
}
// 차트의 툴팁 포맷을 변경한다.
option.tooltip.formatter = function() {
//console.log(this);
var value = parseInt(this.y);
var percent = this.percentage.toFixed(2);
var color = this.color;
return '<span data-z-index="1" style="position: absolute; font-size: 12px; white-space: nowrap; color: rgb(51, 51, 51); margin-left: 0px; margin-top: 0px; left: 8px; top: 8px; background-color: rgba(255, 255, 255, 0.7); border: 2px solid ' + color + '; border-radius: 3px; padding: 5px;"><span style="font-size: 10px">'
+ this.key + '</span><br><span style="color:' + color + '">●</span> VALUE: ' + value + '</br>PERCENT: ' + percent + '%</span>';
}
}
} |