//<![CDATA[
$(function () {
var chart_categories = [];
var chart_data1 = [];
var chart_data2 = [];
#foreach($!{data} in $!{dailySum})
chart_categories.push([dateToYMD('$!{data.DT}')]);
chart_data1.push([$!{data.TOTAL}]);
chart_data2.push([$!{data.TOTAL_SUM}]);
#end
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'chart_chart1',
zoomType: 'y',
backgroundColor: 'Transparent',
size: '100%'
},
credits: {
enabled: false
},
title: {
text: '그래프1',
margin: 50
},
xAxis: {
categories: chart_categories,
type: "datetime",
tickInterval: 1
},
yAxis: [{ // Impression yAxis
allowDecimals: false,
min: 0,
minRange: 5,
maxPadding: 0.1,
title: {
text: '금액(원)',
style: {
color: '#6D9F7D'
}
},
labels: {
style: {
color: '#6D9F7D'
}
},
opposite: false
}, { // % yAxis
alignTicks: false,
gridLineWidth: 0,
min: 0,
max: 100,
title: {
text: '%',
style: {
color: '#4399AA'
}
},
labels: {
formatter: function () {
return this.value + '%';
},
style: {
color: '#4399AA'
}
},
opposite: true
}],
legend: {
margin: 20
},
tooltip: {
formatter: function () {
var unit = {
'Monthly': '원',
'Daily': ' 원',
'%': '%'
}[this.series.name];
var value = "";
switch (unit) {
case '%':
value = Highcharts.numberFormat(this.y, 2, ".", ",");
break;
default:
value = Highcharts.numberFormat(this.y, 0, "", ",");
break;
}
return '' + this.x + ': ' + value + ' ' + unit;
}
},
series: [{
type: 'column',
name: 'Monthly',
color: '#A0C35A',
data: chart_data2,
visible: false
}, {
type: 'spline',
name: 'Daily',
color: '#AC80BA',
data: chart_data1
}, {
type: 'spline',
yAxis: 1,
name: '%',
color: '#157984',
data: [10, 20, 30],
visible: false
}]
});
});
});
//]]>