JavaScript [Google] Pie Chart 원형 챠트
페이지 정보
본문
<%
dim good_mny1, good_mny2
sql = "select sum(convert(int,good_mny)) from dg_kcp where card_gubun='ticket' and card_cd <> '' and mb_no = '"& session("ss_mb_no") &"' "
set rs = conn.execute(sql)
If Rs.BOF or Rs.EOF Then
Else
good_mny1 = rs(0)
if good_mny1 > 0 or good_mny1 < 0 then
else
good_mny1 = 0
end if
'response.write "good_mny1 = "& good_mny1 &"<br />"
end if
rs.close
sql = "select sum(convert(int,good_mny)) from dg_kcp where mb_no = '"& session("mb_no") &"' "
set rs = conn.execute(sql)
If Rs.BOF or Rs.EOF Then
Else
good_mny2 = rs(0)
if good_mny2 > 0 or good_mny2 < 0 then
else
good_mny2 = 0
end if
'response.write "good_mny2 = -"& good_mny2 &"-<br />"
end if
rs.close
%>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['신용카드', <% response.write good_mny1 %>],
['계좌이체', <% response.write good_mny2 %>],
]);
// Set chart options
var options = {'title':'티켓 판매',
'width':330,
'height':330};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div_PieChart'));
chart.draw(data, options);
}
</script>
<table border="1"><tr><td><div id="chart_div_PieChart"></div></td></tr></table>
참고자료
https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart
<table border="1"><tr><td><div id="chart_div_PieChart"></div></td></tr></table>
참고자료
https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart
댓글목록
등록된 댓글이 없습니다.