[Google] Line Chart / Column Chart (선그래프/막대그래프) 챠트 > 기술자료

본문 바로가기

사이트 내 전체검색

[Google] Line Chart / Column Chart (선그래프/막대그래프) 챠트 > 기술자료

JavaScript [Google] Line Chart / Column Chart (선그래프/막대그래프) 챠트

페이지 정보


본문

<%
dim send_date, total, success
dim arrDate(7), arrTotal(7), arrSuccess(7)
SQL = "SELECT top 8 left(gubun,6) as send_date, total, success FROM view_im_dmail_info where ms_end = 'y' and mb_no = '"& session("ss_mb_no") &"' order by edate desc "
'response.write sql
set rs = conn.execute(sql)
If Rs.BOF or Rs.EOF Then 
Else 
  i = 0
  Do until rs.EOF
arrDate(i) = mid(rs(0),5,2) &"-"& right(rs(0),2)
    arrTotal(i) = rs(1)
    arrSuccess(i) = rs(2)
  rs.movenext 
  i = i + 1
  loop 
end if
rs.close
 
  if arrTotal(0) > 0 or arrTotal(0) < 0 then 
  else
    arrTotal(0) = 0 
  end if
  if arrTotal(1) > 0 or arrTotal(1) < 0 then 
  else
    arrTotal(1) = 0 
  end if
  if arrTotal(2) > 0 or arrTotal(2) < 0 then 
  else
    arrTotal(2) = 0 
  end if
  if arrTotal(3) > 0 or arrTotal(3) < 0 then 
  else
    arrTotal(3) = 0 
  end if
  if arrTotal(4) > 0 or arrTotal(4) < 0 then 
  else
    arrTotal(4) = 0 
  end if
  if arrTotal(5) > 0 or arrTotal(5) < 0 then 
  else
    arrTotal(5) = 0 
  end if
  if arrTotal(6) > 0 or arrTotal(6) < 0 then 
  else
    arrTotal(6) = 0 
  end if
  if arrTotal(7) > 0 or arrTotal(7) < 0 then 
  else
    arrTotal(7) = 0 
  end if
  
  if arrSuccess(0) > 0 or arrSuccess(0) < 0 then 
  else
    arrSuccess(0) = 0 
  end if
  if arrSuccess(1) > 0 or arrSuccess(1) < 0 then 
  else
    arrSuccess(1) = 0 
  end if
  if arrSuccess(2) > 0 or arrSuccess(2) < 0 then 
  else
    arrSuccess(2) = 0 
  end if
  if arrSuccess(3) > 0 or arrSuccess(3) < 0 then 
  else
    arrSuccess(3) = 0 
  end if
  if arrSuccess(4) > 0 or arrSuccess(3) < 0 then 
  else
    arrSuccess(4) = 0 
  end if
  if arrSuccess(5) > 0 or arrSuccess(5) < 0 then 
  else
    arrSuccess(5) = 0 
  end if
  if arrSuccess(6) > 0 or arrSuccess(6) < 0 then 
  else
    arrSuccess(6) = 0 
  end if
  if arrSuccess(7) > 0 or arrSuccess(7) < 0 then 
  else
    arrSuccess(7) = 0 
  end if
'response.write "arrDate0 = "&arrDate(0) &"<br />"
'response.write "arrDate0 = "&arrDate(1) &"<br />"
'response.write "arrDate0 = "&arrDate(2) &"<br />"
'response.write "arrTotal0 = "&arrTotal(0) &"<br />"
'response.write "arrTotal1 = "&arrTotal(1) &"<br />"
'response.write "arrTotal2 = "&arrTotal(2) &"<br />"
'response.write "arrSuccess0 = "&arrSuccess(0) &"<br />"
'response.write "arrSuccess1 = "&arrSuccess(1) &"<br />"
'response.write "arrSuccess2 = "&arrSuccess(2) &"<br />"
 
%>
<script type="text/javascript">
  google.load("visualization", "1", {packages:["corechart"]});
  google.setOnLoadCallback(drawChart);
  function drawChart() {
    var data = google.visualization.arrayToDataTable([
      ['발송회차', '전체', '성공'],
      ['<%=arrDate(7) %>', <%=arrTotal(7) %>, <%=arrSuccess(7) %>],
      ['<%=arrDate(6) %>', <%=arrTotal(6) %>, <%=arrSuccess(6) %>],
      ['<%=arrDate(5) %>', <%=arrTotal(5) %>, <%=arrSuccess(5) %>],
      ['<%=arrDate(4) %>', <%=arrTotal(4) %>, <%=arrSuccess(4) %>],
      ['<%=arrDate(3) %>', <%=arrTotal(3) %>, <%=arrSuccess(3) %>],
      ['<%=arrDate(2) %>', <%=arrTotal(2) %>, <%=arrSuccess(2) %>],
      ['<%=arrDate(1) %>', <%=arrTotal(1) %>, <%=arrSuccess(1) %>],
      ['<%=arrDate(0) %>', <%=arrTotal(0) %>, <%=arrSuccess(0) %>]
    ]);
 
    var options = {
      title: '초대장 발송',
      hAxis: {title: '발송 날짜', titleTextStyle: {color: 'red'}}
    };
 
    // 막대그래프
    //var chart = new google.visualization.ColumnChart(document.getElementById('chart_div_ColumnChart'));
    // 선그래프
    var chart = new google.visualization.LineChart(document.getElementById('chart_div_ColumnChart'));
    chart.draw(data, options);
  }
</script>
<table border="1"><tr><td><div id="chart_div_ColumnChart" style="width: 742px; height: 400px;"></div></td></tr></table>


참고자료
https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart  

댓글목록

등록된 댓글이 없습니다.


Total 152건 5 페이지
  • RSS
기술자료 목록
72
JavaScript   14297  2012-05-06 23:22  
71
JavaScript   21849  2012-05-03 13:48  
70
JavaScript   15969  2012-04-26 12:06 ~ 2012-05-26 00:00  
69
JavaScript   41361  2012-04-24 00:22  
68
JavaScript   37296  2012-04-19 23:06 ~ 2012-06-22 00:00  
67
JavaScript   16134  2012-04-06 21:01  
66
JavaScript   19876  2012-04-02 15:14  
65
JavaScript   16743  2012-03-12 23:33  
64
JavaScript   47488  2012-01-31 23:38 ~ 2022-12-06 10:11  
63
JavaScript   16889  2011-07-26 07:31  
62
JavaScript   39964  2011-07-26 06:59  
61
JavaScript   20302  2011-06-11 19:23 ~ 2011-06-12 00:00  
60
JavaScript   27775  2011-06-11 19:01  
59
JavaScript   14971  2010-09-13 20:55 ~ 2018-05-15 10:29  
58
JavaScript   21453  2010-06-12 11:55  
57
JavaScript   39042  2009-10-17 04:16  
56
JavaScript   17635  2009-10-10 09:48 ~ 2013-10-21 00:00  
55
JavaScript   13799  2009-09-02 10:21  
54
JavaScript   19408  2009-07-03 10:25 ~ 2013-02-18 00:00  
53
JavaScript   25006  2009-04-28 12:28  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2026 해피정닷컴. All Rights Reserved.