Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
税金の使い道(一般会計 歳入歳出)
useful
0
Loading...
function bbb() { var youto_t; var elm = document.getElementById( 'event-num' ) ; youto_t=document.js.youto.value; elm.innerHTML = youto_t; sss("歳入",youto_t); sss("歳出",youto_t); } function sss(zaisei,nendo) { //alert("start"); var elm = document.getElementById( 'event-num' ) ; elm.innerHTML = nendo; var dai = ["ippankaikei_sainyu","ippankaikei_saishutu"]; var daikubun; var imgcanvas; var sainyu = [ ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0] ]; var saishutu = [ ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0] ]; var inx = 0; var kubun; var index; var sougaku; if ( zaisei == "歳入" ) { daikubun = dai[0]; imgcanvas = document.getElementById("imgcanvas"); } else { daikubun = dai[1]; imgcanvas = document.getElementById("imgcanvas2"); } englaph(sainyu,imgcanvas,"clr"); englaph(saishutu,imgcanvas2,"clr"); var keyword = getParameterFromURL("subject"); // obtain keyword from the URL "?subject=" // Work loop $.each(LinkData.getWorks(), function(workKey, workValue) { // File loop $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) { // Subject loop $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) { $.each( LinkData.getTriplesBySubject(workValue, fileValue, subjValue), function( tripleKey, tripleValue ) { if (fileValue == daikubun ) { var prop = decodeURIComponent(tripleValue.property); prop = prop.split("#"); var obj = tripleValue.object; if (prop[1] == "区分") { kubun = obj; } if (prop[1] == nendo + "-決算-金額") { if ( inx == 0) { sougaku = obj; } } if (prop[1] == nendo + "-決算-構成比(%)") { if ( zaisei == "歳入" ) { sainyu[inx][0] = kubun; sainyu[inx][1] = obj; } else { saishutu[inx][0] = kubun; saishutu[inx][1] = obj; } inx++; } } }); }); }); }); if ( zaisei == "歳入" ) { var elm = document.getElementById( 'sainyu' ) ; elm.innerHTML = addFigure(sougaku) + "(千円)"; englaph(sainyu,imgcanvas); } else { var elm = document.getElementById( 'saishutu' ) ; elm.innerHTML = addFigure(sougaku) + "(千円)"; englaph(saishutu,imgcanvas2); } //window.find(highlight); }; function addFigure(str) { var num = new String(str).replace(/,/g, ""); while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2"))); return num; } function englaph(sainyu,imgcanvas,opt) { //alert("sainyu"); var kaku_int; var kaku_out; var col; var pos = 0; var moji; var kyuint; var d; var z; var colo = ["rgba(204,0,0,.5)", //赤 "rgba(255,255,0,.5)", //黄 "rgba(12,0,20,.5)", //ブルー "rgba(255,183,76,.5)", //オレンジ "rgba(107,191,63,.5)", //モスグリーン "rgba(25,25,25,.5)", //黒 "rgba(255,40,25,.5)", //朱色 "rgba(135,0,204,.5)", //バイオレット "rgba(209,232,41,.5)", //レモン色 "rgba(15,82,188,.5)", //シアン "rgba(229,0,49,.5)", //ストロベリー "rgba(99,124,53,.5)", //オリーブ "rgba(49,0,178,.5)", //るりいろ "rgba(239,161,143,.5)", //サーモンピンク "rgba(224,234,58,.5)", //カナリア色 "rgba(71,234,126,.5)", //エメラルドグリーン "rgba(156,167,22,.5)", //スカイブルー "rgba(255,0,55,.5)", //ローズ "rgba(228,162,11,.5)", //山吹色 "rgba(39,38,114,.5)", //藍色 "rgba(161,183,122,.5)", //青に "rgba(229,0,118,.5)", //マゼンタ "rgba(240,179,37,.5)", //ウコン "rgba(67,135,233,.5)"]; //ターコイスブルー if (imgcanvas.getContext) { var ctx = imgcanvas.getContext("2d"); if ( opt == "clr" ) { ctx.clearRect(0,0,500,350); } else { kaku_int = 0; kaku_out = 0; pos = 3; for ( d = 1; d < sainyu.length; d++ ){ kaku_int = kaku_out; kaku_out = sainyu[d][1]/100*360; kaku_out = kaku_int + kaku_out; col = colo[d-1]; z = sainyu[d][1] * 10; z = Math.floor(z); z = z / 10; moji = sainyu[d][0] + " " + z + "%"; // alert(kaku_int); aaa(imgcanvas,ctx,kaku_int,kaku_out,col,pos,moji); pos = pos + 16; } } } } function aaa(imgcanvas,ctx,kaku_int,kaku_out,col,pos,moji) { //alert("aaa"); // セットする変数 //var xPos = imgcanvas.offsetWidth / 2; //var yPos = imgcanvas.offsetHeight / 2; var xPos = 80; var yPos = 80; var radius = 80; var sAngle = 0; var eAngle = 0; // 赤い円弧を描く sAngle = (kaku_int - 90) * Math.PI / 180; eAngle = (kaku_out - 90) * Math.PI / 180; ctx.beginPath(); ctx.moveTo(xPos , yPos); ctx.arc(xPos, yPos, radius, sAngle, eAngle, false); ctx.closePath(); ctx.fillStyle = col; ctx.fill(); ctx.beginPath(); ctx.fillStyle = col; ctx.fillRect(180, pos, 13, 13); ctx.font= 'normal 13px "Century Gothic"'; ctx.fillStyle = '#000'; ctx.fillText(moji,210, pos+10); } // Get a parameter value in URL (e.g. ?paramString=value ) function getParameterFromURL( paramString ) { var value = ""; var topWindow = top.window.location.search; if( topWindow ){ var q = decodeURIComponent(topWindow.substring(1,topWindow.length)).split("&"); for ( var i = 0; i < q.length; i++ ){ var r = q[i].split("="); if ( r[0] == paramString ) value = r[1]; } } return value; } // Highlight keyword in the string function highlight( string, keyword ) { if ( keyword.length > 0 ) { var ss = string.split(keyword); var len = ss.length; if ( len > 1 ) { string = ss[0]; for ( i = 1; i < len; i++ ) // string += "<font color=\"red\">"+keyword+"</font>"+ss[i]; string += "<span class=\"highlight\">"+keyword+"</span>"+ss[i]; } } return string; } // get the last name of the string separated with # and / function getLastName( string ) { string = decodeURIComponent(string); var sharp = string.split("#"); var slash = sharp[sharp.length-1].split("/"); var lastName = slash[slash.length-1]; return lastName; } // return a link to Google map search function addLinkToMap( latitude, longitude ) { var s = "<br><a target=\"_blank\" href=\"http://www.google.com/maps/?q=" + latitude + "," + longitude + "\">Show map</a>"; return s; } // shortening URL e.g. http://.../123.jpg function shortenURL( url ) { url = decodeURIComponent(url); var slash = url.split("/"); var lastName = slash[slash.length-1]; return url.split(":")[0]+"://.../"+lastName; }
span.highlight {color: red;} span.propertyName {color: gray;} span.subject { color: blue; } span.object{ color: black; } body { background: white; } a, a span { text-decoration: underline; } a:hover, a span:hover { text-decoration: none; }
<form name="js" onContextmenu="return false"> <font size="1">調べたい年度を選択:<input type="text" name="youto" list="data1" value="平成27年度"> <datalist id="data1"> <option value="平成18年度"></option> <option value="平成19年度"></option> <option value="平成20年度"></option> <option value="平成21年度"></option> <option value="平成22年度"></option> <option value="平成23年度"></option> <option value="平成24年度"></option> <option value="平成25年度"></option> <option value="平成26年度"></option> <option value="平成27年度"></option> </datalist> <font size="1"><input type="button" value="表示" onclick="bbb()"><br> </form> <body> <p><font size="5">一般会計 歳入歳出決算の状況 <span id="event-num"></span></p><br> <p><font size="5">歳入 <span id="sainyu"></span></p><br> <canvas id="imgcanvas" width="500" height="350"> </canvas> <p><font size="5">歳出 <span id="saishutu"></span></p><br> <canvas id="imgcanvas2" width="500" height="350"> <p>canvas非対応ブラウザかJavaScriptが無効になっています。</p> </canvas> </body>
Preview
Input Data
ReadMe
Snapshots
LinkData Work
Table Data
宮城県石巻市 一般会計歳入歳出決算の推移
Contributor:石巻市, ICT総合推進課
Update:Dec 13, 2018
229 Downloads, 1 Applications
1.一般会計歳入歳出決算の推移、歳入、単位:千円 file: ippankaikei_sainyu 2.一般会計歳入歳出決算の推移、歳出、単位:千円 file: ippankaikei_saishutu 資料:石巻市財政課
ippankaikei_sainyu
ippankaikei_saishutu
Add LinkData work(LinkData)
Link http://app.linkdata.org/run/app1s1375i?tab=readme
jquery-1.11.2.min.js
Work
Add
Clear
insert work id or work name.