円グラフを作ってそのデータを各自の持つステータスを参照して表示するようにしたいのですが、どのようにしたらよいのかわかりません。
##前提として
anspressというQ&Aプラグインを使っています。 プロフィールに表示される評価というカテゴリーで出る数字を円グラフに直して表示させたいということなのですが、プラグイン内をいじり更新して消えてしまうと困るので、子テーマのcssとjsに円グラフの情報を入れて対象のページ内でHTMLを記入して表示させようと思っているのですが、その円グラフにanspressのユーザーメタを参照させるための書き方がわかりません。
##実際に使っているコードです。
CSS
1.chart { 2 position: relative; 3 display: inline-block; 4 width: 110px; 5 height: 110px; 6 text-align: center; 7} 8.chart canvas { 9 position: absolute; 10 top: 0; 11 left: 0; 12} 13.percent { 14 padding: 0px; 15 margin: 0px; 16 display: inline-block; 17 line-height: 110px; 18 z-index: 2; 19 font-size: 30px; 20} 21.percent::after{ 22 content:'%'; 23}
JS
1 $('.chart').easyPieChart({ 2 easing:'easeOutQuart', 3 barColor:'#DC4944', 4 animate:5000, 5 lineWidth: 12, 6 size:110, 7 trackWidth: 13, 8 scaleLength:10, 9 scaleColor:false, 10 onStep:function(from, to, percent) { 11 $('.percent').html(Math.round(percent)); 12} 13 });
HTML
1 <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> 2 <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> 3 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/easy-pie-chart/2.1.6/jquery.easypiechart.min.js"></script> 4<div class="chart" data-percent="90"> 5 <p class="percent"></p> 6</div>
ユーザーメタはこれかなと思うのですが
ap_get_user_reputation_met
よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。