ambling 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +20 -0
- data/README +188 -0
- data/Rakefile +24 -0
- data/ambling.gemspec +24 -0
- data/init.rb +4 -0
- data/lib/ambling.rb +10 -0
- data/lib/ambling/base.rb +69 -0
- data/lib/ambling/column.rb +1332 -0
- data/lib/ambling/data.rb +255 -0
- data/lib/ambling/line.rb +1822 -0
- data/lib/ambling/pie.rb +830 -0
- data/lib/ambling/railtie.rb +12 -0
- data/lib/ambling/stock.rb +1964 -0
- data/lib/ambling/utils.rb +120 -0
- data/lib/ambling/version.rb +3 -0
- data/lib/ambling/xy.rb +1511 -0
- data/lib/ambling_helper.rb +83 -0
- data/test/base_test.rb +54 -0
- data/test/data_test.rb +82 -0
- data/test/generator_test.rb +98 -0
- data/test/test_helper.rb +7 -0
- data/test/xmls/advanced_chart_data.xml +13 -0
- data/test/xmls/advanced_settings.xml +51 -0
- data/test/xmls/amcolumn_settings.xml +328 -0
- data/test/xmls/amline_settings.xml +402 -0
- data/test/xmls/ampie_settings.xml +195 -0
- data/test/xmls/amxy_settings.xml +335 -0
- data/test/xmls/simple.xml +17 -0
- data/test/xmls/simple_chart_data.xml +15 -0
- data/test/xmls/simple_pie_data.xml +5 -0
- data/test/xmls/simple_xy_data.xml +8 -0
- metadata +79 -0
data/lib/ambling/pie.rb
ADDED
@@ -0,0 +1,830 @@
|
|
1
|
+
# Auto generated from XML file
|
2
|
+
require 'ambling/base'
|
3
|
+
module Ambling
|
4
|
+
class Pie
|
5
|
+
|
6
|
+
#
|
7
|
+
# "!" before x or y position (for example: <x>!20</x>) means that the coordinate will be calculated from the right side or the bottom
|
8
|
+
#
|
9
|
+
class Settings
|
10
|
+
include Base
|
11
|
+
|
12
|
+
VALUES = [:data_type,:csv_separator,:skip_rows,:font,:text_size,:text_color,:decimals_separator,:thousands_separator,:digits_after_decimal,:reload_data_interval,:preloader_on_reload,:redraw,:add_time_stamp,:precision,:exclude_invisible,:pie,:animation,:data_labels,:group,:background,:balloon,:legend,:export_as_image,:error_messages,:strings,:context_menu,:labels]
|
13
|
+
#
|
14
|
+
# [xml] (xml / csv)
|
15
|
+
#
|
16
|
+
attr_accessor :data_type
|
17
|
+
|
18
|
+
#
|
19
|
+
# [;] (string) csv file data separator (you need it only if you are using csv file for your data)
|
20
|
+
#
|
21
|
+
attr_accessor :csv_separator
|
22
|
+
|
23
|
+
#
|
24
|
+
# [0] (Number) if you are using csv data type, you can set the number of rows which should be skipped here
|
25
|
+
#
|
26
|
+
attr_accessor :skip_rows
|
27
|
+
|
28
|
+
#
|
29
|
+
# [Arial] (font name) use device fonts, such as Arial, Times New Roman, Tahoma, Verdana...
|
30
|
+
#
|
31
|
+
attr_accessor :font
|
32
|
+
|
33
|
+
#
|
34
|
+
# [11] (Number) text size of all texts. Every text size can be set individually in the settings below
|
35
|
+
#
|
36
|
+
attr_accessor :text_size
|
37
|
+
|
38
|
+
#
|
39
|
+
# [#000000] (hex color code) main text color. Every text color can be set individually in the settings below
|
40
|
+
#
|
41
|
+
attr_accessor :text_color
|
42
|
+
|
43
|
+
#
|
44
|
+
# [,] (string) decimal separator. Note, that this is for displaying data only. Decimals in data xml file must be separated with a dot
|
45
|
+
#
|
46
|
+
attr_accessor :decimals_separator
|
47
|
+
|
48
|
+
#
|
49
|
+
# [ ] (string) thousand separator. use "none" if you don't want to separate
|
50
|
+
#
|
51
|
+
attr_accessor :thousands_separator
|
52
|
+
|
53
|
+
#
|
54
|
+
# [] (Number) if your value has less digits after decimal then is set here, zeroes will be added
|
55
|
+
#
|
56
|
+
attr_accessor :digits_after_decimal
|
57
|
+
|
58
|
+
#
|
59
|
+
# [0] (Number) how often data should be reloaded (time in seconds)
|
60
|
+
#
|
61
|
+
attr_accessor :reload_data_interval
|
62
|
+
|
63
|
+
#
|
64
|
+
# [false] (true / false) Whether to show preloaded when data or settings are reloaded
|
65
|
+
#
|
66
|
+
attr_accessor :preloader_on_reload
|
67
|
+
|
68
|
+
#
|
69
|
+
# [false] (true / false) if your chart's width or height is set in percents, and redraw is set to true, the chart will be redrawn then screen size changes
|
70
|
+
#
|
71
|
+
attr_accessor :redraw
|
72
|
+
|
73
|
+
#
|
74
|
+
# [false] (true / false) if true, a unique number will be added every time flash loads data. Mainly this feature is useful if you set reload _data_interval
|
75
|
+
#
|
76
|
+
attr_accessor :add_time_stamp
|
77
|
+
|
78
|
+
#
|
79
|
+
# [2] (Number) shows how many numbers should be shown after comma for calculated values (percents)
|
80
|
+
#
|
81
|
+
attr_accessor :precision
|
82
|
+
|
83
|
+
#
|
84
|
+
# [false] (true / false) whether to exclude invisible slices (where alpha=0) then calculating percent values or not
|
85
|
+
#
|
86
|
+
attr_accessor :exclude_invisible
|
87
|
+
|
88
|
+
#
|
89
|
+
#
|
90
|
+
#
|
91
|
+
attr_accessor :pie
|
92
|
+
|
93
|
+
#
|
94
|
+
#
|
95
|
+
#
|
96
|
+
attr_accessor :animation
|
97
|
+
|
98
|
+
#
|
99
|
+
#
|
100
|
+
#
|
101
|
+
attr_accessor :data_labels
|
102
|
+
|
103
|
+
#
|
104
|
+
#
|
105
|
+
#
|
106
|
+
attr_accessor :group
|
107
|
+
|
108
|
+
#
|
109
|
+
# BACKGROUND
|
110
|
+
#
|
111
|
+
attr_accessor :background
|
112
|
+
|
113
|
+
#
|
114
|
+
# BALLOON
|
115
|
+
#
|
116
|
+
attr_accessor :balloon
|
117
|
+
|
118
|
+
#
|
119
|
+
# LEGEND
|
120
|
+
#
|
121
|
+
attr_accessor :legend
|
122
|
+
|
123
|
+
#
|
124
|
+
# export_as_image feature works only on a web server
|
125
|
+
#
|
126
|
+
attr_accessor :export_as_image
|
127
|
+
|
128
|
+
#
|
129
|
+
# "error_messages" settings will be applied for all error messages except the one which is showed if settings file wasn't found
|
130
|
+
#
|
131
|
+
attr_accessor :error_messages
|
132
|
+
|
133
|
+
#
|
134
|
+
#
|
135
|
+
#
|
136
|
+
attr_accessor :strings
|
137
|
+
|
138
|
+
#
|
139
|
+
# <menu function_name="printChart" title="Print chart"></menu>
|
140
|
+
#
|
141
|
+
attr_accessor :context_menu
|
142
|
+
|
143
|
+
#
|
144
|
+
# labels can also be added in data xml file, using exactly the same structure like it is here
|
145
|
+
#
|
146
|
+
attr_accessor :labels
|
147
|
+
|
148
|
+
|
149
|
+
#
|
150
|
+
#
|
151
|
+
#
|
152
|
+
class Pie
|
153
|
+
include Base
|
154
|
+
|
155
|
+
VALUES = [:x,:y,:radius,:inner_radius,:height,:angle,:start_angle,:outline_color,:outline_alpha,:base_color,:brightness_step,:colors,:link_target,:alpha,:hover_brightness,:gradient,:gradient_ratio]
|
156
|
+
#
|
157
|
+
# [50%](Number / Number% / !Number)
|
158
|
+
#
|
159
|
+
attr_accessor :x
|
160
|
+
|
161
|
+
#
|
162
|
+
# [45%](Number / Number% / !Number)
|
163
|
+
#
|
164
|
+
attr_accessor :y
|
165
|
+
|
166
|
+
#
|
167
|
+
# [25%] (Number / Number%)
|
168
|
+
#
|
169
|
+
attr_accessor :radius
|
170
|
+
|
171
|
+
#
|
172
|
+
# [0] (Number / Number%) the radius of the hole (if you want to have donut, use > 0)
|
173
|
+
#
|
174
|
+
attr_accessor :inner_radius
|
175
|
+
|
176
|
+
#
|
177
|
+
# [0] (Number) pie height (for 3D effect)
|
178
|
+
#
|
179
|
+
attr_accessor :height
|
180
|
+
|
181
|
+
#
|
182
|
+
# [0] (0 - 90) lean angle (for 3D effect)
|
183
|
+
#
|
184
|
+
attr_accessor :angle
|
185
|
+
|
186
|
+
#
|
187
|
+
# [90] (0-360) angle of a first slice. This will work properly only if <pie><height> is set to 0. If height is > 0, then there can be two angles only: 90 and 270
|
188
|
+
#
|
189
|
+
attr_accessor :start_angle
|
190
|
+
|
191
|
+
#
|
192
|
+
# [#FFFFFF] (hex color code)
|
193
|
+
#
|
194
|
+
attr_accessor :outline_color
|
195
|
+
|
196
|
+
#
|
197
|
+
# [0] (Number)
|
198
|
+
#
|
199
|
+
attr_accessor :outline_alpha
|
200
|
+
|
201
|
+
#
|
202
|
+
# [] (hex color code) color of first slice
|
203
|
+
#
|
204
|
+
attr_accessor :base_color
|
205
|
+
|
206
|
+
#
|
207
|
+
# [20] (-100 - 100) if base_color is used, every next slice is filled with lighter by brightnessStep % color. Use negative value if you want to get darker colors
|
208
|
+
#
|
209
|
+
attr_accessor :brightness_step
|
210
|
+
|
211
|
+
#
|
212
|
+
# [#FF0F00,#FF6600,#FF9E01,#FCD202,#F8FF01,#B0DE09,#04D215,#0D8ECF,#0D52D1,#2A0CD0,#8A0CCF,#CD0D74,#754DEB,#DDDDDD,#999999,#333333,#990000] (hex color codes separated by comas)
|
213
|
+
#
|
214
|
+
attr_accessor :colors
|
215
|
+
|
216
|
+
#
|
217
|
+
# [] (_blank, _top...) If pie slice has a link this is link target
|
218
|
+
#
|
219
|
+
attr_accessor :link_target
|
220
|
+
|
221
|
+
#
|
222
|
+
# [100] (0 - 100) slices alpha. You can set individual alphas for every slice in data file. If you set alpha to 0 the slice will be inactive for mouse events and data labels will be hidden. This allows you to make not full pies and donuts.
|
223
|
+
#
|
224
|
+
attr_accessor :alpha
|
225
|
+
|
226
|
+
#
|
227
|
+
# [0] (from -255 to 255) The pie slice may darken/lighten when the use rolls over it. The intensity may be set here
|
228
|
+
#
|
229
|
+
attr_accessor :hover_brightness
|
230
|
+
|
231
|
+
#
|
232
|
+
# [] (linear/radial) Allows slices to be filled with gradient colors
|
233
|
+
#
|
234
|
+
attr_accessor :gradient
|
235
|
+
|
236
|
+
#
|
237
|
+
# [0,-40] (Numbers from (-255 to 255) separated by commas) Controls the gradient ratio
|
238
|
+
#
|
239
|
+
attr_accessor :gradient_ratio
|
240
|
+
end
|
241
|
+
#
|
242
|
+
#
|
243
|
+
#
|
244
|
+
class Animation
|
245
|
+
include Base
|
246
|
+
|
247
|
+
VALUES = [:start_time,:start_effect,:start_radius,:start_alpha,:sequenced,:pull_out_on_click,:pull_out_time,:pull_out_effect,:pull_out_radius,:pull_out_only_one]
|
248
|
+
#
|
249
|
+
# [0] (Number) fly-in time in seconds. Leave 0 to appear instantly
|
250
|
+
#
|
251
|
+
attr_accessor :start_time
|
252
|
+
|
253
|
+
#
|
254
|
+
# [bounce] (bounce, regular, strong)
|
255
|
+
#
|
256
|
+
attr_accessor :start_effect
|
257
|
+
|
258
|
+
#
|
259
|
+
# [500%] (Number / Number%)
|
260
|
+
#
|
261
|
+
attr_accessor :start_radius
|
262
|
+
|
263
|
+
#
|
264
|
+
# [0] (Number)
|
265
|
+
#
|
266
|
+
attr_accessor :start_alpha
|
267
|
+
|
268
|
+
#
|
269
|
+
# [false] (true / false) Whether the slices should appear all together or one after another
|
270
|
+
#
|
271
|
+
attr_accessor :sequenced
|
272
|
+
|
273
|
+
#
|
274
|
+
# [true] (true / false) whether to pull out slices when user clicks on them (or on legend entry)
|
275
|
+
#
|
276
|
+
attr_accessor :pull_out_on_click
|
277
|
+
|
278
|
+
#
|
279
|
+
# [0] (number) pull-out time (then user clicks on the slice)
|
280
|
+
#
|
281
|
+
attr_accessor :pull_out_time
|
282
|
+
|
283
|
+
#
|
284
|
+
# [bounce] (bounce, regular, strong)
|
285
|
+
#
|
286
|
+
attr_accessor :pull_out_effect
|
287
|
+
|
288
|
+
#
|
289
|
+
# [20%] (Number / Number%) how far pie slices should be pulled-out then user clicks on them
|
290
|
+
#
|
291
|
+
attr_accessor :pull_out_radius
|
292
|
+
|
293
|
+
#
|
294
|
+
# [false] (true / false) if set to true, when you click on any slice, all other slices will be pushed in
|
295
|
+
#
|
296
|
+
attr_accessor :pull_out_only_one
|
297
|
+
end
|
298
|
+
#
|
299
|
+
#
|
300
|
+
#
|
301
|
+
class DataLabels
|
302
|
+
include Base
|
303
|
+
|
304
|
+
VALUES = [:radius,:text_color,:text_size,:max_width,:show,:show_lines,:line_color,:line_alpha,:hide_labels_percent,:avoid_overlapping]
|
305
|
+
#
|
306
|
+
# [20%] (Number / Number%) distance of the labels from the pie. Use negative value to place labels on the pie
|
307
|
+
#
|
308
|
+
attr_accessor :radius
|
309
|
+
|
310
|
+
#
|
311
|
+
# [text_color] (hex color code)
|
312
|
+
#
|
313
|
+
attr_accessor :text_color
|
314
|
+
|
315
|
+
#
|
316
|
+
# [text_size] (Number)
|
317
|
+
#
|
318
|
+
attr_accessor :text_size
|
319
|
+
|
320
|
+
#
|
321
|
+
# [120] (Number)
|
322
|
+
#
|
323
|
+
attr_accessor :max_width
|
324
|
+
|
325
|
+
#
|
326
|
+
# [] ({value} {title} {percents} {description}) You can format any data label: {value} - will be replaced with value and so on. You can add your own text or html code too.
|
327
|
+
#
|
328
|
+
attr_accessor :show
|
329
|
+
|
330
|
+
#
|
331
|
+
# [true] (true / false) whether to show lines from slices to data labels or not
|
332
|
+
#
|
333
|
+
attr_accessor :show_lines
|
334
|
+
|
335
|
+
#
|
336
|
+
# [#000000] (hex color code)
|
337
|
+
#
|
338
|
+
attr_accessor :line_color
|
339
|
+
|
340
|
+
#
|
341
|
+
# [15] (Number)
|
342
|
+
#
|
343
|
+
attr_accessor :line_alpha
|
344
|
+
|
345
|
+
#
|
346
|
+
# [0] data labels of slices less then skip_labels_percent% will be hidden (to avoid label overlapping if there are many small pie slices)
|
347
|
+
#
|
348
|
+
attr_accessor :hide_labels_percent
|
349
|
+
|
350
|
+
#
|
351
|
+
# [true] (true / false) Whether to change data labels positions so that they wouldn't overlap or not
|
352
|
+
#
|
353
|
+
attr_accessor :avoid_overlapping
|
354
|
+
end
|
355
|
+
#
|
356
|
+
#
|
357
|
+
#
|
358
|
+
class Group
|
359
|
+
include Base
|
360
|
+
|
361
|
+
VALUES = [:percent,:color,:title,:url,:description,:pull_out]
|
362
|
+
#
|
363
|
+
# [0] (Number) if the calculated percent value of a slice is less than specified here, and there are more than one such slices, they can be grouped to "The others" slice
|
364
|
+
#
|
365
|
+
attr_accessor :percent
|
366
|
+
|
367
|
+
#
|
368
|
+
# [] (hex color code) color of "The others" slice
|
369
|
+
#
|
370
|
+
attr_accessor :color
|
371
|
+
|
372
|
+
#
|
373
|
+
# [Others] title of "The others" slice
|
374
|
+
#
|
375
|
+
attr_accessor :title
|
376
|
+
|
377
|
+
#
|
378
|
+
# [] url of "The others" slice
|
379
|
+
#
|
380
|
+
attr_accessor :url
|
381
|
+
|
382
|
+
#
|
383
|
+
# [] description of "The others" slice
|
384
|
+
#
|
385
|
+
attr_accessor :description
|
386
|
+
|
387
|
+
#
|
388
|
+
# [false] (true / false) whether to pull out the other slice or not
|
389
|
+
#
|
390
|
+
attr_accessor :pull_out
|
391
|
+
end
|
392
|
+
#
|
393
|
+
# BACKGROUND
|
394
|
+
#
|
395
|
+
class Background
|
396
|
+
include Base
|
397
|
+
|
398
|
+
VALUES = [:color,:alpha,:border_color,:border_alpha,:file]
|
399
|
+
#
|
400
|
+
# [#FFFFFF] (hex color code) Separate color codes with comas for gradient
|
401
|
+
#
|
402
|
+
attr_accessor :color
|
403
|
+
|
404
|
+
#
|
405
|
+
# [0] (0 - 100) use 0 if you are using custom swf or jpg for background
|
406
|
+
#
|
407
|
+
attr_accessor :alpha
|
408
|
+
|
409
|
+
#
|
410
|
+
# [#000000] (hex color code)
|
411
|
+
#
|
412
|
+
attr_accessor :border_color
|
413
|
+
|
414
|
+
#
|
415
|
+
# [0] (0 - 100)
|
416
|
+
#
|
417
|
+
attr_accessor :border_alpha
|
418
|
+
|
419
|
+
#
|
420
|
+
# The chart will look for this file in path folder (path is set in HTML)
|
421
|
+
#
|
422
|
+
attr_accessor :file
|
423
|
+
end
|
424
|
+
#
|
425
|
+
# BALLOON
|
426
|
+
#
|
427
|
+
class Balloon
|
428
|
+
include Base
|
429
|
+
|
430
|
+
VALUES = [:enabled,:color,:alpha,:text_color,:text_size,:show,:max_width,:corner_radius,:border_width,:border_alpha,:border_color]
|
431
|
+
#
|
432
|
+
# [true] (true / false)
|
433
|
+
#
|
434
|
+
attr_accessor :enabled
|
435
|
+
|
436
|
+
#
|
437
|
+
# [] (hex color code) balloon background color. If empty, slightly darker then current slice color will be used
|
438
|
+
#
|
439
|
+
attr_accessor :color
|
440
|
+
|
441
|
+
#
|
442
|
+
# [80] (0 - 100)
|
443
|
+
#
|
444
|
+
attr_accessor :alpha
|
445
|
+
|
446
|
+
#
|
447
|
+
# [#FFFFFF] (hex color code)
|
448
|
+
#
|
449
|
+
attr_accessor :text_color
|
450
|
+
|
451
|
+
#
|
452
|
+
# [text_size] (Number)
|
453
|
+
#
|
454
|
+
attr_accessor :text_size
|
455
|
+
|
456
|
+
#
|
457
|
+
# [{title}: {percents}% ({value}) <br>{description}] ({value} {title} {percents} {description}) You can format any data label: {value} - will be replaced with value and so on. You can add your own text or html code too.
|
458
|
+
#
|
459
|
+
attr_accessor :show
|
460
|
+
|
461
|
+
#
|
462
|
+
# [220] (Number) The maximum width of a balloon
|
463
|
+
#
|
464
|
+
attr_accessor :max_width
|
465
|
+
|
466
|
+
#
|
467
|
+
# [0] (Number) Corner radius of a balloon. If you set it > 0, the balloon will not display arrow
|
468
|
+
#
|
469
|
+
attr_accessor :corner_radius
|
470
|
+
|
471
|
+
#
|
472
|
+
# [0] (Number)
|
473
|
+
#
|
474
|
+
attr_accessor :border_width
|
475
|
+
|
476
|
+
#
|
477
|
+
# [balloon.alpha] (Number)
|
478
|
+
#
|
479
|
+
attr_accessor :border_alpha
|
480
|
+
|
481
|
+
#
|
482
|
+
# [balloon.color] (hex color code)
|
483
|
+
#
|
484
|
+
attr_accessor :border_color
|
485
|
+
end
|
486
|
+
#
|
487
|
+
# LEGEND
|
488
|
+
#
|
489
|
+
class Legend
|
490
|
+
include Base
|
491
|
+
|
492
|
+
VALUES = [:enabled,:x,:y,:width,:color,:max_columns,:alpha,:border_color,:border_alpha,:text_color,:text_size,:spacing,:margins,:reverse_order,:align,:key,:values]
|
493
|
+
#
|
494
|
+
# [true] (true / false)
|
495
|
+
#
|
496
|
+
attr_accessor :enabled
|
497
|
+
|
498
|
+
#
|
499
|
+
# [5%] (Number / Number% / !Number)
|
500
|
+
#
|
501
|
+
attr_accessor :x
|
502
|
+
|
503
|
+
#
|
504
|
+
# [] (Number / Number% / !Number) if empty, will be placed below the pie
|
505
|
+
#
|
506
|
+
attr_accessor :y
|
507
|
+
|
508
|
+
#
|
509
|
+
# [90%] (Number / Number%)
|
510
|
+
#
|
511
|
+
attr_accessor :width
|
512
|
+
|
513
|
+
#
|
514
|
+
# [#FFFFFF] (hex color code) background color. Separate color codes with comas for gradient
|
515
|
+
#
|
516
|
+
attr_accessor :color
|
517
|
+
|
518
|
+
#
|
519
|
+
# [] (Number) the maximum number of columns in the legend
|
520
|
+
#
|
521
|
+
attr_accessor :max_columns
|
522
|
+
|
523
|
+
#
|
524
|
+
# [0] (0 - 100) background alpha
|
525
|
+
#
|
526
|
+
attr_accessor :alpha
|
527
|
+
|
528
|
+
#
|
529
|
+
# [#000000] (hex color code) border color
|
530
|
+
#
|
531
|
+
attr_accessor :border_color
|
532
|
+
|
533
|
+
#
|
534
|
+
# [0] (0 - 100) border alpha
|
535
|
+
#
|
536
|
+
attr_accessor :border_alpha
|
537
|
+
|
538
|
+
#
|
539
|
+
# [text_color] (hex color code)
|
540
|
+
#
|
541
|
+
attr_accessor :text_color
|
542
|
+
|
543
|
+
#
|
544
|
+
# [text_size] (Number)
|
545
|
+
#
|
546
|
+
attr_accessor :text_size
|
547
|
+
|
548
|
+
#
|
549
|
+
# [10] (Number) vertical and horizontal gap between legend entries
|
550
|
+
#
|
551
|
+
attr_accessor :spacing
|
552
|
+
|
553
|
+
#
|
554
|
+
# [0] (Number) legend margins (space between legend border and legend entries, recommended to use only if legend border is visible or background color is different from chart area background color)
|
555
|
+
#
|
556
|
+
attr_accessor :margins
|
557
|
+
|
558
|
+
#
|
559
|
+
# [false] (true / false) whether to sort legend entries in a reverse order
|
560
|
+
#
|
561
|
+
attr_accessor :reverse_order
|
562
|
+
|
563
|
+
#
|
564
|
+
# [left] (left / center / right) alignment of legend entries
|
565
|
+
#
|
566
|
+
attr_accessor :align
|
567
|
+
|
568
|
+
#
|
569
|
+
# KEY (the color box near every legend entry)
|
570
|
+
#
|
571
|
+
attr_accessor :key
|
572
|
+
|
573
|
+
#
|
574
|
+
# VALUES
|
575
|
+
#
|
576
|
+
attr_accessor :values
|
577
|
+
|
578
|
+
|
579
|
+
#
|
580
|
+
# KEY (the color box near every legend entry)
|
581
|
+
#
|
582
|
+
class Key
|
583
|
+
include Base
|
584
|
+
|
585
|
+
VALUES = [:size,:border_color]
|
586
|
+
#
|
587
|
+
# [16] (Number) key size
|
588
|
+
#
|
589
|
+
attr_accessor :size
|
590
|
+
|
591
|
+
#
|
592
|
+
# [] (hex color code) leave empty if you don't want to have border
|
593
|
+
#
|
594
|
+
attr_accessor :border_color
|
595
|
+
end
|
596
|
+
#
|
597
|
+
# VALUES
|
598
|
+
#
|
599
|
+
class Values
|
600
|
+
include Base
|
601
|
+
|
602
|
+
VALUES = [:enabled,:width,:text]
|
603
|
+
#
|
604
|
+
# [false] (true / false) whether to show values near legend entries or not
|
605
|
+
#
|
606
|
+
attr_accessor :enabled
|
607
|
+
|
608
|
+
#
|
609
|
+
# [] (Number) width of value text (use it if you want to align all values to the right, othervise leave empty)
|
610
|
+
#
|
611
|
+
attr_accessor :width
|
612
|
+
|
613
|
+
#
|
614
|
+
# [{percents}%] ({value} {percents})
|
615
|
+
#
|
616
|
+
attr_accessor :text
|
617
|
+
end
|
618
|
+
end
|
619
|
+
#
|
620
|
+
# export_as_image feature works only on a web server
|
621
|
+
#
|
622
|
+
class ExportAsImage
|
623
|
+
include Base
|
624
|
+
|
625
|
+
VALUES = [:file,:target,:x,:y,:color,:alpha,:text_color,:text_size]
|
626
|
+
#
|
627
|
+
# [] (filename) if you set filename here, context menu (then user right clicks on flash movie) "Export as image" will appear. This will allow user to export chart as an image. Collected image data will be posted to this file name (use ampie/export.php or ampie/export.aspx)
|
628
|
+
#
|
629
|
+
attr_accessor :file
|
630
|
+
|
631
|
+
#
|
632
|
+
# [] (_blank, _top ...) target of a window in which export file must be called
|
633
|
+
#
|
634
|
+
attr_accessor :target
|
635
|
+
|
636
|
+
#
|
637
|
+
# [0] (Number / Number% / !Number) x position of "Collecting data" text
|
638
|
+
#
|
639
|
+
attr_accessor :x
|
640
|
+
|
641
|
+
#
|
642
|
+
# [] (Number / Number% / !Number) y position of "Collecting data" text. If not set, will be aligned to the bottom of flash movie
|
643
|
+
#
|
644
|
+
attr_accessor :y
|
645
|
+
|
646
|
+
#
|
647
|
+
# [#BBBB00] (hex color code) background color of "Collecting data" text
|
648
|
+
#
|
649
|
+
attr_accessor :color
|
650
|
+
|
651
|
+
#
|
652
|
+
# [0] (0 - 100) background alpha
|
653
|
+
#
|
654
|
+
attr_accessor :alpha
|
655
|
+
|
656
|
+
#
|
657
|
+
# [text_color] (hex color code)
|
658
|
+
#
|
659
|
+
attr_accessor :text_color
|
660
|
+
|
661
|
+
#
|
662
|
+
# [text_size] (Number)
|
663
|
+
#
|
664
|
+
attr_accessor :text_size
|
665
|
+
end
|
666
|
+
#
|
667
|
+
# "error_messages" settings will be applied for all error messages except the one which is showed if settings file wasn't found
|
668
|
+
#
|
669
|
+
class ErrorMessages
|
670
|
+
include Base
|
671
|
+
|
672
|
+
VALUES = [:enabled,:x,:y,:color,:alpha,:text_color,:text_size]
|
673
|
+
#
|
674
|
+
# [true] (true / false)
|
675
|
+
#
|
676
|
+
attr_accessor :enabled
|
677
|
+
|
678
|
+
#
|
679
|
+
# [] (Number / Number% / !Number) x position of error message. If not set, will be aligned to the center
|
680
|
+
#
|
681
|
+
attr_accessor :x
|
682
|
+
|
683
|
+
#
|
684
|
+
# [] (Number / Number% / !Number) y position of error message. If not set, will be aligned to the center
|
685
|
+
#
|
686
|
+
attr_accessor :y
|
687
|
+
|
688
|
+
#
|
689
|
+
# [#BBBB00] (hex color code) background color of error message. Separate color codes with comas for gradient
|
690
|
+
#
|
691
|
+
attr_accessor :color
|
692
|
+
|
693
|
+
#
|
694
|
+
# [100] (0 - 100) background alpha
|
695
|
+
#
|
696
|
+
attr_accessor :alpha
|
697
|
+
|
698
|
+
#
|
699
|
+
# [#FFFFFF] (hex color code)
|
700
|
+
#
|
701
|
+
attr_accessor :text_color
|
702
|
+
|
703
|
+
#
|
704
|
+
# [text_size] (Number)
|
705
|
+
#
|
706
|
+
attr_accessor :text_size
|
707
|
+
end
|
708
|
+
#
|
709
|
+
#
|
710
|
+
#
|
711
|
+
class Strings
|
712
|
+
include Base
|
713
|
+
|
714
|
+
VALUES = [:no_data,:export_as_image,:collecting_data]
|
715
|
+
#
|
716
|
+
# [No data for selected period] (text) if data is missing, this message will be displayed
|
717
|
+
#
|
718
|
+
attr_accessor :no_data
|
719
|
+
|
720
|
+
#
|
721
|
+
# [Export as image] (text) text for right click menu
|
722
|
+
#
|
723
|
+
attr_accessor :export_as_image
|
724
|
+
|
725
|
+
#
|
726
|
+
# [Collecting data] (text) this text is displayed while exporting chart to an image
|
727
|
+
#
|
728
|
+
attr_accessor :collecting_data
|
729
|
+
end
|
730
|
+
#
|
731
|
+
# <menu function_name="printChart" title="Print chart"></menu>
|
732
|
+
#
|
733
|
+
class ContextMenu
|
734
|
+
include Base
|
735
|
+
|
736
|
+
VALUES = [:default_items]
|
737
|
+
#
|
738
|
+
#
|
739
|
+
#
|
740
|
+
attr_accessor :default_items
|
741
|
+
|
742
|
+
|
743
|
+
#
|
744
|
+
#
|
745
|
+
#
|
746
|
+
class DefaultItems
|
747
|
+
include Base
|
748
|
+
|
749
|
+
VALUES = [:zoom,:print]
|
750
|
+
#
|
751
|
+
# [true] (true / false) to show or not flash players zoom menu
|
752
|
+
#
|
753
|
+
attr_accessor :zoom
|
754
|
+
|
755
|
+
#
|
756
|
+
# [true] (true / false) to show or not flash players print menu
|
757
|
+
#
|
758
|
+
attr_accessor :print
|
759
|
+
end
|
760
|
+
end
|
761
|
+
#
|
762
|
+
# labels can also be added in data xml file, using exactly the same structure like it is here
|
763
|
+
#
|
764
|
+
class Labels
|
765
|
+
include Base
|
766
|
+
|
767
|
+
VALUES = [:label]
|
768
|
+
#
|
769
|
+
#
|
770
|
+
#
|
771
|
+
attr_accessor :label
|
772
|
+
|
773
|
+
|
774
|
+
#
|
775
|
+
#
|
776
|
+
#
|
777
|
+
class Label
|
778
|
+
include Base
|
779
|
+
|
780
|
+
VALUES = [:x,:y,:rotate,:width,:align,:text_color,:text_size,:text]
|
781
|
+
ATTRIBUTES = [:lid]
|
782
|
+
#
|
783
|
+
# [0] (Number / Number% / !Number)
|
784
|
+
#
|
785
|
+
attr_accessor :x
|
786
|
+
|
787
|
+
#
|
788
|
+
# [0] (Number / Number% / !Number)
|
789
|
+
#
|
790
|
+
attr_accessor :y
|
791
|
+
|
792
|
+
#
|
793
|
+
# [false] (true / false)
|
794
|
+
#
|
795
|
+
attr_accessor :rotate
|
796
|
+
|
797
|
+
#
|
798
|
+
# [] (Number / Number%) if empty, will stretch from left to right untill label fits
|
799
|
+
#
|
800
|
+
attr_accessor :width
|
801
|
+
|
802
|
+
#
|
803
|
+
# [left] (left / center / right)
|
804
|
+
#
|
805
|
+
attr_accessor :align
|
806
|
+
|
807
|
+
#
|
808
|
+
# [text_color] (hex color code) button text color
|
809
|
+
#
|
810
|
+
attr_accessor :text_color
|
811
|
+
|
812
|
+
#
|
813
|
+
# [text_size](Number) button text size
|
814
|
+
#
|
815
|
+
attr_accessor :text_size
|
816
|
+
|
817
|
+
#
|
818
|
+
# [] (text) html tags may be used (supports <b>, <i>, <u>, <font>, <a href="">, <br/>. Enter text between []: <![CDATA[your <b>bold</b> and <i>italic</i> text]]>
|
819
|
+
#
|
820
|
+
attr_accessor :text
|
821
|
+
|
822
|
+
#
|
823
|
+
# xml attribute
|
824
|
+
#
|
825
|
+
attr_accessor :lid
|
826
|
+
end
|
827
|
+
end
|
828
|
+
end
|
829
|
+
end
|
830
|
+
end
|