Google Chart를 이용한 통계 게시판
Google Chart를 게시판에 넣어 보았습니다.
압축을 풀면 statistics_pc, statistics_mobile 폴더가 나옵니다.
그누보드 순정기준으로
statistics_pc은 skin/board/statistics_pc 경로가 되게 업로드합니다.
statistics_mobile은 mobile/skin/board/statistics_mobile 경로가 되게 업로드합니다.
업로드후 일반적인 방법으로 게시판을 적용하면 됩니다.
필요한 만큼 phyMyAdmin를 이용하여 여분필드를 만들어 줍니다.

write_update.skin.php에서 추가한 여분필드 만큼 다음 코드를 넣어줍니다.
[code]<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$sql = " update $write_table
set wr_11 = '$wr_11',
wr_12 = '$wr_12',
wr_13 = '$wr_13',
wr_14 = '$wr_14',
wr_15 = '$wr_15',
wr_16 = '$wr_16',
wr_17 = '$wr_17',
wr_18 = '$wr_18',
wr_19 = '$wr_19',
wr_20 = '$wr_20'
where wr_id = '$wr_id' ";
sql_query($sql);
?>[/code]
글쓰기입니다.

통계 제목: 표시하려는 통계의 이름을 넣어줍니다.
통계 단위: 표시하려는 단위이름을 넣어줍니다 예: 군사력지수
라디오버튼으로 표시방법을 정합니다. bar형과 pie형 중에서 선택합니다.
bar형은 막대 그래프타입이고, pie형은 원형 그래프타입니다.
변수이름은 텍스트를 입력합니다.
변수값은 숫자를 입력합니다.
편의상 변수 5개 까지는 필수입력으로 했고 그후는 선택으로 했습니다.
구글차트 코드에 필요한 부분을 여분필드로 담았습니다.
[code]<!DOCTYPE html>
<html>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<body>
<div id="myChart" style="width:100%; max-width:600px; height:500px;"></div>
<script>
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Contry', 'Mhl'],
['Italy',55],
['France',49],
['Spain',44],
['USA',24],
['Argentina',15]
]);
var options = {
title:'World Wide Wine Production'
};
var chart = new google.visualization.BarChart(document.getElementById('myChart'));
chart.draw(data, options);
}
</script>
</body>
</html>[/code]
view.skin.php 여분필드로 받아오기
[code]<!-- 통계 시작 -->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="myChart" style="width:100%; max-width:960px; height:500px;"> </div>
<script>
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Contry', '<?php echo $view['wr_18'];?>'],
['<?php echo $view['wr_1'];?>',<?php echo $view['wr_2'];?>],
['<?php echo $view['wr_3'];?>',<?php echo $view['wr_4'];?>],
['<?php echo $view['wr_5'];?>',<?php echo $view['wr_6'];?>],
['<?php echo $view['wr_7'];?>',<?php echo $view['wr_8'];?>],
['<?php echo $view['wr_9'];?>',<?php echo $view['wr_10'];?>],
['<?php echo $view['wr_11'];?>',<?php echo $view['wr_12'];?>],
['<?php echo $view['wr_13'];?>',<?php echo $view['wr_14'];?>]
]);
var options = {
title:'<?php echo $view['wr_20'];?>',
is3D:true
};
var chart = new google.visualization.<?php echo $view['wr_19'];?>Chart(document.getElementById('myChart'));
chart.draw(data, options);
}
</script>
<!-- 통계 종료 -->[/code]
write.skin.php
[code]<!-- insert graph start -->
<div class="bo_w_info write_div">
<label for="wr_20" class="sound_only">통계제목<strong>필수</strong></label>
<input type="text" name="wr_20" value="<?php echo $write['wr_20'] ?>" id="wr_20" required class="frm_input full_input required" placeholder="통계 제목">
<label for="wr_18" class="sound_only">통계단위<strong>필수</strong></label>
<input type="text" name="wr_18" value="<?php echo $write['wr_18'] ?>" id="wr_18" required class="frm_input full_input required" placeholder="통계 단위">
<label for="wr_19" class="sound_only">그래픽종류<strong>필수</strong></label>
<?php echo wr_radio("wr_19", "Bar,Pie", 1); ?>
</div>
<div class="bo_w_info write_div">
<label for="wr_1" class="sound_only">1변수이름<strong>필수</strong></label>
<input type="text" name="wr_1" value="<?php echo $write['wr_1'] ?>" id="wr_1" required class="frm_input half_input required" placeholder="1 변수이름">
<label for="wr_2" class="sound_only">1변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_2" value="<?php echo $write['wr_2'] ?>" id="wr_2" required class="frm_input half_input required" placeholder="1 변수값">
<label for="wr_3" class="sound_only">2변수이름<strong>필수</strong></label>
<input type="text" name="wr_3" value="<?php echo $write['wr_3'] ?>" id="wr_3" required class="frm_input half_input required" placeholder="2 변수이름">
<label for="wr_4" class="sound_only">2변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_4" value="<?php echo $write['wr_4'] ?>" id="wr_4" required class="frm_input half_input required" placeholder="2 변수값">
<label for="wr_5" class="sound_only">3변수이름<strong>필수</strong></label>
<input type="text" name="wr_5" value="<?php echo $write['wr_5'] ?>" id="wr_5" required class="frm_input half_input required" placeholder="3 변수이름">
<label for="wr_6" class="sound_only">3변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_6" value="<?php echo $write['wr_6'] ?>" id="wr_6" required class="frm_input half_input required" placeholder="3 변수값">
<label for="wr_7" class="sound_only">4변수이름<strong>필수</strong></label>
<input type="text" name="wr_7" value="<?php echo $write['wr_7'] ?>" id="wr_7" required class="frm_input half_input required" placeholder="4 변수이름">
<label for="wr_8" class="sound_only">변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_8" value="<?php echo $write['wr_8'] ?>" id="wr_8" required class="frm_input half_input required" placeholder="4 변수값">
<label for="wr_9" class="sound_only">5변수이름<strong>필수</strong></label>
<input type="text" name="wr_9" value="<?php echo $write['wr_9'] ?>" id="wr_9" required class="frm_input half_input required" placeholder="5 변수이름">
<label for="wr_10" class="sound_only">5변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_10" value="<?php echo $write['wr_10'] ?>" id="wr_10" required class="frm_input half_input required" placeholder="5 변수값">
<label for="wr_11" class="sound_only">6변수이름<strong>필수</strong></label>
<input type="text" name="wr_11" value="<?php echo $write['wr_11'] ?>" id="wr_11" class="frm_input half_input" placeholder="6 변수이름">
<label for="wr_12" class="sound_only">6변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_12" value="<?php echo $write['wr_12'] ?>" id="wr_12" class="frm_input half_input " placeholder="6 변수값">
<label for="wr_13" class="sound_only">7변수이름<strong>필수</strong></label>
<input type="text" name="wr_13" value="<?php echo $write['wr_13'] ?>" id="wr_13" class="frm_input half_input " placeholder="7 변수이름">
<label for="wr_14" class="sound_only">7변수값<strong>필수</strong></label>
<input style="margin-left: 8px" type="text" name="wr_14" value="<?php echo $write['wr_14'] ?>" id="wr_14" class="frm_input half_input" placeholder="7 변수값">
</div>
<!-- insert graph end -->[/code]
감사합니다.^^
버전 정보
첨부파일
그누보드5 스킨
2,751건좋은 댓글과 좋아요는 제작자에게 큰힘이 됩니다.
하단 겔러리 이미지에 마우스 오버 시 상단 큰 동영상이 바뀌는 기능 그냥 링크 만 하면 알아서 이미지 및 경로까지 알아서 됨
5.5.8.2.3 베이직 스킨을 수정하였습니다. 기존에 있는 1:1문의 게시판은 회원전용이므로 회원가입을 꺼려하는 고객들이 글쓰기를 기피할 수도 있을 것 같습니다. 일반 게시판을 ...
사용방법 [code] <!-- 위젯 시작 { --> <h3 class="h3 f-lg en"> <a href="<?php echo get_pretty_...
그누보드 참좋다 메인 최신글 을 널을 수잇는 소스를 가져다가 css 가로값만 조정 해주면 저리 간단이 오른족 배너 관리를 할수있다. >> 단 css html5 style sc...
그누보드/영카트 5.5 버전용입니다. (5.4 후반부 버전에서도 일부 사용가능합니다) 그누보드/영카트 5.5.8.2.5 에 최적화되어있습니다. 먼저 정중하게 태클 사양...
Google Chart를 게시판에 넣어 보았습니다. 압축을 풀면 statistics_pc, statistics_mobile 폴더가 나옵니다. 그누보드 순정기준으로 statisti...
댓글 16개
제가 보낸 쪽지는 보셨는지요.
늘 좋은 소스를 공유해주서 항상 감사한 마음 가지고 있습니다^^
네이버나 구글은 너무 제약이 많아서...
제 코드는 기본설정으로는 다음에는 바로 들어가고 나베르는 스팸으로 구글은 아예 튕겨냅니다.
폼메일은 홈페이지에서 일종의 액서사리이고 문의를 받는 게시판을 만드는 것이 정신건강에 이롭더라구요.
좋은자료 감사합니다.
[http://sir.kr/data/editor/2212/796b95e8ec8ea57ea25fdc8db915a48e_1670519409_1276.png]
고생하셨습니다. 김철용님의 자료로 또 하나 배우고 있습니다.