-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline-chart.xml
151 lines (136 loc) · 8.31 KB
/
line-chart.xml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs
title="Corechart line chart"
description="Copy of google's line chart gadget, but usees the new corechart package."
author="Todd Wieck"
author_affiliation=""
author_email=""
screenshot="https://www.google.com/ig/modules/line-chart.png"
thumbnail="https://www.google.com/ig/modules/line-chart-thm.png">
<Require feature="settitle" />
<Require feature="idi" />
<Require feature="locked-domain" />
<Locale messages="https://www.google.com/ig/modules/chart_content/en_ALL.xml" />
<Locale lang="ar" messages="https://www.google.com/ig/modules/chart_content/ar_ALL.xml" language_direction="rtl" />
<Locale lang="bg" messages="https://www.google.com/ig/modules/chart_content/bg_ALL.xml" />
<Locale lang="ca" messages="https://www.google.com/ig/modules/chart_content/ca_ALL.xml" />
<Locale lang="cs" messages="https://www.google.com/ig/modules/chart_content/cs_ALL.xml" />
<Locale lang="da" messages="https://www.google.com/ig/modules/chart_content/da_ALL.xml" />
<Locale lang="de" messages="https://www.google.com/ig/modules/chart_content/de_ALL.xml" />
<Locale lang="el" messages="https://www.google.com/ig/modules/chart_content/el_ALL.xml" />
<Locale lang="en-GB" messages="https://www.google.com/ig/modules/chart_content/en_GB.xml" />
<Locale lang="es" messages="https://www.google.com/ig/modules/chart_content/es_ALL.xml" />
<Locale lang="et" messages="https://www.google.com/ig/modules/chart_content/et_ALL.xml" />
<Locale lang="fi" messages="https://www.google.com/ig/modules/chart_content/fi_ALL.xml" />
<Locale lang="fr" messages="https://www.google.com/ig/modules/chart_content/fr_ALL.xml" />
<Locale lang="hi" messages="https://www.google.com/ig/modules/chart_content/hi_ALL.xml" />
<Locale lang="hr" messages="https://www.google.com/ig/modules/chart_content/hr_ALL.xml" />
<Locale lang="hu" messages="https://www.google.com/ig/modules/chart_content/hu_ALL.xml" />
<Locale lang="hy" messages="https://www.google.com/ig/modules/chart_content/hy_ALL.xml" />
<Locale lang="id" messages="https://www.google.com/ig/modules/chart_content/id_ALL.xml" />
<Locale lang="is" messages="https://www.google.com/ig/modules/chart_content/is_ALL.xml" />
<Locale lang="it" messages="https://www.google.com/ig/modules/chart_content/it_ALL.xml" />
<Locale lang="iw" messages="https://www.google.com/ig/modules/chart_content/iw_ALL.xml" language_direction="rtl" />
<Locale lang="ja" messages="https://www.google.com/ig/modules/chart_content/ja_ALL.xml" />
<Locale lang="ko" messages="https://www.google.com/ig/modules/chart_content/ko_ALL.xml" />
<Locale lang="lt" messages="https://www.google.com/ig/modules/chart_content/lt_ALL.xml" />
<Locale lang="lv" messages="https://www.google.com/ig/modules/chart_content/lv_ALL.xml" />
<Locale lang="ms" messages="https://www.google.com/ig/modules/chart_content/ms_ALL.xml" />
<Locale lang="nl" messages="https://www.google.com/ig/modules/chart_content/nl_ALL.xml" />
<Locale lang="no" messages="https://www.google.com/ig/modules/chart_content/no_ALL.xml" />
<Locale lang="pl" messages="https://www.google.com/ig/modules/chart_content/pl_ALL.xml" />
<Locale lang="pt-BR" messages="https://www.google.com/ig/modules/chart_content/pt_BR.xml" />
<Locale lang="pt-PT" messages="https://www.google.com/ig/modules/chart_content/pt_PT.xml" />
<Locale lang="ro" messages="https://www.google.com/ig/modules/chart_content/ro_ALL.xml" />
<Locale lang="ru" messages="https://www.google.com/ig/modules/chart_content/ru_ALL.xml" />
<Locale lang="sl" messages="https://www.google.com/ig/modules/chart_content/sl_ALL.xml" />
<Locale lang="sk" messages="https://www.google.com/ig/modules/chart_content/sk_ALL.xml" />
<Locale lang="sr" messages="https://www.google.com/ig/modules/chart_content/sr_ALL.xml" />
<Locale lang="sv" messages="https://www.google.com/ig/modules/chart_content/sv_ALL.xml" />
<Locale lang="th" messages="https://www.google.com/ig/modules/chart_content/th_ALL.xml" />
<Locale lang="tl" messages="https://www.google.com/ig/modules/chart_content/tl_ALL.xml" />
<Locale lang="tr" messages="https://www.google.com/ig/modules/chart_content/tr_ALL.xml" />
<Locale lang="uk" messages="https://www.google.com/ig/modules/chart_content/uk_ALL.xml" />
<Locale lang="vi" messages="https://www.google.com/ig/modules/chart_content/vi_ALL.xml" />
<Locale lang="zh-CN" messages="https://www.google.com/ig/modules/chart_content/zh_CN.xml" />
<Locale lang="zh-TW" messages="https://www.google.com/ig/modules/chart_content/zh_TW.xml" />
</ModulePrefs>
<UserPref name="_table_query_url" display_name="__MSG_tablequeryurl__" required="true" />
<UserPref name="title" display_name="__MSG_title__" required="false" />
<UserPref name="chartTitle" display_name="__MSG_chartTitle__" required="false" />
<UserPref name="labelx" display_name="__MSG_labelx__" required="false" />
<UserPref name="labely" display_name="__MSG_labely__" required="false" />
<UserPref name="legend" display_name="__MSG_legend__" default_value="__MSG_onRight__" datatype="enum" required="false">
<EnumValue value="0" display_value="__MSG_onRight__" />
<EnumValue value="1" display_value="__MSG_onLeft__" />
<EnumValue value="2" display_value="__MSG_onTop__" />
<EnumValue value="3" display_value="__MSG_onBottom__" />
<EnumValue value="4" display_value="__MSG_noLegend__" />
</UserPref>
<UserPref name="smoothline" display_name="__MSG_smoothline__" datatype="bool" />
<UserPref name="showpoints" display_name="__MSG_showpoints__" datatype="bool" default_value="true"/>
<UserPref name="min" display_name="__MSG_min__" />
<UserPref name="max" display_name="__MSG_max__" />
<UserPref name="_table_query_refresh_interval" display_name="__MSG_tablequeryrefreshinterval__" default_value="300" datatype="enum" required="false">
<EnumValue value="0" display_value="__MSG_never__" />
<EnumValue value="60" display_value="1" />
<EnumValue value="300" display_value="5" />
<EnumValue value="1800" display_value="30" />
</UserPref>
<Content type="html"><![CDATA[
<div id="loading"><img src="https://www.google.com/ig/images/spinner.gif" /></div>
<div id="chart"></div>
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
_IG_RegisterOnloadHandler(loadVisualizationAPI);
var lineChart;
var options = {};
var prefs = new _IG_Prefs();
var title = prefs.getString('title');
if (title) {
_IG_SetTitle(title);
}
function loadVisualizationAPI() {
google.load('visualization', '1', {packages: ['corechart']});
google.setOnLoadCallback(init);
};
var gadgetHelper;
function init() {
gadgetHelper = new google.visualization.GadgetHelper();
var container = document.getElementById('chart');
container.style.width = document.body.clientWidth;
container.style.height = document.body.clientHeight;
lineChart = new google.visualization.LineChart(container);
options['title'] = prefs.getString('chartTitle');
options['titleX'] = prefs.getString('labelx');
options['titleY'] = prefs.getString('labely');
options['isStacked'] = prefs.getBool('stacked');
options['smoothLine'] = prefs.getBool('smoothline');
options['pointSize'] = prefs.getBool('showpoints') ? null : 0;
var legendOptions = ['right', 'left', 'top', 'bottom', 'none'];
options['legend'] = legendOptions[prefs.getInt('legend')];
if (prefs.getString('min') != '') {
options['min'] = prefs.getInt('min');
}
if (prefs.getString('max') != '') {
options['max'] = prefs.getInt('max');
}
var query = gadgetHelper.createQueryFromPrefs(prefs);
query.send(responseHandler);
};
function responseHandler(response) {
// Remove the loading message (if exists).
var loadingMsgContainer = document.getElementById('loading');
loadingMsgContainer.style.display = 'none';
if (!gadgetHelper.validateResponse(response)) {
// Default error handling was done, just leave.
return;
}
var dataTable = response.getDataTable();
lineChart.draw(dataTable, options);
};
</script>
]]>
</Content>
</Module>