rails_charts 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +487 -0
  4. data/Rakefile +3 -0
  5. data/lib/rails_charts/area_chart.rb +31 -0
  6. data/lib/rails_charts/bar_chart.rb +25 -0
  7. data/lib/rails_charts/base_chart.rb +123 -0
  8. data/lib/rails_charts/calendar_chart.rb +36 -0
  9. data/lib/rails_charts/candlestick_chart.rb +25 -0
  10. data/lib/rails_charts/custom_chart.rb +14 -0
  11. data/lib/rails_charts/donut_chart.rb +36 -0
  12. data/lib/rails_charts/engine.rb +33 -0
  13. data/lib/rails_charts/funnel_chart.rb +30 -0
  14. data/lib/rails_charts/gauge_chart.rb +30 -0
  15. data/lib/rails_charts/helpers.rb +83 -0
  16. data/lib/rails_charts/javascript.rb +17 -0
  17. data/lib/rails_charts/line_chart.rb +78 -0
  18. data/lib/rails_charts/parallel_chart.rb +30 -0
  19. data/lib/rails_charts/pie_chart.rb +55 -0
  20. data/lib/rails_charts/radar_chart.rb +38 -0
  21. data/lib/rails_charts/ruby_ext.rb +28 -0
  22. data/lib/rails_charts/sankey_chart.rb +31 -0
  23. data/lib/rails_charts/scatter_chart.rb +34 -0
  24. data/lib/rails_charts/stacked_bar_chart.rb +13 -0
  25. data/lib/rails_charts/version.rb +3 -0
  26. data/lib/rails_charts.rb +43 -0
  27. data/vendor/assets/rails_charts/echarts.min.js +45 -0
  28. data/vendor/assets/rails_charts/extension/bmap.js +413 -0
  29. data/vendor/assets/rails_charts/extension/bmap.js.map +1 -0
  30. data/vendor/assets/rails_charts/extension/bmap.min.js +22 -0
  31. data/vendor/assets/rails_charts/extension/dataTool.js +436 -0
  32. data/vendor/assets/rails_charts/extension/dataTool.js.map +1 -0
  33. data/vendor/assets/rails_charts/extension/dataTool.min.js +22 -0
  34. data/vendor/assets/rails_charts/i18n/langCS-obj.js +172 -0
  35. data/vendor/assets/rails_charts/i18n/langCS.js +168 -0
  36. data/vendor/assets/rails_charts/i18n/langDE-obj.js +172 -0
  37. data/vendor/assets/rails_charts/i18n/langDE.js +168 -0
  38. data/vendor/assets/rails_charts/i18n/langEN-obj.js +173 -0
  39. data/vendor/assets/rails_charts/i18n/langEN.js +169 -0
  40. data/vendor/assets/rails_charts/i18n/langES-obj.js +111 -0
  41. data/vendor/assets/rails_charts/i18n/langES.js +107 -0
  42. data/vendor/assets/rails_charts/i18n/langFI-obj.js +111 -0
  43. data/vendor/assets/rails_charts/i18n/langFI.js +107 -0
  44. data/vendor/assets/rails_charts/i18n/langFR-obj.js +173 -0
  45. data/vendor/assets/rails_charts/i18n/langFR.js +169 -0
  46. data/vendor/assets/rails_charts/i18n/langIT-obj.js +173 -0
  47. data/vendor/assets/rails_charts/i18n/langIT.js +169 -0
  48. data/vendor/assets/rails_charts/i18n/langJA-obj.js +173 -0
  49. data/vendor/assets/rails_charts/i18n/langJA.js +169 -0
  50. data/vendor/assets/rails_charts/i18n/langKO-obj.js +173 -0
  51. data/vendor/assets/rails_charts/i18n/langKO.js +169 -0
  52. data/vendor/assets/rails_charts/i18n/langPL-obj.js +173 -0
  53. data/vendor/assets/rails_charts/i18n/langPL.js +169 -0
  54. data/vendor/assets/rails_charts/i18n/langPT-br-obj.js +174 -0
  55. data/vendor/assets/rails_charts/i18n/langPT-br.js +170 -0
  56. data/vendor/assets/rails_charts/i18n/langRO-obj.js +173 -0
  57. data/vendor/assets/rails_charts/i18n/langRO.js +169 -0
  58. data/vendor/assets/rails_charts/i18n/langRU-obj.js +174 -0
  59. data/vendor/assets/rails_charts/i18n/langRU.js +170 -0
  60. data/vendor/assets/rails_charts/i18n/langSI-obj.js +172 -0
  61. data/vendor/assets/rails_charts/i18n/langSI.js +168 -0
  62. data/vendor/assets/rails_charts/i18n/langTH-obj.js +111 -0
  63. data/vendor/assets/rails_charts/i18n/langTH.js +107 -0
  64. data/vendor/assets/rails_charts/i18n/langZH-obj.js +168 -0
  65. data/vendor/assets/rails_charts/i18n/langZH.js +164 -0
  66. data/vendor/assets/rails_charts/theme/azul.js +163 -0
  67. data/vendor/assets/rails_charts/theme/bee-inspired.js +178 -0
  68. data/vendor/assets/rails_charts/theme/blue.js +178 -0
  69. data/vendor/assets/rails_charts/theme/caravan.js +178 -0
  70. data/vendor/assets/rails_charts/theme/carp.js +163 -0
  71. data/vendor/assets/rails_charts/theme/cool.js +180 -0
  72. data/vendor/assets/rails_charts/theme/dark-blue.js +164 -0
  73. data/vendor/assets/rails_charts/theme/dark-bold.js +164 -0
  74. data/vendor/assets/rails_charts/theme/dark-digerati.js +164 -0
  75. data/vendor/assets/rails_charts/theme/dark-fresh-cut.js +164 -0
  76. data/vendor/assets/rails_charts/theme/dark-mushroom.js +164 -0
  77. data/vendor/assets/rails_charts/theme/dark.js +224 -0
  78. data/vendor/assets/rails_charts/theme/eduardo.js +178 -0
  79. data/vendor/assets/rails_charts/theme/forest.js +163 -0
  80. data/vendor/assets/rails_charts/theme/fresh-cut.js +163 -0
  81. data/vendor/assets/rails_charts/theme/fruit.js +178 -0
  82. data/vendor/assets/rails_charts/theme/gray.js +220 -0
  83. data/vendor/assets/rails_charts/theme/green.js +222 -0
  84. data/vendor/assets/rails_charts/theme/helianthus.js +263 -0
  85. data/vendor/assets/rails_charts/theme/infographic.js +236 -0
  86. data/vendor/assets/rails_charts/theme/inspired.js +163 -0
  87. data/vendor/assets/rails_charts/theme/jazz.js +163 -0
  88. data/vendor/assets/rails_charts/theme/london.js +163 -0
  89. data/vendor/assets/rails_charts/theme/macarons.js +240 -0
  90. data/vendor/assets/rails_charts/theme/macarons2.js +249 -0
  91. data/vendor/assets/rails_charts/theme/mint.js +155 -0
  92. data/vendor/assets/rails_charts/theme/red-velvet.js +163 -0
  93. data/vendor/assets/rails_charts/theme/red.js +225 -0
  94. data/vendor/assets/rails_charts/theme/roma.js +119 -0
  95. data/vendor/assets/rails_charts/theme/royal.js +163 -0
  96. data/vendor/assets/rails_charts/theme/sakura.js +140 -0
  97. data/vendor/assets/rails_charts/theme/shine.js +177 -0
  98. data/vendor/assets/rails_charts/theme/tech-blue.js +180 -0
  99. data/vendor/assets/rails_charts/theme/vintage.js +63 -0
  100. metadata +268 -0
