highcharts_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +106 -0
  9. data/Rakefile +6 -0
  10. data/highcharts_rails.gemspec +27 -0
  11. data/lib/highcharts_rails/version.rb +3 -0
  12. data/lib/highcharts_rails.rb +8 -0
  13. data/vendor/assets/javascripts/highcharts-3d.src.js +2139 -0
  14. data/vendor/assets/javascripts/highcharts-more.src.js +2982 -0
  15. data/vendor/assets/javascripts/highcharts.src.js +22947 -0
  16. data/vendor/assets/javascripts/js/highcharts-3d.src.js +2085 -0
  17. data/vendor/assets/javascripts/js/highcharts-more.src.js +2820 -0
  18. data/vendor/assets/javascripts/js/highcharts.src.js +20917 -0
  19. data/vendor/assets/javascripts/js/modules/accessibility.src.js +1072 -0
  20. data/vendor/assets/javascripts/js/modules/annotations.src.js +408 -0
  21. data/vendor/assets/javascripts/js/modules/boost.src.js +652 -0
  22. data/vendor/assets/javascripts/js/modules/broken-axis.src.js +338 -0
  23. data/vendor/assets/javascripts/js/modules/data.src.js +981 -0
  24. data/vendor/assets/javascripts/js/modules/drilldown.src.js +756 -0
  25. data/vendor/assets/javascripts/js/modules/exporting.src.js +953 -0
  26. data/vendor/assets/javascripts/js/modules/funnel.src.js +290 -0
  27. data/vendor/assets/javascripts/js/modules/gantt.src.js +791 -0
  28. data/vendor/assets/javascripts/js/modules/grid-axis.src.js +545 -0
  29. data/vendor/assets/javascripts/js/modules/heatmap.src.js +798 -0
  30. data/vendor/assets/javascripts/js/modules/no-data-to-display.src.js +150 -0
  31. data/vendor/assets/javascripts/js/modules/offline-exporting.src.js +492 -0
  32. data/vendor/assets/javascripts/js/modules/overlapping-datalabels.src.js +164 -0
  33. data/vendor/assets/javascripts/js/modules/series-label.src.js +606 -0
  34. data/vendor/assets/javascripts/js/modules/solid-gauge.src.js +305 -0
  35. data/vendor/assets/javascripts/js/modules/treemap.src.js +881 -0
  36. data/vendor/assets/javascripts/js/modules/xrange-series.src.js +254 -0
  37. data/vendor/assets/javascripts/js/themes/dark-blue.js +317 -0
  38. data/vendor/assets/javascripts/js/themes/dark-green.js +314 -0
  39. data/vendor/assets/javascripts/js/themes/dark-unica.js +243 -0
  40. data/vendor/assets/javascripts/js/themes/gray.js +326 -0
  41. data/vendor/assets/javascripts/js/themes/grid-light.js +99 -0
  42. data/vendor/assets/javascripts/js/themes/grid.js +131 -0
  43. data/vendor/assets/javascripts/js/themes/sand-signika.js +129 -0
  44. data/vendor/assets/javascripts/js/themes/skies.js +112 -0
  45. data/vendor/assets/javascripts/lib/canvg.src.js +3073 -0
  46. data/vendor/assets/javascripts/lib/jspdf.src.js +3031 -0
  47. data/vendor/assets/javascripts/lib/rgbcolor.src.js +299 -0
  48. data/vendor/assets/javascripts/lib/svg2pdf.src.js +1451 -0
  49. data/vendor/assets/javascripts/modules/accessibility.src.js +1072 -0
  50. data/vendor/assets/javascripts/modules/annotations.src.js +408 -0
  51. data/vendor/assets/javascripts/modules/boost.src.js +652 -0
  52. data/vendor/assets/javascripts/modules/broken-axis.src.js +338 -0
  53. data/vendor/assets/javascripts/modules/data.src.js +981 -0
  54. data/vendor/assets/javascripts/modules/drilldown.src.js +797 -0
  55. data/vendor/assets/javascripts/modules/exporting.src.js +882 -0
  56. data/vendor/assets/javascripts/modules/funnel.src.js +304 -0
  57. data/vendor/assets/javascripts/modules/gantt.src.js +815 -0
  58. data/vendor/assets/javascripts/modules/grid-axis.src.js +547 -0
  59. data/vendor/assets/javascripts/modules/heatmap.src.js +810 -0
  60. data/vendor/assets/javascripts/modules/no-data-to-display.src.js +161 -0
  61. data/vendor/assets/javascripts/modules/offline-exporting.src.js +492 -0
  62. data/vendor/assets/javascripts/modules/overlapping-datalabels.src.js +164 -0
  63. data/vendor/assets/javascripts/modules/series-label.src.js +606 -0
  64. data/vendor/assets/javascripts/modules/solid-gauge.src.js +316 -0
  65. data/vendor/assets/javascripts/modules/treemap.src.js +935 -0
  66. data/vendor/assets/javascripts/modules/xrange-series.src.js +276 -0
  67. data/vendor/assets/javascripts/themes/dark-blue.js +317 -0
  68. data/vendor/assets/javascripts/themes/dark-green.js +314 -0
  69. data/vendor/assets/javascripts/themes/dark-unica.js +243 -0
  70. data/vendor/assets/javascripts/themes/gray.js +326 -0
  71. data/vendor/assets/javascripts/themes/grid-light.js +99 -0
  72. data/vendor/assets/javascripts/themes/grid.js +131 -0
  73. data/vendor/assets/javascripts/themes/sand-signika.js +129 -0
  74. data/vendor/assets/javascripts/themes/skies.js +112 -0
  75. data/vendor/assets/stylesheets/highcharts.scss +610 -0
  76. metadata +161 -0
