Skip to content

Instantly share code, notes, and snippets.

@71713 71713/index.html
Last active Jan 22, 2016

What would you like to do?
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
var countStartQiitaId = 74479;
var QiitaAccount = "71713@github";
var data;
var TotalCount=0;
function setData() {
data = new google.visualization.DataTable();
data.addColumn('string', 'QiitaTitle');
data.addColumn('number', 'stock count');
var qiitaAPI = "" + QiitaAccount + "/items"
$(function() {
$.getJSON(qiitaAPI, function(qiitaData) {
if( >= countStartQiitaId){
data.setValue(i, 0, v.title);
data.setValue(i, 1, parseInt(v.stock_count));
TotalCount += parseInt(v.stock_count);
function drawChart(importData) {
var options = {
title: QiitaAccount + '\'s Stock Count!!! Total count is : ' + TotalCount,
hAxis: {title: 'QiitaTitle', titleTextStyle: {color: 'skyblue'}}
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(importData, options);
<input type="button" value="Make Graph" onClick="drawChart(data)">
<div id="chart_div" style="width: 900px; height: 500px;"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.