[Google] Line Chart / Column Chart (선그래프/막대그래프) 챠트 > 기술자료 | 해피정닷컴

[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건 4 페이지
  • RSS
기술자료 목록
92
JavaScript   18134  2013-01-14 20:23  
91
JavaScript   20401  2012-12-22 22:47  
90
JavaScript   15715  2012-10-30 08:25  
89
JavaScript   29602  2012-10-17 21:33 ~ 2018-07-04 15:57  
88
JavaScript   15482  2012-10-08 21:15  
87
JavaScript   34298  2012-10-08 19:47  
86
JavaScript   37545  2012-10-04 13:49  
85
JavaScript   15251  2012-09-18 05:44 ~ 2013-07-02 00:00  
84
JavaScript   28932  2012-09-07 19:33 ~ 2017-12-01 14:36  
83
JavaScript   21649  2012-08-23 01:18  
열람
JavaScript   20715  2012-06-23 23:47  
81
JavaScript   15434  2012-06-23 23:45  
80
JavaScript   35725  2012-06-21 05:20 ~ 2022-11-18 13:06  
79
JavaScript   27122  2012-06-05 00:48  
78
JavaScript   30412  2012-05-26 01:23 ~ 2020-04-08 09:26  
77
JavaScript   31212  2012-05-24 03:56  
76
JavaScript   16775  2012-05-15 01:04 ~ 2022-01-30 23:52  
75
JavaScript   15358  2012-05-10 21:08  
74
JavaScript   18979  2012-05-06 23:58  
73
JavaScript   27733  2012-05-06 23:23  

검색

해피정닷컴 정보

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

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