@@ -0,0 +1,254 @@
1
+ /**
2
+ * @license Highcharts JS v5.0.6 (2016-12-07)
3
+ * X-range series
4
+ *
5
+ * (c) 2010-2016 Torstein Honsi, Lars A. V. Cabrera
6
+ *
7
+ * --- WORK IN PROGRESS ---
8
+ *
9
+ * License: www.highcharts.com/license
10
+ */
11
+ (function(factory) {
12
+ if (typeof module === 'object' && module.exports) {
13
+ module.exports = factory;
14
+ } else {
15
+ factory(Highcharts);
16
+ }
17
+ }(function(Highcharts) {
18
+ (function(H) {
19
+ /**
20
+ * (c) 2014-2016 Highsoft AS
21
+ * Authors: Torstein Honsi, Lars A. V. Cabrera
22
+ *
23
+ * License: www.highcharts.com/license
24
+ */
25
+ 'use strict';
26
+
27
+ var defaultPlotOptions = H.getOptions().plotOptions,
28
+ color = H.Color,
29
+ columnType = H.seriesTypes.column,
30
+ each = H.each,
31
+ extendClass = H.extendClass,
32
+ isNumber = H.isNumber,
33
+ isObject = H.isObject,
34
+ merge = H.merge,
35
+ pick = H.pick,
36
+ seriesTypes = H.seriesTypes,
37
+ wrap = H.wrap,
38
+ Axis = H.Axis,
39
+ Point = H.Point,
40
+ Series = H.Series,
41
+ pointFormat = '<span style="color:{point.color}">' +
42
+ '\u25CF' +
43
+ '</span> {series.name}: <b>{point.yCategory}</b><br/>',
44
+ xrange = 'xrange';
45
+
46
+ defaultPlotOptions.xrange = merge(defaultPlotOptions.column, {
47
+ tooltip: {
48
+ pointFormat: pointFormat
49
+ }
50
+ });
51
+ seriesTypes.xrange = extendClass(columnType, {
52
+ pointClass: extendClass(Point, {
53
+ // Add x2 and yCategory to the available properties for tooltip formats
54
+ getLabelConfig: function() {
55
+ var cfg = Point.prototype.getLabelConfig.call(this);
56
+
57
+ cfg.x2 = this.x2;
58
+ cfg.yCategory = this.yCategory = this.series.yAxis.categories && this.series.yAxis.categories[this.y];
59
+ return cfg;
60
+ }
61
+ }),
62
+ type: xrange,
63
+ forceDL: true,
64
+ parallelArrays: ['x', 'x2', 'y'],
65
+ requireSorting: false,
66
+ animate: seriesTypes.line.prototype.animate,
67
+
68
+ /**
69
+ * Borrow the column series metrics, but with swapped axes. This gives free access
70
+ * to features like groupPadding, grouping, pointWidth etc.
71
+ */
72
+ getColumnMetrics: function() {
73
+ var metrics,
74
+ chart = this.chart;
75
+
76
+ function swapAxes() {
77
+ each(chart.series, function(s) {
78
+ var xAxis = s.xAxis;
79
+ s.xAxis = s.yAxis;
80
+ s.yAxis = xAxis;
81
+ });
82
+ }
83
+
84
+ swapAxes();
85
+
86
+ this.yAxis.closestPointRange = 1;
87
+ metrics = columnType.prototype.getColumnMetrics.call(this);
88
+
89
+ swapAxes();
90
+
91
+ return metrics;
92
+ },
93
+
94
+ /**
95
+ * Override cropData to show a point where x is outside visible range
96
+ * but x2 is outside.
97
+ */
98
+ cropData: function(xData, yData, min, max) {
99
+
100
+ // Replace xData with x2Data to find the appropriate cropStart
101
+ var cropData = Series.prototype.cropData,
102
+ crop = cropData.call(this, this.x2Data, yData, min, max);
103
+
104
+ // Re-insert the cropped xData
105
+ crop.xData = xData.slice(crop.start, crop.end);
106
+
107
+ return crop;
108
+ },
109
+
110
+ translate: function() {
111
+ columnType.prototype.translate.apply(this, arguments);
112
+ var series = this,
113
+ xAxis = series.xAxis,
114
+ metrics = series.columnMetrics,
115
+ minPointLength = series.options.minPointLength || 0;
116
+
117
+ each(series.points, function(point) {
118
+ var plotX = point.plotX,
119
+ posX = pick(point.x2, point.x + (point.len || 0)),
120
+ plotX2 = xAxis.toPixels(posX, true),
121
+ width = plotX2 - plotX,
122
+ widthDifference,
123
+ shapeArgs,
124
+ partialFill;
125
+
126
+ if (minPointLength) {
127
+ widthDifference = minPointLength - width;
128
+ if (widthDifference < 0) {
129
+ widthDifference = 0;
130
+ }
131
+ plotX -= widthDifference / 2;
132
+ plotX2 += widthDifference / 2;
133
+ }
134
+
135
+ plotX = Math.max(plotX, -10);
136
+ plotX2 = Math.min(Math.max(plotX2, -10), xAxis.len + 10);
137
+
138
+ point.shapeArgs = {
139
+ x: plotX,
140
+ y: point.plotY + metrics.offset,
141
+ width: plotX2 - plotX,
142
+ height: metrics.width
143
+ };
144
+ point.tooltipPos[0] += width / 2;
145
+ point.tooltipPos[1] -= metrics.width / 2;
146
+
147
+ // Add a partShapeArgs to the point, based on the shapeArgs property
148
+ partialFill = point.partialFill;
149
+ if (partialFill) {
150
+ // Get the partial fill amount
151
+ if (isObject(partialFill)) {
152
+ partialFill = partialFill.amount;
153
+ }
154
+ // If it was not a number, assume 0
155
+ if (!isNumber(partialFill)) {
156
+ partialFill = 0;
157
+ }
158
+ shapeArgs = point.shapeArgs;
159
+ point.partShapeArgs = {
160
+ x: shapeArgs.x,
161
+ y: shapeArgs.y + 1,
162
+ width: shapeArgs.width * partialFill,
163
+ height: shapeArgs.height - 2
164
+ };
165
+ }
166
+ });
167
+ },
168
+
169
+ drawPoints: function() {
170
+ var series = this,
171
+ chart = this.chart,
172
+ options = series.options,
173
+ renderer = chart.renderer,
174
+ animationLimit = options.animationLimit || 250,
175
+ verb = chart.pointCount < animationLimit ? 'animate' : 'attr';
176
+
177
+ // draw the columns
178
+ each(series.points, function(point) {
179
+ var plotY = point.plotY,
180
+ graphic = point.graphic,
181
+ type = point.shapeType,
182
+ shapeArgs = point.shapeArgs,
183
+ partShapeArgs = point.partShapeArgs,
184
+ seriesOpts = series.options,
185
+ pfOptions = point.partialFill,
186
+ fill,
187
+ state = point.selected && 'select',
188
+ cutOff = options.stacking && !options.borderRadius;
189
+
190
+ if (isNumber(plotY) && point.y !== null) {
191
+ if (graphic) { // update
192
+ point.graphicOriginal[verb](
193
+ merge(shapeArgs)
194
+ );
195
+ if (partShapeArgs) {
196
+ point.graphicOverlay[verb](
197
+ merge(partShapeArgs)
198
+ );
199
+ }
200
+
201
+ } else {
202
+ point.graphic = graphic = renderer.g('point')
203
+ .attr({
204
+ 'class': point.getClassName()
205
+ })
206
+ .add(point.group || series.group);
207
+
208
+ point.graphicOriginal = renderer[type](shapeArgs)
209
+ .addClass('highcharts-partfill-original')
210
+ .add(graphic);
211
+ if (partShapeArgs) {
212
+ point.graphicOverlay = renderer[type](partShapeArgs)
213
+ .addClass('highcharts-partfill-overlay')
214
+ .add(graphic);
215
+ }
216
+ }
217
+
218
+
219
+
220
+ } else if (graphic) {
221
+ point.graphic = graphic.destroy(); // #1269
222
+ }
223
+ });
224
+ }
225
+ });
226
+
227
+ /**
228
+ * Max x2 should be considered in xAxis extremes
229
+ */
230
+ wrap(Axis.prototype, 'getSeriesExtremes', function(proceed) {
231
+ var axis = this,
232
+ series = axis.series,
233
+ dataMax,
234
+ modMax;
235
+
236
+ proceed.call(this);
237
+ if (axis.isXAxis && series.type === xrange) {
238
+ dataMax = pick(axis.dataMax, Number.MIN_VALUE);
239
+ each(this.series, function(series) {
240
+ each(series.x2Data || [], function(val) {
241
+ if (val > dataMax) {
242
+ dataMax = val;
243
+ modMax = true;
244
+ }
245
+ });
246
+ });
247
+ if (modMax) {
248
+ axis.dataMax = dataMax;
249
+ }
250
+ }
251
+ });
252
+
253
+ }(Highcharts));
254
+ }));
@@ -0,0 +1,317 @@
1
+ /**
2
+ * @license Highcharts JS v5.0.6 (2016-12-07)
3
+ *
4
+ * (c) 2009-2016 Torstein Honsi
5
+ *
6
+ * License: www.highcharts.com/license
7
+ */
8
+ (function(factory) {
9
+ if (typeof module === 'object' && module.exports) {
10
+ module.exports = factory;
11
+ } else {
12
+ factory(Highcharts);
13
+ }
14
+ }(function(Highcharts) {
15
+ (function(Highcharts) {
16
+ /**
17
+ * (c) 2010-2016 Torstein Honsi
18
+ *
19
+ * License: www.highcharts.com/license
20
+ *
21
+ * Dark blue theme for Highcharts JS
22
+ * @author Torstein Honsi
23
+ */
24
+ 'use strict';
25
+ Highcharts.theme = {
26
+ colors: ['#DDDF0D', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
27
+ '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
28
+ ],
29
+ chart: {
30
+ backgroundColor: {
31
+ linearGradient: {
32
+ x1: 0,
33
+ y1: 0,
34
+ x2: 1,
35
+ y2: 1
36
+ },
37
+ stops: [
38
+ [0, 'rgb(48, 48, 96)'],
39
+ [1, 'rgb(0, 0, 0)']
40
+ ]
41
+ },
42
+ borderColor: '#000000',
43
+ borderWidth: 2,
44
+ className: 'dark-container',
45
+ plotBackgroundColor: 'rgba(255, 255, 255, .1)',
46
+ plotBorderColor: '#CCCCCC',
47
+ plotBorderWidth: 1
48
+ },
49
+ title: {
50
+ style: {
51
+ color: '#C0C0C0',
52
+ font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
53
+ }
54
+ },
55
+ subtitle: {
56
+ style: {
57
+ color: '#666666',
58
+ font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
59
+ }
60
+ },
61
+ xAxis: {
62
+ gridLineColor: '#333333',
63
+ gridLineWidth: 1,
64
+ labels: {
65
+ style: {
66
+ color: '#A0A0A0'
67
+ }
68
+ },
69
+ lineColor: '#A0A0A0',
70
+ tickColor: '#A0A0A0',
71
+ title: {
72
+ style: {
73
+ color: '#CCC',
74
+ fontWeight: 'bold',
75
+ fontSize: '12px',
76
+ fontFamily: 'Trebuchet MS, Verdana, sans-serif'
77
+
78
+ }
79
+ }
80
+ },
81
+ yAxis: {
82
+ gridLineColor: '#333333',
83
+ labels: {
84
+ style: {
85
+ color: '#A0A0A0'
86
+ }
87
+ },
88
+ lineColor: '#A0A0A0',
89
+ minorTickInterval: null,
90
+ tickColor: '#A0A0A0',
91
+ tickWidth: 1,
92
+ title: {
93
+ style: {
94
+ color: '#CCC',
95
+ fontWeight: 'bold',
96
+ fontSize: '12px',
97
+ fontFamily: 'Trebuchet MS, Verdana, sans-serif'
98
+ }
99
+ }
100
+ },
101
+ tooltip: {
102
+ backgroundColor: 'rgba(0, 0, 0, 0.75)',
103
+ style: {
104
+ color: '#F0F0F0'
105
+ }
106
+ },
107
+ toolbar: {
108
+ itemStyle: {
109
+ color: 'silver'
110
+ }
111
+ },
112
+ plotOptions: {
113
+ line: {
114
+ dataLabels: {
115
+ color: '#CCC'
116
+ },
117
+ marker: {
118
+ lineColor: '#333'
119
+ }
120
+ },
121
+ spline: {
122
+ marker: {
123
+ lineColor: '#333'
124
+ }
125
+ },
126
+ scatter: {
127
+ marker: {
128
+ lineColor: '#333'
129
+ }
130
+ },
131
+ candlestick: {
132
+ lineColor: 'white'
133
+ }
134
+ },
135
+ legend: {
136
+ itemStyle: {
137
+ font: '9pt Trebuchet MS, Verdana, sans-serif',
138
+ color: '#A0A0A0'
139
+ },
140
+ itemHoverStyle: {
141
+ color: '#FFF'
142
+ },
143
+ itemHiddenStyle: {
144
+ color: '#444'
145
+ }
146
+ },
147
+ credits: {
148
+ style: {
149
+ color: '#666'
150
+ }
151
+ },
152
+ labels: {
153
+ style: {
154
+ color: '#CCC'
155
+ }
156
+ },
157
+
158
+ navigation: {
159
+ buttonOptions: {
160
+ symbolStroke: '#DDDDDD',
161
+ hoverSymbolStroke: '#FFFFFF',
162
+ theme: {
163
+ fill: {
164
+ linearGradient: {
165
+ x1: 0,
166
+ y1: 0,
167
+ x2: 0,
168
+ y2: 1
169
+ },
170
+ stops: [
171
+ [0.4, '#606060'],
172
+ [0.6, '#333333']
173
+ ]
174
+ },
175
+ stroke: '#000000'
176
+ }
177
+ }
178
+ },
179
+
180
+ // scroll charts
181
+ rangeSelector: {
182
+ buttonTheme: {
183
+ fill: {
184
+ linearGradient: {
185
+ x1: 0,
186
+ y1: 0,
187
+ x2: 0,
188
+ y2: 1
189
+ },
190
+ stops: [
191
+ [0.4, '#888'],
192
+ [0.6, '#555']
193
+ ]
194
+ },
195
+ stroke: '#000000',
196
+ style: {
197
+ color: '#CCC',
198
+ fontWeight: 'bold'
199
+ },
200
+ states: {
201
+ hover: {
202
+ fill: {
203
+ linearGradient: {
204
+ x1: 0,
205
+ y1: 0,
206
+ x2: 0,
207
+ y2: 1
208
+ },
209
+ stops: [
210
+ [0.4, '#BBB'],
211
+ [0.6, '#888']
212
+ ]
213
+ },
214
+ stroke: '#000000',
215
+ style: {
216
+ color: 'white'
217
+ }
218
+ },
219
+ select: {
220
+ fill: {
221
+ linearGradient: {
222
+ x1: 0,
223
+ y1: 0,
224
+ x2: 0,
225
+ y2: 1
226
+ },
227
+ stops: [
228
+ [0.1, '#000'],
229
+ [0.3, '#333']
230
+ ]
231
+ },
232
+ stroke: '#000000',
233
+ style: {
234
+ color: 'yellow'
235
+ }
236
+ }
237
+ }
238
+ },
239
+ inputStyle: {
240
+ backgroundColor: '#333',
241
+ color: 'silver'
242
+ },
243
+ labelStyle: {
244
+ color: 'silver'
245
+ }
246
+ },
247
+
248
+ navigator: {
249
+ handles: {
250
+ backgroundColor: '#666',
251
+ borderColor: '#AAA'
252
+ },
253
+ outlineColor: '#CCC',
254
+ maskFill: 'rgba(16, 16, 16, 0.5)',
255
+ series: {
256
+ color: '#7798BF',
257
+ lineColor: '#A6C7ED'
258
+ }
259
+ },
260
+
261
+ scrollbar: {
262
+ barBackgroundColor: {
263
+ linearGradient: {
264
+ x1: 0,
265
+ y1: 0,
266
+ x2: 0,
267
+ y2: 1
268
+ },
269
+ stops: [
270
+ [0.4, '#888'],
271
+ [0.6, '#555']
272
+ ]
273
+ },
274
+ barBorderColor: '#CCC',
275
+ buttonArrowColor: '#CCC',
276
+ buttonBackgroundColor: {
277
+ linearGradient: {
278
+ x1: 0,
279
+ y1: 0,
280
+ x2: 0,
281
+ y2: 1
282
+ },
283
+ stops: [
284
+ [0.4, '#888'],
285
+ [0.6, '#555']
286
+ ]
287
+ },
288
+ buttonBorderColor: '#CCC',
289
+ rifleColor: '#FFF',
290
+ trackBackgroundColor: {
291
+ linearGradient: {
292
+ x1: 0,
293
+ y1: 0,
294
+ x2: 0,
295
+ y2: 1
296
+ },
297
+ stops: [
298
+ [0, '#000'],
299
+ [1, '#333']
300
+ ]
301
+ },
302
+ trackBorderColor: '#666'
303
+ },
304
+
305
+ // special colors for some of the
306
+ legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
307
+ background2: 'rgb(35, 35, 70)',
308
+ dataLabelsColor: '#444',
309
+ textColor: '#C0C0C0',
310
+ maskColor: 'rgba(255,255,255,0.3)'
311
+ };
312
+
313
+ // Apply the theme
314
+ Highcharts.setOptions(Highcharts.theme);
315
+
316
+ }(Highcharts));
317
+ }));