• forked:統計データをアニメーション棒グラフで表示
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:統計データをアニメーション棒グラフで表示
  • jquery-1.7.1.min.js  
  • https://www.google.com/jsapi  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
if(typeof Application==="undefined"||!Application){var Application= {};}
 
Application.bc = function() {
    this._init.apply(this, arguments);
}
 
Application.bc.prototype = {
    
    _data : null,
    _options : null,
    _mainArray : null,
    
    _init : function() {
        this._mainArray = [];
        this._mainArray = this._getObjectArray();
        this._options = this._getGoogleOption();
        this._initCheckBox();
        this._getHistoryYear();
    },
 
    _initCheckBox : function() {
        var array = this._getSubjectKeyValuePair();
        $.each(array, function(i, obj) {
            var checked = "";
            if (i == 0 || i ==2) {
                checked = "checked='checked'";
            }
            $("<div class='entry'><input type='checkbox' class='chkPrefecture' value='" + obj.key + "' id='" + obj.key + "' " + checked + "/><label for='" + obj.key + "'><span>" + obj.value + "</span></label></div>").appendTo("#checkBoxAreaId");
        });
    },
    
    _configArray : function() {
        var array = [
            {
                "caption" : "平成18年",
                "property" : "平成18年"
            },
            {
                "caption" : "平成19年",
                "property" : "平成19年"
            },
            {
                "caption" : "平成20年",
                "property" : "平成20年"
            },
            {
                "caption" : "平成21年",
                "property" : "平成21年"
            },
            {
                "caption" : "平成22年",
                "property" : "平成22年"
            }
        ];
        return array;
    },
    
    _getGoogleOption : function() {
        var options = {
            title: '従業者数',
            animation:{
                duration: 1000,
                easing: 'out',
            },
            hAxis: {title: '単位:人', titleTextStyle: {color: '#A9A9A9'}, maxValue: 5999}
        };
        return options;
    },
    
    _getObjectArray : function() {
        var main = [];
        $.each(LinkData.getWorks(), function(workKey, workValue) {
            $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) {
                $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) {
                    var array = [];
                    $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) {
                        var propLabel = propValue;
                        var arr = propValue.split("#");
                        if (arr.length > 1) {
                            propLabel = decodeURIComponent(arr[1]);
                        }
                        var obj = {};
                        var objValue = LinkData.getObjects(workValue, fileValue, subjValue, propValue)[0];
                        obj.property = propLabel;
                        obj.value = objValue;
                        array.push(obj);
                    });
                    main[subjValue] = array;
                });
            });
        });
        return main;
    },
    
    _getSubjectKeyValuePair : function() {
        var array = [];
        for (var key in this._mainArray) {
            var obj = {};
            var label = key.replace("http://ja.wikipedia.org/wiki/", "");
            obj.key = key;
jquery-1.7.1.min.js
https://www.google.com/jsapi
Playing...

jquery-1.7.1.min.js
https://www.google.com/jsapi