function dateToYMD(ymd) {
var date = new Date(ymd);
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getFullYear();
//return '' + y + '-' + (m<=9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d);
return (m<=9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d);
}
var chart1_x = [];
var chart1_data1 = [];
var chart1_data2 = [];
#foreach($!{data} in $!{dataList})
chart1_x.push([dateToYMD('$!{data.dt}')]);
chart1_data1.push([10$!{data.payAmt}]);
chart1_data2.push([1$!{data.cancAmt}]);
#end
function chart1() {
$('#chart1').highcharts({
chart: {type: 'column', backgroundColor:'Transparent', size:'100%'},
credits: {enabled: false},
title: {text: ''},
subtitle: {text: ''},
xAxis: {categories: chart1_x},
yAxis: {
min: 0,
title: {
text: '금액(원)'
}
},
tooltip: {
headerFormat: '<span style="font-size:12px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.0f} 원</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: '결제',
data: chart1_data1
}, {
name: '취소',
data: chart1_data2
}]
});
}