ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: 新しい追加オプションの top と bottom を指定
名前: lightbox
処理選択
パスワード

件名 新しい追加オプションの top と bottom を指定
名前 lightbox
コメント
@DIV
<script type="text/javascript">
$(function(){
	$("#target_table3").visualize({
		type: "line",
		width: "400px",
		height: "300px",
		top: 1300,
		bottom: 400,
		yLabelInterval: 50
	});
});
</script>
@END

@SHOW
このような指定は自動ではできませんが、固定されたデータをグラフとして使用したい場合は重要なレイアウトだと思います。また、オリジナルでは、Y 座標の目盛りの単位がこのように 100 づつというようになりません。そこでこれも変更して([[yLabelInterval]])デフォルトで 100 づつにしています。( 変更可能です )
@END

@HTML
</pre>
<script type="text/javascript">
if ( !window.jQuery ) {
	document.write("<"+"script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></"+"script>");
}
</script>
<script type="text/javascript">
if ( window[window.location.hostname+'.visualize'] !== true ) { 
	window[window.location.hostname+'.visualize'] = true; 
	(function(){
		var str="";
		str+="<link href=\"http://winofsql.jp/jquery/plugins/visualize/visualize-dark.css\" type=\"text/css\" rel=\"stylesheet\"> \n";
		str+="<"+"script type=\"text/javascript\" src=\"http://winofsql.jp/jquery/plugins/visualize/excanvas.js\"></"+"script> \n";
		str+="<"+"script type=\"text/javascript\" src=\"http://winofsql.jp/jquery/plugins/visualize/visualize.jQuery.js\"></"+"script> \n";
		document.write(str);
	})();
} 
</script> 
<script type="text/javascript">
$(function(){
	$("#target_table3").visualize({
		type: "line",
		width: "400px",
		height: "300px",
		top: 1300,
		bottom: 400,
		yLabelInterval: 50
	});
});
</script>
<style>
.visualize * {
	font-size: 12px!important;
	font-family: Arial,"メイリオ","MS Pゴシック";
}
.visualize .visualize-title {
	font-size: 24px!important;
	font-family: Arial,"メイリオ","MS Pゴシック";
}
.visualize { 
	margin: 20px 0 0 15px;
}
#target_table3 {
	border-collapse: collapse;
}
#target_table3 caption {
	padding:10px;
	border: solid 1px #c0c0c0;
	margin-bottom: 10px;
	border-radius: 10px;
	background: linear-gradient(to bottom, #777, #000);
	color: #fff;
}
#target_table3 td, #target_table3 th {
	text-align: center;
	border: 1px solid #ddd;
	padding:2px 5px;
}
</style>
<table id="target_table3">
<caption>電気使用量の推移</caption>
<thead>
<tr>
	<td></td>
	<th>1月</th>
	<th>2月</th>
	<th>3月</th>
	<th>4月</th>
	<th>5月</th>
	<th>6月</th>
	<th>7月</th>
	<th>8月</th>
	<th>9月</th>
	<th>10月</th>
	<th>11月</th>
	<th>12月</th>
</tr>
</thead>
<tbody>
<tr>
	<th>2013</th>
	<td>1144</td>
	<td>938</td>
	<td>972</td>
	<td>714</td>
	<td>771</td>
	<td>515</td>
	<td>641</td>
	<td>1051</td>
	<td>1018</td>
	<td>658</td>
	<td>681</td>
	<td>712</td>
</tr>
<tr>
	<th>2014</th>
	<td>1219</td>
	<td>927</td>
	<td>947</td>
	<td>709</td>
	<td>674</td>
	<td>495</td>
	<td>537</td>
	<td>900</td>
	<td>758</td>
	<td>536</td>
	<td>550</td>
	<td>857</td>
</tr>
</tbody>
</table>
<pre>
@HEND