@@ -0,0 +1,164 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts/lib/echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+ var contrastColor = '#eee';
45
+ var axisCommon = function() {
46
+ return {
47
+ axisLine: {
48
+ lineStyle: {
49
+ color: contrastColor
50
+ }
51
+ },
52
+ axisTick: {
53
+ lineStyle: {
54
+ color: contrastColor
55
+ }
56
+ },
57
+ axisLabel: {
58
+ color: contrastColor
59
+ },
60
+ splitLine: {
61
+ lineStyle: {
62
+ type: 'dashed',
63
+ color: '#aaa'
64
+ }
65
+ },
66
+ splitArea: {
67
+ areaStyle: {
68
+ color: contrastColor
69
+ }
70
+ }
71
+ };
72
+ };
73
+
74
+ var colorPalette = [
75
+ '#00a8c6',
76
+ '#40c0cb',
77
+ '#ebd3ad',
78
+ '#aee239',
79
+ '#8fbe00',
80
+ '#33e0ff',
81
+ '#b3f4ff',
82
+ '#e6ff99'
83
+ ];
84
+ var theme = {
85
+ color: colorPalette,
86
+ backgroundColor: '#333',
87
+ tooltip: {
88
+ axisPointer: {
89
+ lineStyle: {
90
+ color: contrastColor
91
+ },
92
+ crossStyle: {
93
+ color: contrastColor
94
+ }
95
+ }
96
+ },
97
+ legend: {
98
+ textStyle: {
99
+ color: contrastColor
100
+ }
101
+ },
102
+ title: {
103
+ textStyle: {
104
+ color: contrastColor
105
+ }
106
+ },
107
+ toolbox: {
108
+ iconStyle: {
109
+ borderColor: contrastColor
110
+ }
111
+ },
112
+
113
+ // Area scaling controller
114
+ dataZoom: {
115
+ dataBackgroundColor: '#eee', // Data background color
116
+ fillerColor: 'rgba(200,200,200,0.2)', // Fill the color
117
+ handleColor: '#00a8c6' // Handle color
118
+ },
119
+
120
+ timeline: {
121
+ itemStyle: {
122
+ color: colorPalette[1]
123
+ },
124
+ lineStyle: {
125
+ color: contrastColor
126
+ },
127
+ controlStyle: {
128
+ color: contrastColor,
129
+ borderColor: contrastColor
130
+ },
131
+ label: {
132
+ color: contrastColor
133
+ }
134
+ },
135
+
136
+ timeAxis: axisCommon(),
137
+ logAxis: axisCommon(),
138
+ valueAxis: axisCommon(),
139
+ categoryAxis: axisCommon(),
140
+
141
+ line: {
142
+ symbol: 'circle'
143
+ },
144
+ graph: {
145
+ color: colorPalette
146
+ },
147
+
148
+ gauge: {
149
+ axisLine: {
150
+ lineStyle: {
151
+ color: [
152
+ [0.2, '#40c0cb'],
153
+ [0.8, '#00a8c6'],
154
+ [1, '#8fbe00']
155
+ ],
156
+ width: 8
157
+ }
158
+ }
159
+ }
160
+ };
161
+
162
+ theme.categoryAxis.splitLine.show = false;
163
+ echarts.registerTheme('dark-fresh-cut', theme);
164
+ });
@@ -0,0 +1,164 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts/lib/echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+ var contrastColor = '#eee';
45
+ var axisCommon = function() {
46
+ return {
47
+ axisLine: {
48
+ lineStyle: {
49
+ color: contrastColor
50
+ }
51
+ },
52
+ axisTick: {
53
+ lineStyle: {
54
+ color: contrastColor
55
+ }
56
+ },
57
+ axisLabel: {
58
+ color: contrastColor
59
+ },
60
+ splitLine: {
61
+ lineStyle: {
62
+ type: 'dashed',
63
+ color: '#aaa'
64
+ }
65
+ },
66
+ splitArea: {
67
+ areaStyle: {
68
+ color: contrastColor
69
+ }
70
+ }
71
+ };
72
+ };
73
+
74
+ var colorPalette = [
75
+ '#cc0e00',
76
+ '#ff1a0a',
77
+ '#ff8880',
78
+ '#ffc180',
79
+ '#ffc2b0',
80
+ '#ffffff',
81
+ '#ff8880',
82
+ '#ffe6e6'
83
+ ];
84
+ var theme = {
85
+ color: colorPalette,
86
+ backgroundColor: '#333',
87
+ tooltip: {
88
+ axisPointer: {
89
+ lineStyle: {
90
+ color: contrastColor
91
+ },
92
+ crossStyle: {
93
+ color: contrastColor
94
+ }
95
+ }
96
+ },
97
+ legend: {
98
+ textStyle: {
99
+ color: contrastColor
100
+ }
101
+ },
102
+ title: {
103
+ textStyle: {
104
+ color: contrastColor
105
+ }
106
+ },
107
+ toolbox: {
108
+ iconStyle: {
109
+ borderColor: contrastColor
110
+ }
111
+ },
112
+
113
+ // Area scaling controller
114
+ dataZoom: {
115
+ dataBackgroundColor: '#eee', // Data background color
116
+ fillerColor: 'rgba(200,200,200,0.2)', // Fill the color
117
+ handleColor: '#cc0e00' // Handle color
118
+ },
119
+
120
+ timeline: {
121
+ itemStyle: {
122
+ color: colorPalette[1]
123
+ },
124
+ lineStyle: {
125
+ color: contrastColor
126
+ },
127
+ controlStyle: {
128
+ color: contrastColor,
129
+ borderColor: contrastColor
130
+ },
131
+ label: {
132
+ color: contrastColor
133
+ }
134
+ },
135
+
136
+ timeAxis: axisCommon(),
137
+ logAxis: axisCommon(),
138
+ valueAxis: axisCommon(),
139
+ categoryAxis: axisCommon(),
140
+
141
+ line: {
142
+ symbol: 'circle'
143
+ },
144
+ graph: {
145
+ color: colorPalette
146
+ },
147
+
148
+ gauge: {
149
+ axisLine: {
150
+ lineStyle: {
151
+ color: [
152
+ [0.2, '#ff1a0a'],
153
+ [0.8, '#cc0e00'],
154
+ [1, '#ffc2b0']
155
+ ],
156
+ width: 8
157
+ }
158
+ }
159
+ }
160
+ };
161
+
162
+ theme.categoryAxis.splitLine.show = false;
163
+ echarts.registerTheme('dark-mushroom', theme);
164
+ });
@@ -0,0 +1,224 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts/lib/echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+ var contrastColor = '#B9B8CE';
45
+ var backgroundColor = '#100C2A';
46
+ var axisCommon = function () {
47
+ return {
48
+ axisLine: {
49
+ lineStyle: {
50
+ color: contrastColor
51
+ }
52
+ },
53
+ splitLine: {
54
+ lineStyle: {
55
+ color: '#484753'
56
+ }
57
+ },
58
+ splitArea: {
59
+ areaStyle: {
60
+ color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']
61
+ }
62
+ },
63
+ minorSplitLine: {
64
+ lineStyle: {
65
+ color: '#20203B'
66
+ }
67
+ }
68
+ };
69
+ };
70
+
71
+ var colorPalette = [
72
+ '#4992ff',
73
+ '#7cffb2',
74
+ '#fddd60',
75
+ '#ff6e76',
76
+ '#58d9f9',
77
+ '#05c091',
78
+ '#ff8a45',
79
+ '#8d48e3',
80
+ '#dd79ff'
81
+ ];
82
+ var theme = {
83
+ darkMode: true,
84
+
85
+ color: colorPalette,
86
+ backgroundColor: backgroundColor,
87
+ axisPointer: {
88
+ lineStyle: {
89
+ color: '#817f91'
90
+ },
91
+ crossStyle: {
92
+ color: '#817f91'
93
+ },
94
+ label: {
95
+ // TODO Contrast of label backgorundColor
96
+ color: '#fff'
97
+ }
98
+ },
99
+ legend: {
100
+ textStyle: {
101
+ color: contrastColor
102
+ }
103
+ },
104
+ textStyle: {
105
+ color: contrastColor
106
+ },
107
+ title: {
108
+ textStyle: {
109
+ color: '#EEF1FA'
110
+ },
111
+ subtextStyle: {
112
+ color: '#B9B8CE'
113
+ }
114
+ },
115
+ toolbox: {
116
+ iconStyle: {
117
+ borderColor: contrastColor
118
+ }
119
+ },
120
+ dataZoom: {
121
+ borderColor: '#71708A',
122
+ textStyle: {
123
+ color: contrastColor
124
+ },
125
+ brushStyle: {
126
+ color: 'rgba(135,163,206,0.3)'
127
+ },
128
+ handleStyle: {
129
+ color: '#353450',
130
+ borderColor: '#C5CBE3'
131
+ },
132
+ moveHandleStyle: {
133
+ color: '#B0B6C3',
134
+ opacity: 0.3
135
+ },
136
+ fillerColor: 'rgba(135,163,206,0.2)',
137
+ emphasis: {
138
+ handleStyle: {
139
+ borderColor: '#91B7F2',
140
+ color: '#4D587D'
141
+ },
142
+ moveHandleStyle: {
143
+ color: '#636D9A',
144
+ opacity: 0.7
145
+ }
146
+ },
147
+ dataBackground: {
148
+ lineStyle: {
149
+ color: '#71708A',
150
+ width: 1
151
+ },
152
+ areaStyle: {
153
+ color: '#71708A'
154
+ }
155
+ },
156
+ selectedDataBackground: {
157
+ lineStyle: {
158
+ color: '#87A3CE'
159
+ },
160
+ areaStyle: {
161
+ color: '#87A3CE'
162
+ }
163
+ }
164
+ },
165
+ visualMap: {
166
+ textStyle: {
167
+ color: contrastColor
168
+ }
169
+ },
170
+ timeline: {
171
+ lineStyle: {
172
+ color: contrastColor
173
+ },
174
+ label: {
175
+ color: contrastColor
176
+ },
177
+ controlStyle: {
178
+ color: contrastColor,
179
+ borderColor: contrastColor
180
+ }
181
+ },
182
+ calendar: {
183
+ itemStyle: {
184
+ color: backgroundColor
185
+ },
186
+ dayLabel: {
187
+ color: contrastColor
188
+ },
189
+ monthLabel: {
190
+ color: contrastColor
191
+ },
192
+ yearLabel: {
193
+ color: contrastColor
194
+ }
195
+ },
196
+ timeAxis: axisCommon(),
197
+ logAxis: axisCommon(),
198
+ valueAxis: axisCommon(),
199
+ categoryAxis: axisCommon(),
200
+
201
+ line: {
202
+ symbol: 'circle'
203
+ },
204
+ graph: {
205
+ color: colorPalette
206
+ },
207
+ gauge: {
208
+ title: {
209
+ color: contrastColor
210
+ }
211
+ },
212
+ candlestick: {
213
+ itemStyle: {
214
+ color: '#FD1050',
215
+ color0: '#0CF49B',
216
+ borderColor: '#FD1050',
217
+ borderColor0: '#0CF49B'
218
+ }
219
+ }
220
+ };
221
+
222
+ theme.categoryAxis.splitLine.show = false;
223
+ echarts.registerTheme('dark', theme);
224
+ });