ambling 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,255 @@
1
+ # Classes to store Amcharts data and generate data xml
2
+ require 'ambling/base'
3
+
4
+ module Ambling #:nodoc
5
+
6
+ class Data
7
+ #
8
+ # Build the xml with the class name in lower case
9
+ class Base
10
+ def tag_name
11
+ self.class.to_s.split("::").last.downcase
12
+ end
13
+
14
+ def to_xml(builder = nil)
15
+ builder ||= Builder::XmlMarkup.new
16
+ builder.tag!(tag_name) { self.build_xml(builder) }
17
+ builder.target!
18
+ end
19
+ end
20
+
21
+ # A data point in the XML has a value and attributes
22
+ class BaseValue
23
+ attr_accessor :attributes, :value
24
+
25
+ def initialize(value, attributes={})
26
+ @value = value
27
+ @attributes = attributes
28
+ end
29
+
30
+ def to_xml(builder = nil)
31
+ builder ||= Builder::XmlMarkup.new
32
+ build_xml(builder)
33
+ builder.target!
34
+ end
35
+
36
+ def tag_name
37
+ "value"
38
+ end
39
+
40
+ def build_xml(builder)
41
+ builder.tag!(tag_name, @value, @attributes)
42
+ end
43
+ end
44
+
45
+ # Build the XML for a message slightly differently
46
+ class Message < BaseValue
47
+ def build_xml(builder)
48
+ builder.message(@attributes){|message| message.cdata! @value}
49
+ end
50
+ end
51
+
52
+ # <value foo="bar">
53
+ class Value < BaseValue
54
+ end
55
+
56
+ # <slice foo="bar">
57
+ class Slice < BaseValue
58
+ def tag_name
59
+ "slice"
60
+ end
61
+ end
62
+
63
+ # <point foo="bar">
64
+ # points don't have values
65
+ class Point < BaseValue
66
+ def initialize(attributes = {})
67
+ @value, @attributes = "", attributes
68
+ end
69
+
70
+ def tag_name
71
+ "point"
72
+ end
73
+ end
74
+
75
+ # Holds an array of values
76
+ class BaseValueHolder < Base
77
+ attr_reader :values, :attributes
78
+
79
+ def initialize(data = [], attributes = {})
80
+ self.values = data
81
+ @attributes = attributes
82
+ end
83
+
84
+ def values=(data)
85
+ @values = []
86
+ data.each {|item| self.push(item)}
87
+ end
88
+
89
+ def push(item)
90
+ if item.is_a?(Value)
91
+ @values << item
92
+ else
93
+ @values << Value.new(item, {:xid => @values.size+1})
94
+ end
95
+ end
96
+
97
+ alias :<< :push
98
+
99
+ def build_xml(builder)
100
+ @values.each { |value| value.build_xml(builder) }
101
+ end
102
+ end
103
+
104
+ # A series is nothing but an array of values
105
+ class Series < BaseValueHolder
106
+ end
107
+
108
+ # Line and Column graphs are very similar because they both contain values
109
+ class LineColumnGraph < BaseValueHolder
110
+ def tag_name
111
+ "graph"
112
+ end
113
+ end
114
+
115
+ # line graph
116
+ class LineGraph < LineColumnGraph
117
+ end
118
+
119
+ # column graph
120
+ class ColumnGraph < LineColumnGraph
121
+ end
122
+
123
+ # xy graphs contain points, not values
124
+ # I know I should abstract the BaseValueHolder to handle a generic array of Values.
125
+ # Unfortunately, I don't have time right now
126
+ class XyGraph
127
+ attr_reader :points
128
+
129
+ def initialize(data = [])
130
+ self.points = data
131
+ end
132
+
133
+ def points=(data)
134
+ @points = []
135
+ data.each {|item| self.push(item)}
136
+ end
137
+
138
+ def push(item)
139
+ if item.is_a?(Point)
140
+ @points << item
141
+ else
142
+ @points << Point.new(item)
143
+ end
144
+ end
145
+
146
+ alias :<< :push
147
+
148
+ def build_xml(builder)
149
+ @points.each { |point| point.build_xml(builder) }
150
+ end
151
+
152
+ end
153
+
154
+ # Data files always have an optional message
155
+ class BaseData < Base
156
+ attr_reader :message
157
+
158
+ def message=(data)
159
+ if data.is_a?(Message)
160
+ @message = data
161
+ else
162
+ @message = Message.new(data)
163
+ end
164
+ end
165
+
166
+ end
167
+
168
+ # Line and Column Data have a single series and a number of graphs
169
+ class LineColumnChart < BaseData
170
+ attr_reader :series, :graphs
171
+
172
+ def initialize
173
+ @series, @graphs = Series.new, []
174
+ end
175
+
176
+ def series=(data)
177
+ if data.is_a?(Series)
178
+ @series = data
179
+ else
180
+ @series.values = data
181
+ end
182
+ end
183
+
184
+ def build_xml(builder)
185
+ @message.build_xml(builder) if !@message.nil?
186
+ builder.series {|series| @series.build_xml(series)}
187
+ builder.graphs do |graphs|
188
+ @graphs.each_with_index {|g,i| graphs.graph({:gid => i+1}.merge(g.attributes)) {|graph| g.build_xml(graph)}}
189
+ end
190
+ end
191
+
192
+ def tag_name
193
+ "chart"
194
+ end
195
+ end
196
+
197
+ # For an amchart line chart
198
+ class LineChart < LineColumnChart
199
+ end
200
+
201
+ # For an amchart column chart
202
+ class ColumnChart < LineColumnChart
203
+ end
204
+
205
+ # For an amchart xy (line) chart
206
+ class XyChart < BaseData
207
+ attr_reader :graphs
208
+
209
+ def initialize
210
+ @graphs = []
211
+ end
212
+
213
+ def build_xml(builder)
214
+ @message.build_xml(builder) if !@message.nil?
215
+ builder.graphs do |graphs|
216
+ @graphs.each_with_index {|g,i| graphs.graph({:gid => i}) {|graph| g.build_xml(graph)}}
217
+ end
218
+ end
219
+
220
+ def tag_name
221
+ "chart"
222
+ end
223
+
224
+ end
225
+
226
+ # For an amchart pie chart
227
+ class Pie < BaseData
228
+ attr_reader :slices
229
+
230
+ def initialize(data = [])
231
+ self.slices = data
232
+ end
233
+
234
+ def slices=(data)
235
+ @slices = []
236
+ data.each {|item| self.push(item)}
237
+ end
238
+
239
+ def push(item)
240
+ if item.is_a?(Slice)
241
+ @slices << item
242
+ else
243
+ @slices << Slice.new(item)
244
+ end
245
+ end
246
+
247
+ alias :<< :push
248
+
249
+ def build_xml(builder)
250
+ @message.build_xml(builder) if !@message.nil?
251
+ @slices.each {|s| s.build_xml(builder)}
252
+ end
253
+ end
254
+ end
255
+ end
@@ -0,0 +1,1822 @@
1
+ # Auto generated from XML file
2
+ require 'ambling/base'
3
+ module Ambling
4
+ class Line
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,:scientific_min,:scientific_max,:redraw,:reload_data_interval,:preloader_on_reload,:add_time_stamp,:precision,:connect,:hide_bullets_count,:link_target,:start_on_axis,:colors,:rescale_on_hide,:js_enabled,:background,:plot_area,:scroller,:grid,:values,:axes,:indicator,:balloon,:legend,:vertical_lines,:zoom_out_button,:help,:export_as_image,:error_messages,:strings,:context_menu,:labels,:graphs,:guides]
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 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.000001] If absolute value of your number is equal or less then scientific_min, this number will be formatted using scientific notation, for example: 0.0000023 -> 2.3e-6
60
+ #
61
+ attr_accessor :scientific_min
62
+
63
+ #
64
+ # [1000000000000000] If absolute value of your number is equal or bigger then scientific_max, this number will be formatted using scientific notation, for example: 15000000000000000 -> 1.5e16
65
+ #
66
+ attr_accessor :scientific_max
67
+
68
+ #
69
+ # Legend, buttons labels will not be repositioned if you set your x and y values for these objects
70
+ #
71
+ attr_accessor :redraw
72
+
73
+ #
74
+ # [0] (Number) how often data should be reloaded (time in seconds) If you are using this feature I strongly recommend to turn off zoom function (set <zoomable>false</zoomable>)
75
+ #
76
+ attr_accessor :reload_data_interval
77
+
78
+ #
79
+ # [false] (true / false) Whether to show preloaded when data or settings are reloaded
80
+ #
81
+ attr_accessor :preloader_on_reload
82
+
83
+ #
84
+ # [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 >0
85
+ #
86
+ attr_accessor :add_time_stamp
87
+
88
+ #
89
+ # [2] (Number) shows how many numbers should be shown after comma for calculated values (percents, used only in stacked charts)
90
+ #
91
+ attr_accessor :precision
92
+
93
+ #
94
+ # [false] (true / false) whether to connect points if y data is missing
95
+ #
96
+ attr_accessor :connect
97
+
98
+ #
99
+ # [] (Number) if there are more then hideBulletsCount points on the screen, bullets can be hidden, to avoid mess. Leave empty, or 0 to show bullets all the time. This rule doesn't influence if custom bullet is defined near y value, in data file
100
+ #
101
+ attr_accessor :hide_bullets_count
102
+
103
+ #
104
+ # [] (_blank, _top ...)
105
+ #
106
+ attr_accessor :link_target
107
+
108
+ #
109
+ # [true] (true / false) if set to false, graph is moved 1/2 of one series interval from Y axis
110
+ #
111
+ attr_accessor :start_on_axis
112
+
113
+ #
114
+ # [#FF0000,#0000FF,#00FF00,#FF9900,#CC00CC,#00CCCC,#33FF00,#990000,#000066,#555555] Colors of graphs. if the graph color is not set, color from this array will be used
115
+ #
116
+ attr_accessor :colors
117
+
118
+ #
119
+ # [true] (true/false) When you show or hide graphs, the chart recalculates min and max values (rescales the chart). If you don't want this, set this to false.
120
+ #
121
+ attr_accessor :rescale_on_hide
122
+
123
+ #
124
+ # [true] (true / false) In case you don't use any flash - JavaScript communication, you shuold set this setting to false - this will save some CPU and will disable the security warning message which appears when opening the chart from hard drive.
125
+ #
126
+ attr_accessor :js_enabled
127
+
128
+ #
129
+ # BACKGROUND
130
+ #
131
+ attr_accessor :background
132
+
133
+ #
134
+ # PLOT AREA (the area between axes)
135
+ #
136
+ attr_accessor :plot_area
137
+
138
+ #
139
+
140
+ #
141
+ attr_accessor :scroller
142
+
143
+ #
144
+ # GRID
145
+ #
146
+ attr_accessor :grid
147
+
148
+ #
149
+ # VALUES
150
+ #
151
+ attr_accessor :values
152
+
153
+ #
154
+ # axes
155
+ #
156
+ attr_accessor :axes
157
+
158
+ #
159
+ # INDICATOR
160
+ #
161
+ attr_accessor :indicator
162
+
163
+ #
164
+ # BALLOON
165
+ #
166
+ attr_accessor :balloon
167
+
168
+ #
169
+ # LEGEND
170
+ #
171
+ attr_accessor :legend
172
+
173
+ #
174
+ # line chart can also display vertical lines/columns (set <vertical_lines>true</vertical_lines> in graph settings for that). If you also set <line_alpha>0</line_alpha> your line chart will become column chart
175
+ #
176
+ attr_accessor :vertical_lines
177
+
178
+ #
179
+
180
+ #
181
+ attr_accessor :zoom_out_button
182
+
183
+ #
184
+ # HELP button and balloon
185
+ #
186
+ attr_accessor :help
187
+
188
+ #
189
+ # export_as_image feature works only on a web server
190
+ #
191
+ attr_accessor :export_as_image
192
+
193
+ #
194
+ # "error_messages" settings will be applied for all error messages except the one which is showed if settings file wasn't found
195
+ #
196
+ attr_accessor :error_messages
197
+
198
+ #
199
+
200
+ #
201
+ attr_accessor :strings
202
+
203
+ #
204
+ # <menu function_name="printChart" title="Print chart"></menu>
205
+ #
206
+ attr_accessor :context_menu
207
+
208
+ #
209
+ # labels can also be added in data xml file, using exactly the same structure like it is here
210
+ #
211
+ attr_accessor :labels
212
+
213
+ #
214
+ # if graph settings are defined both here and in data file, the ones from data file are used
215
+ #
216
+ attr_accessor :graphs
217
+
218
+ #
219
+ # guides are straight lines drawn through all plot area at a give value. Can also be filled with color
220
+ #
221
+ attr_accessor :guides
222
+
223
+
224
+ #
225
+ # BACKGROUND
226
+ #
227
+ class Background
228
+ include Base
229
+
230
+ VALUES = [:color,:alpha,:border_color,:border_alpha,:file]
231
+ #
232
+ # [#FFFFFF] (hex color code) Separate color codes with comas for gradient
233
+ #
234
+ attr_accessor :color
235
+
236
+ #
237
+ # [0] (0 - 100) use 0 if you are using custom swf or jpg for background
238
+ #
239
+ attr_accessor :alpha
240
+
241
+ #
242
+ # [#000000] (hex color code)
243
+ #
244
+ attr_accessor :border_color
245
+
246
+ #
247
+ # [0] (0 - 100)
248
+ #
249
+ attr_accessor :border_alpha
250
+
251
+ #
252
+ # The chart will look for this file in "path" folder ("path" is set in HTML)
253
+ #
254
+ attr_accessor :file
255
+ end
256
+ #
257
+ # PLOT AREA (the area between axes)
258
+ #
259
+ class PlotArea
260
+ include Base
261
+
262
+ VALUES = [:color,:alpha,:border_color,:border_alpha,:margins]
263
+ #
264
+ # [#FFFFFF](hex color code) Separate color codes with comas for gradient
265
+ #
266
+ attr_accessor :color
267
+
268
+ #
269
+ # [0] (0 - 100) if you want it to be different than background color, use bigger than 0 value
270
+ #
271
+ attr_accessor :alpha
272
+
273
+ #
274
+ # [#000000] (hex color code)
275
+ #
276
+ attr_accessor :border_color
277
+
278
+ #
279
+ # [0] (0 - 100)
280
+ #
281
+ attr_accessor :border_alpha
282
+
283
+ #
284
+ # plot area margins
285
+ #
286
+ attr_accessor :margins
287
+
288
+
289
+ #
290
+ # plot area margins
291
+ #
292
+ class Margins
293
+ include Base
294
+
295
+ VALUES = [:left,:top,:right,:bottom]
296
+ #
297
+ # [60](Number / Number%)
298
+ #
299
+ attr_accessor :left
300
+
301
+ #
302
+ # [60](Number / Number%)
303
+ #
304
+ attr_accessor :top
305
+
306
+ #
307
+ # [60](Number / Number%)
308
+ #
309
+ attr_accessor :right
310
+
311
+ #
312
+ # [80](Number / Number%)
313
+ #
314
+ attr_accessor :bottom
315
+ end
316
+ end
317
+ #
318
+
319
+ #
320
+ class Scroller
321
+ include Base
322
+
323
+ VALUES = [:enabled,:y,:color,:alpha,:bg_color,:bg_alpha,:height]
324
+ #
325
+ # [true] (true / false) whether to show scroller when chart is zoomed or not
326
+ #
327
+ attr_accessor :enabled
328
+
329
+ #
330
+ # [] (Number) Y position of scroller. If not set here, will be displayed above plot area
331
+ #
332
+ attr_accessor :y
333
+
334
+ #
335
+ # [#DADADA] (hex color code) scrollbar color. Separate color codes with comas for gradient
336
+ #
337
+ attr_accessor :color
338
+
339
+ #
340
+ # [100] (Number) scrollbar alpha
341
+ #
342
+ attr_accessor :alpha
343
+
344
+ #
345
+ # [#F0F0F0] (hex color code) scroller background color. Separate color codes with comas for gradient
346
+ #
347
+ attr_accessor :bg_color
348
+
349
+ #
350
+ # [100] (Number) scroller background alpha
351
+ #
352
+ attr_accessor :bg_alpha
353
+
354
+ #
355
+ # [10] (Number) scroller height
356
+ #
357
+ attr_accessor :height
358
+ end
359
+ #
360
+ # GRID
361
+ #
362
+ class Grid
363
+ include Base
364
+
365
+ VALUES = [:x,:y_left,:y_right]
366
+ #
367
+ # vertical grid
368
+ #
369
+ attr_accessor :x
370
+
371
+ #
372
+ # horizontal grid, Y left axis. Visible only if there is at least one graph assigned to left axis
373
+ #
374
+ attr_accessor :y_left
375
+
376
+ #
377
+ # horizontal grid, Y right axis. Visible only if there is at least one graph assigned to right axis
378
+ #
379
+ attr_accessor :y_right
380
+
381
+
382
+ #
383
+ # vertical grid
384
+ #
385
+ class X
386
+ include Base
387
+
388
+ VALUES = [:enabled,:color,:alpha,:dashed,:dash_length,:approx_count]
389
+ #
390
+ # [true] (true / false)
391
+ #
392
+ attr_accessor :enabled
393
+
394
+ #
395
+ # [#000000] (hex color code)
396
+ #
397
+ attr_accessor :color
398
+
399
+ #
400
+ # [15] (0 - 100)
401
+ #
402
+ attr_accessor :alpha
403
+
404
+ #
405
+ # [false](true / false)
406
+ #
407
+ attr_accessor :dashed
408
+
409
+ #
410
+ # [5] (Number)
411
+ #
412
+ attr_accessor :dash_length
413
+
414
+ #
415
+ # [4] (Number) approximate number of gridlines
416
+ #
417
+ attr_accessor :approx_count
418
+ end
419
+ #
420
+ # horizontal grid, Y left axis. Visible only if there is at least one graph assigned to left axis
421
+ #
422
+ class YLeft
423
+ include Base
424
+
425
+ VALUES = [:enabled,:color,:alpha,:dashed,:dash_length,:approx_count,:fill_color,:fill_alpha]
426
+ #
427
+ # [true] (true / false)
428
+ #
429
+ attr_accessor :enabled
430
+
431
+ #
432
+ # [#000000] (hex color code)
433
+ #
434
+ attr_accessor :color
435
+
436
+ #
437
+ # [15] (0 - 100)
438
+ #
439
+ attr_accessor :alpha
440
+
441
+ #
442
+ # [false] (true / false)
443
+ #
444
+ attr_accessor :dashed
445
+
446
+ #
447
+ # [5] (Number)
448
+ #
449
+ attr_accessor :dash_length
450
+
451
+ #
452
+ # [10] (Number) approximate number of gridlines
453
+ #
454
+ attr_accessor :approx_count
455
+
456
+ #
457
+ # [#FFFFFF] (hex color code) every second area between gridlines will be filled with this color (you will need to set fill_alpha > 0)
458
+ #
459
+ attr_accessor :fill_color
460
+
461
+ #
462
+ # [0] (0 - 100) opacity of fill
463
+ #
464
+ attr_accessor :fill_alpha
465
+ end
466
+ #
467
+ # horizontal grid, Y right axis. Visible only if there is at least one graph assigned to right axis
468
+ #
469
+ class YRight
470
+ include Base
471
+
472
+ VALUES = [:enabled,:color,:alpha,:dashed,:dash_length,:approx_count,:fill_color,:fill_alpha]
473
+ #
474
+ # [true] (true / false)
475
+ #
476
+ attr_accessor :enabled
477
+
478
+ #
479
+ # [#000000] (hex color code)
480
+ #
481
+ attr_accessor :color
482
+
483
+ #
484
+ # [15] (0 - 100)
485
+ #
486
+ attr_accessor :alpha
487
+
488
+ #
489
+ # [false] (true / false)
490
+ #
491
+ attr_accessor :dashed
492
+
493
+ #
494
+ # [5] (Number)
495
+ #
496
+ attr_accessor :dash_length
497
+
498
+ #
499
+ # [10] (Number) approximate number of gridlines
500
+ #
501
+ attr_accessor :approx_count
502
+
503
+ #
504
+ # [#FFFFFF] (hex color code) every second area between gridlines will be filled with this color (you will need to set fill_alpha > 0)
505
+ #
506
+ attr_accessor :fill_color
507
+
508
+ #
509
+ # [0] (0 - 100) opacity of fill
510
+ #
511
+ attr_accessor :fill_alpha
512
+ end
513
+ end
514
+ #
515
+ # VALUES
516
+ #
517
+ class Values
518
+ include Base
519
+
520
+ VALUES = [:x,:y_left,:y_right]
521
+ #
522
+ # x axis
523
+ #
524
+ attr_accessor :x
525
+
526
+ #
527
+ # y left axis
528
+ #
529
+ attr_accessor :y_left
530
+
531
+ #
532
+ # y right axis
533
+ #
534
+ attr_accessor :y_right
535
+
536
+
537
+ #
538
+ # x axis
539
+ #
540
+ class X
541
+ include Base
542
+
543
+ VALUES = [:enabled,:rotate,:frequency,:skip_first,:skip_last,:color,:text_size,:inside]
544
+ #
545
+ # [true] (true / false)
546
+ #
547
+ attr_accessor :enabled
548
+
549
+ #
550
+ # [0] (0 - 90) angle of rotation. If you want to rotate by degree from 1 to 89, you must have font.swf file in fonts folder
551
+ #
552
+ attr_accessor :rotate
553
+
554
+ #
555
+ # [1] (Number) how often values should be placed, 1 - near every gridline, 2 - near every second gridline...
556
+ #
557
+ attr_accessor :frequency
558
+
559
+ #
560
+ # [false] (true / false) to skip or not first value
561
+ #
562
+ attr_accessor :skip_first
563
+
564
+ #
565
+ # [false] (true / false) to skip or not last value
566
+ #
567
+ attr_accessor :skip_last
568
+
569
+ #
570
+ # [text_color] (hex color code)
571
+ #
572
+ attr_accessor :color
573
+
574
+ #
575
+ # [text_size] (Number)
576
+ #
577
+ attr_accessor :text_size
578
+
579
+ #
580
+ # [false] (true / false) if set to true, axis values will be displayed inside plot area. This setting will not work for values rotated by 1-89 degrees (0 and 90 only)
581
+ #
582
+ attr_accessor :inside
583
+ end
584
+ #
585
+ # y left axis
586
+ #
587
+ class YLeft
588
+ include Base
589
+
590
+ VALUES = [:enabled,:reverse,:rotate,:min,:max,:strict_min_max,:frequency,:skip_first,:skip_last,:color,:text_size,:unit,:unit_position,:integers_only,:inside,:duration]
591
+ #
592
+ # [true] (true / false)
593
+ #
594
+ attr_accessor :enabled
595
+
596
+ #
597
+ # [false] (true / false) whether to reverse this axis values or not. If set to true, values will start from biggest number and will end with a smallest number
598
+ #
599
+ attr_accessor :reverse
600
+
601
+ #
602
+ # [0] (0 - 90) angle of rotation. If you want to rotate by degree from 1 to 89, you must have font.swf file in fonts folder
603
+ #
604
+ attr_accessor :rotate
605
+
606
+ #
607
+ # [] (Number) minimum value of this axis. If empty, this value will be calculated automatically.
608
+ #
609
+ attr_accessor :min
610
+
611
+ #
612
+ # [] (Number) maximum value of this axis. If empty, this value will be calculated automatically
613
+ #
614
+ attr_accessor :max
615
+
616
+ #
617
+ # [false] (true / false) by default, if your values are bigger then defined max (or smaller then defined min), max and min is changed so that all the chart would fit to chart area. If you don't want this, set this option to true.
618
+ #
619
+ attr_accessor :strict_min_max
620
+
621
+ #
622
+ # [1] (Number) how often values should be placed, 1 - near every gridline, 2 - near every second gridline...
623
+ #
624
+ attr_accessor :frequency
625
+
626
+ #
627
+ # [true] (true / false) to skip or not first value
628
+ #
629
+ attr_accessor :skip_first
630
+
631
+ #
632
+ # [false] (true / false) to skip or not last value
633
+ #
634
+ attr_accessor :skip_last
635
+
636
+ #
637
+ # [text_color] (hex color code)
638
+ #
639
+ attr_accessor :color
640
+
641
+ #
642
+ # [text_size] (Number)
643
+ #
644
+ attr_accessor :text_size
645
+
646
+ #
647
+ # [] (text) unit which will be added to values on y axis
648
+ #
649
+ attr_accessor :unit
650
+
651
+ #
652
+ # [right] (left / right)
653
+ #
654
+ attr_accessor :unit_position
655
+
656
+ #
657
+ # [false] (true / false) if set to true, values with decimals will be omitted
658
+ #
659
+ attr_accessor :integers_only
660
+
661
+ #
662
+ # [false] (true / false) if set to true, axis values will be displayed inside plot area. This setting will not work for values rotated by 1-89 degrees (0 and 90 only)
663
+ #
664
+ attr_accessor :inside
665
+
666
+ #
667
+ # [] (ss/mm/hh/DD) In case you want your axis to display formatted durations instead of numbers, you have to set the unit of the duration in your data file. For example, if your values in data file represents seconds, set "ss" here.
668
+ #
669
+ attr_accessor :duration
670
+ end
671
+ #
672
+ # y right axis
673
+ #
674
+ class YRight
675
+ include Base
676
+
677
+ VALUES = [:enabled,:reverse,:rotate,:min,:max,:strict_min_max,:frequency,:skip_first,:skip_last,:color,:text_size,:unit,:unit_position,:integers_only,:inside,:duration]
678
+ #
679
+ # [true] (true / false)
680
+ #
681
+ attr_accessor :enabled
682
+
683
+ #
684
+ # [false] (true / false) whether to reverse this axis values or not. If set to true, values will start from biggest number and will end with a smallest number
685
+ #
686
+ attr_accessor :reverse
687
+
688
+ #
689
+ # [0] (0 - 90) angle of rotation. If you want to rotate by degree from 1 to 89, you must have font.swf file in fonts folder
690
+ #
691
+ attr_accessor :rotate
692
+
693
+ #
694
+ # [] (Number) minimum value of this axis. If empty, this value will be calculated automatically
695
+ #
696
+ attr_accessor :min
697
+
698
+ #
699
+ # [] (Number) maximum value of this axis. If empty, this value will be calculated automatically
700
+ #
701
+ attr_accessor :max
702
+
703
+ #
704
+ # [false] (true / false) by default, if your values are bigger then defined max (or smaller then defined min), max and min is changed so that all the chart would fit to chart area. If you don't want this, set this option to true.
705
+ #
706
+ attr_accessor :strict_min_max
707
+
708
+ #
709
+ # [1] (Number) how often values should be placed, 1 - near every gridline, 2 - near every second gridline...
710
+ #
711
+ attr_accessor :frequency
712
+
713
+ #
714
+ # [true] (true / false) to skip or not first value
715
+ #
716
+ attr_accessor :skip_first
717
+
718
+ #
719
+ # [false] (true / false) to skip or not last value
720
+ #
721
+ attr_accessor :skip_last
722
+
723
+ #
724
+ # [text_color] (hex color code)
725
+ #
726
+ attr_accessor :color
727
+
728
+ #
729
+ # [text_size] (Number)
730
+ #
731
+ attr_accessor :text_size
732
+
733
+ #
734
+ # [] (text) unit which will be added to values on y axis
735
+ #
736
+ attr_accessor :unit
737
+
738
+ #
739
+ # [right] (left / right)
740
+ #
741
+ attr_accessor :unit_position
742
+
743
+ #
744
+ # [false] (true / false) if set to true, values with decimals will be omitted
745
+ #
746
+ attr_accessor :integers_only
747
+
748
+ #
749
+ # [false] (true / false) if set to true, axis values will be displayed inside plot area. This setting will not work for values rotated by 1-89 degrees (0 and 90 only)
750
+ #
751
+ attr_accessor :inside
752
+
753
+ #
754
+ # [] (ss/mm/hh/DD) In case you want your axis to display formatted durations instead of numbers, you have to set the unit of the duration in your data file. For example, if your values in data file represents seconds, set "ss" here.
755
+ #
756
+ attr_accessor :duration
757
+ end
758
+ end
759
+ #
760
+ # axes
761
+ #
762
+ class Axes
763
+ include Base
764
+
765
+ VALUES = [:x,:y_left,:y_right]
766
+ #
767
+ # X axis
768
+ #
769
+ attr_accessor :x
770
+
771
+ #
772
+ # Y left axis, visible only if at least one graph is assigned to this axis
773
+ #
774
+ attr_accessor :y_left
775
+
776
+ #
777
+ # Y right axis, visible only if at least one graph is assigned to this axis
778
+ #
779
+ attr_accessor :y_right
780
+
781
+
782
+ #
783
+ # X axis
784
+ #
785
+ class X
786
+ include Base
787
+
788
+ VALUES = [:color,:alpha,:width,:tick_length]
789
+ #
790
+ # [#000000] (hex color code)
791
+ #
792
+ attr_accessor :color
793
+
794
+ #
795
+ # [100] (0 - 100)
796
+ #
797
+ attr_accessor :alpha
798
+
799
+ #
800
+ # [2] (Number) line width, 0 for hairline
801
+ #
802
+ attr_accessor :width
803
+
804
+ #
805
+ # [7] (Number)
806
+ #
807
+ attr_accessor :tick_length
808
+ end
809
+ #
810
+ # Y left axis, visible only if at least one graph is assigned to this axis
811
+ #
812
+ class YLeft
813
+ include Base
814
+
815
+ VALUES = [:type,:color,:alpha,:width,:tick_length,:logarithmic]
816
+ #
817
+ # [line] (line, stacked, 100% stacked)
818
+ #
819
+ attr_accessor :type
820
+
821
+ #
822
+ # [#000000] (hex color code)
823
+ #
824
+ attr_accessor :color
825
+
826
+ #
827
+ # [100] (0 - 100)
828
+ #
829
+ attr_accessor :alpha
830
+
831
+ #
832
+ # [2] (Number) line width, 0 for hairline
833
+ #
834
+ attr_accessor :width
835
+
836
+ #
837
+ # [7] (Number)
838
+ #
839
+ attr_accessor :tick_length
840
+
841
+ #
842
+ # [false] (true / false) If set to true, this axis will use logarithmic scale instead of linear
843
+ #
844
+ attr_accessor :logarithmic
845
+ end
846
+ #
847
+ # Y right axis, visible only if at least one graph is assigned to this axis
848
+ #
849
+ class YRight
850
+ include Base
851
+
852
+ VALUES = [:type,:color,:alpha,:width,:tick_length,:logarithmic]
853
+ #
854
+ # [line] (line, stacked, 100% stacked)
855
+ #
856
+ attr_accessor :type
857
+
858
+ #
859
+ # [#000000] (hex color code)
860
+ #
861
+ attr_accessor :color
862
+
863
+ #
864
+ # [100] (0 - 100)
865
+ #
866
+ attr_accessor :alpha
867
+
868
+ #
869
+ # [2] (Number) line width, 0 for hairline
870
+ #
871
+ attr_accessor :width
872
+
873
+ #
874
+ # [7] (Number)
875
+ #
876
+ attr_accessor :tick_length
877
+
878
+ #
879
+ # [false] (true / false) If set to true, this axis will use logarithmic scale instead of linear
880
+ #
881
+ attr_accessor :logarithmic
882
+ end
883
+ end
884
+ #
885
+ # INDICATOR
886
+ #
887
+ class Indicator
888
+ include Base
889
+
890
+ VALUES = [:enabled,:zoomable,:color,:line_alpha,:selection_color,:selection_alpha,:x_balloon_enabled,:x_balloon_text_color]
891
+ #
892
+ # [true] (true / false)
893
+ #
894
+ attr_accessor :enabled
895
+
896
+ #
897
+ # [true] (true / false)
898
+ #
899
+ attr_accessor :zoomable
900
+
901
+ #
902
+ # [#BBBB00] (hex color code) line and x balloon background color
903
+ #
904
+ attr_accessor :color
905
+
906
+ #
907
+ # [100] (0 - 100)
908
+ #
909
+ attr_accessor :line_alpha
910
+
911
+ #
912
+ # [#BBBB00] (hex color code)
913
+ #
914
+ attr_accessor :selection_color
915
+
916
+ #
917
+ # [25] (0 - 100)
918
+ #
919
+ attr_accessor :selection_alpha
920
+
921
+ #
922
+ # [true] (true / false)
923
+ #
924
+ attr_accessor :x_balloon_enabled
925
+
926
+ #
927
+ # [text_color] (hex color code)
928
+ #
929
+ attr_accessor :x_balloon_text_color
930
+ end
931
+ #
932
+ # BALLOON
933
+ #
934
+ class Balloon
935
+ include Base
936
+
937
+ VALUES = [:enabled,:only_one,:on_off,:color,:alpha,:text_color,:text_size,:max_width,:corner_radius,:border_width,:border_alpha,:border_color]
938
+ #
939
+ # [true] (true / false)
940
+ #
941
+ attr_accessor :enabled
942
+
943
+ #
944
+ # [false] (true / false) if set to true, only one balloon at a time will be displayed
945
+ #
946
+ attr_accessor :only_one
947
+
948
+ #
949
+ # [true] (true/false) whether it will be possible to turn on or off y balloons by clicking on a legend or on a graph
950
+ #
951
+ attr_accessor :on_off
952
+
953
+ #
954
+ # [] (hex color code) balloon background color. If not set, graph.balloon_color will be used.
955
+ #
956
+ attr_accessor :color
957
+
958
+ #
959
+ # [] (0 - 100) balloon background opacity. If not set, graph.balloon_alpha will be used.
960
+ #
961
+ attr_accessor :alpha
962
+
963
+ #
964
+ # [] (hex color code) baloon text color. If not set, graph.balloon_text_color will be used
965
+ #
966
+ attr_accessor :text_color
967
+
968
+ #
969
+ # [text_size] (Number)
970
+ #
971
+ attr_accessor :text_size
972
+
973
+ #
974
+ # [] (Number) The maximum width of a balloon. If not set, half width of plot area will be used
975
+ #
976
+ attr_accessor :max_width
977
+
978
+ #
979
+ # [0] (Number) Corner radius of a balloon. If you set it > 0, the balloon will not display arrow
980
+ #
981
+ attr_accessor :corner_radius
982
+
983
+ #
984
+ # [0] (Number)
985
+ #
986
+ attr_accessor :border_width
987
+
988
+ #
989
+ # [balloon.alpha] (Number)
990
+ #
991
+ attr_accessor :border_alpha
992
+
993
+ #
994
+ # [balloon.color] (hex color code)
995
+ #
996
+ attr_accessor :border_color
997
+ end
998
+ #
999
+ # LEGEND
1000
+ #
1001
+ class Legend
1002
+ include Base
1003
+
1004
+ VALUES = [:enabled,:x,:y,:width,:max_columns,:color,:alpha,:border_color,:border_alpha,:text_color,:text_color_hover,:text_size,:spacing,:margins,:graph_on_off,:reverse_order,:align,:key,:values]
1005
+ #
1006
+ # [true] (true / false)
1007
+ #
1008
+ attr_accessor :enabled
1009
+
1010
+ #
1011
+ # [] (Number / Number% / !Number) if empty, will be equal to left margin
1012
+ #
1013
+ attr_accessor :x
1014
+
1015
+ #
1016
+ # [] (Number / Number% / !Number) if empty, will be 20px below x axis values
1017
+ #
1018
+ attr_accessor :y
1019
+
1020
+ #
1021
+ # [] (Number / Number%) if empty, will be equal to plot area width
1022
+ #
1023
+ attr_accessor :width
1024
+
1025
+ #
1026
+ # [] (Number) the maximum number of columns in the legend
1027
+ #
1028
+ attr_accessor :max_columns
1029
+
1030
+ #
1031
+ # [#FFFFFF] (hex color code) background color. Separate color codes with comas for gradient
1032
+ #
1033
+ attr_accessor :color
1034
+
1035
+ #
1036
+ # [0] (0 - 100) background alpha
1037
+ #
1038
+ attr_accessor :alpha
1039
+
1040
+ #
1041
+ # [#000000] (hex color code) border color
1042
+ #
1043
+ attr_accessor :border_color
1044
+
1045
+ #
1046
+ # [0] (0 - 100) border alpha
1047
+ #
1048
+ attr_accessor :border_alpha
1049
+
1050
+ #
1051
+ # [text_color] (hex color code)
1052
+ #
1053
+ attr_accessor :text_color
1054
+
1055
+ #
1056
+ # [#BBBB00] (hex color code)
1057
+ #
1058
+ attr_accessor :text_color_hover
1059
+
1060
+ #
1061
+ # [text_size] (Number)
1062
+ #
1063
+ attr_accessor :text_size
1064
+
1065
+ #
1066
+ # [10] (Number) vertical and horizontal gap between legend entries
1067
+ #
1068
+ attr_accessor :spacing
1069
+
1070
+ #
1071
+ # [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)
1072
+ #
1073
+ attr_accessor :margins
1074
+
1075
+ #
1076
+ # [true] (true / false) if true, color box gains "checkbox" function - it is possible to make graphs visible/invisible by clicking on this checkbox
1077
+ #
1078
+ attr_accessor :graph_on_off
1079
+
1080
+ #
1081
+ # [false] (true / false) whether to sort legend entries in a reverse order
1082
+ #
1083
+ attr_accessor :reverse_order
1084
+
1085
+ #
1086
+ # [left] (left / center / right) alignment of legend entries
1087
+ #
1088
+ attr_accessor :align
1089
+
1090
+ #
1091
+ # KEY (the color box near every legend entry)
1092
+ #
1093
+ attr_accessor :key
1094
+
1095
+ #
1096
+ # VALUES
1097
+ #
1098
+ attr_accessor :values
1099
+
1100
+
1101
+ #
1102
+ # KEY (the color box near every legend entry)
1103
+ #
1104
+ class Key
1105
+ include Base
1106
+
1107
+ VALUES = [:size,:border_color,:key_mark_color]
1108
+ #
1109
+ # [16] (Number) key size
1110
+ #
1111
+ attr_accessor :size
1112
+
1113
+ #
1114
+ # [] (hex color code) leave empty if you don't want to have border
1115
+ #
1116
+ attr_accessor :border_color
1117
+
1118
+ #
1119
+ # [#FFFFFF] (hex color code) key tick mark color
1120
+ #
1121
+ attr_accessor :key_mark_color
1122
+ end
1123
+ #
1124
+ # VALUES
1125
+ #
1126
+ class Values
1127
+ include Base
1128
+
1129
+ VALUES = [:enabled,:width,:align,:text]
1130
+ #
1131
+ # [false] (true / false) whether to show values near legend entries or not
1132
+ #
1133
+ attr_accessor :enabled
1134
+
1135
+ #
1136
+ # [80] (Number) width of text field for value
1137
+ #
1138
+ attr_accessor :width
1139
+
1140
+ #
1141
+ # [right] (right / left)
1142
+ #
1143
+ attr_accessor :align
1144
+
1145
+ #
1146
+ # [{value}] ({title} {value} {series} {description} {percents}) You can format any text: {value} will be replaced with value, {description} - with description and so on. You can add your own text or html code too.
1147
+ #
1148
+ attr_accessor :text
1149
+ end
1150
+ end
1151
+ #
1152
+ # line chart can also display vertical lines/columns (set <vertical_lines>true</vertical_lines> in graph settings for that). If you also set <line_alpha>0</line_alpha> your line chart will become column chart
1153
+ #
1154
+ class VerticalLines
1155
+ include Base
1156
+
1157
+ VALUES = [:width,:alpha,:clustered,:mask]
1158
+ #
1159
+ # [0] (0 - 100) width of vertical line in percents. 0 for hairline. Set > 0 if you want to have column
1160
+ #
1161
+ attr_accessor :width
1162
+
1163
+ #
1164
+ # [100] (0 - 100)
1165
+ #
1166
+ attr_accessor :alpha
1167
+
1168
+ #
1169
+ # [false] in case you have more then one graph with vertical lines enabled, you might want to place your columns next to each other, set true for that.
1170
+ #
1171
+ attr_accessor :clustered
1172
+
1173
+ #
1174
+ # [true] (true / false) as line chart by default starts on axis, and your column width is >0, then some part of first and last column will be outside plot area (incase you don't set <start_on_axis>false</false> Mask will cut off the part outside the plot area. Set to false if you don't want this.
1175
+ #
1176
+ attr_accessor :mask
1177
+ end
1178
+ #
1179
+
1180
+ #
1181
+ class ZoomOutButton
1182
+ include Base
1183
+
1184
+ VALUES = [:x,:y,:color,:alpha,:text_color,:text_color_hover,:text_size,:text]
1185
+ #
1186
+ # [] (Number / Number% / !Number) x position of zoom out button, if not defined, will be aligned to right of plot area
1187
+ #
1188
+ attr_accessor :x
1189
+
1190
+ #
1191
+ # [] (Number / Number% / !Number) y position of zoom out button, if not defined, will be aligned to top of plot area
1192
+ #
1193
+ attr_accessor :y
1194
+
1195
+ #
1196
+ # [#BBBB00] (hex color code) background color
1197
+ #
1198
+ attr_accessor :color
1199
+
1200
+ #
1201
+ # [0] (0 - 100) background alpha
1202
+ #
1203
+ attr_accessor :alpha
1204
+
1205
+ #
1206
+ # [text_color] (hex color code) button text and magnifying glass icon color
1207
+ #
1208
+ attr_accessor :text_color
1209
+
1210
+ #
1211
+ # [#BBBB00] (hex color code) button text and magnifying glass icon roll over color
1212
+ #
1213
+ attr_accessor :text_color_hover
1214
+
1215
+ #
1216
+ # [text_size] (Number) button text size
1217
+ #
1218
+ attr_accessor :text_size
1219
+
1220
+ #
1221
+ # [Show all] (text)
1222
+ #
1223
+ attr_accessor :text
1224
+ end
1225
+ #
1226
+ # HELP button and balloon
1227
+ #
1228
+ class Help
1229
+ include Base
1230
+
1231
+ VALUES = [:button,:balloon]
1232
+ #
1233
+ # help button is only visible if balloon text is defined
1234
+ #
1235
+ attr_accessor :button
1236
+
1237
+ #
1238
+ # help balloon
1239
+ #
1240
+ attr_accessor :balloon
1241
+
1242
+
1243
+ #
1244
+ # help button is only visible if balloon text is defined
1245
+ #
1246
+ class Button
1247
+ include Base
1248
+
1249
+ VALUES = [:x,:y,:color,:alpha,:text_color,:text_color_hover,:text_size,:text]
1250
+ #
1251
+ # [] (Number / Number% / !Number) x position of help button, if not defined, will be aligned to right of chart area
1252
+ #
1253
+ attr_accessor :x
1254
+
1255
+ #
1256
+ # [] (Number / Number% / !Number) y position of help button, if not defined, will be aligned to top of chart area
1257
+ #
1258
+ attr_accessor :y
1259
+
1260
+ #
1261
+ # [#000000] (hex color code) background color
1262
+ #
1263
+ attr_accessor :color
1264
+
1265
+ #
1266
+ # [100] (0 - 100) background alpha
1267
+ #
1268
+ attr_accessor :alpha
1269
+
1270
+ #
1271
+ # [#FFFFFF] (hex color code) button text color
1272
+ #
1273
+ attr_accessor :text_color
1274
+
1275
+ #
1276
+ # [#BBBB00](hex color code) button text roll over color
1277
+ #
1278
+ attr_accessor :text_color_hover
1279
+
1280
+ #
1281
+ # [] (Number) button text size
1282
+ #
1283
+ attr_accessor :text_size
1284
+
1285
+ #
1286
+ # [?] (text)
1287
+ #
1288
+ attr_accessor :text
1289
+ end
1290
+ #
1291
+ # help balloon
1292
+ #
1293
+ class Balloon
1294
+ include Base
1295
+
1296
+ VALUES = [:color,:alpha,:width,:text_color,:text_size,:text]
1297
+ #
1298
+ # [#000000] (hex color code) background color
1299
+ #
1300
+ attr_accessor :color
1301
+
1302
+ #
1303
+ # [100] (0 - 100) background alpha
1304
+ #
1305
+ attr_accessor :alpha
1306
+
1307
+ #
1308
+ # [300] (Number)
1309
+ #
1310
+ attr_accessor :width
1311
+
1312
+ #
1313
+ # [#FFFFFF] (hex color code) button text color
1314
+ #
1315
+ attr_accessor :text_color
1316
+
1317
+ #
1318
+ # [] (Number) button text size
1319
+ #
1320
+ attr_accessor :text_size
1321
+
1322
+ #
1323
+ # [] (text) some html tags may be used (supports <b>, <i>, <u>, <font>, <br/>. Enter text between []: <![CDATA[your <b>bold</b> and <i>italic</i> text]]>
1324
+ #
1325
+ attr_accessor :text
1326
+ end
1327
+ end
1328
+ #
1329
+ # export_as_image feature works only on a web server
1330
+ #
1331
+ class ExportAsImage
1332
+ include Base
1333
+
1334
+ VALUES = [:file,:target,:x,:y,:color,:alpha,:text_color,:text_size]
1335
+ #
1336
+ # [] (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 amline/export.php or amline/export.aspx)
1337
+ #
1338
+ attr_accessor :file
1339
+
1340
+ #
1341
+ # [] (_blank, _top ...) target of a window in which export file must be called
1342
+ #
1343
+ attr_accessor :target
1344
+
1345
+ #
1346
+ # [0] (Number / Number% / !Number) x position of "Collecting data" text
1347
+ #
1348
+ attr_accessor :x
1349
+
1350
+ #
1351
+ # [] (Number / Number% / !Number) y position of "Collecting data" text. If not set, will be aligned to the bottom of flash movie
1352
+ #
1353
+ attr_accessor :y
1354
+
1355
+ #
1356
+ # [#BBBB00] (hex color code) background color of "Collecting data" text
1357
+ #
1358
+ attr_accessor :color
1359
+
1360
+ #
1361
+ # [0] (0 - 100) background alpha
1362
+ #
1363
+ attr_accessor :alpha
1364
+
1365
+ #
1366
+ # [text_color] (hex color code)
1367
+ #
1368
+ attr_accessor :text_color
1369
+
1370
+ #
1371
+ # [text_size] (Number)
1372
+ #
1373
+ attr_accessor :text_size
1374
+ end
1375
+ #
1376
+ # "error_messages" settings will be applied for all error messages except the one which is showed if settings file wasn't found
1377
+ #
1378
+ class ErrorMessages
1379
+ include Base
1380
+
1381
+ VALUES = [:enabled,:x,:y,:color,:alpha,:text_color,:text_size]
1382
+ #
1383
+ # [true] (true / false)
1384
+ #
1385
+ attr_accessor :enabled
1386
+
1387
+ #
1388
+ # [] (Number / Number% / !Number) x position of error message. If not set, will be aligned to the center
1389
+ #
1390
+ attr_accessor :x
1391
+
1392
+ #
1393
+ # [] (Number / Number% / !Number) y position of error message. If not set, will be aligned to the center
1394
+ #
1395
+ attr_accessor :y
1396
+
1397
+ #
1398
+ # [#BBBB00] (hex color code) background color of error message. Separate color codes with comas for gradient
1399
+ #
1400
+ attr_accessor :color
1401
+
1402
+ #
1403
+ # [100] (0 - 100) background alpha
1404
+ #
1405
+ attr_accessor :alpha
1406
+
1407
+ #
1408
+ # [#FFFFFF] (hex color code)
1409
+ #
1410
+ attr_accessor :text_color
1411
+
1412
+ #
1413
+ # [text_size] (Number)
1414
+ #
1415
+ attr_accessor :text_size
1416
+ end
1417
+ #
1418
+
1419
+ #
1420
+ class Strings
1421
+ include Base
1422
+
1423
+ VALUES = [:no_data,:export_as_image,:error_in_data_file,:collecting_data,:wrong_zoom_value,:ss,:mm,:hh,:DD]
1424
+ #
1425
+ # [No data for selected period] (text) if data for selected period is missing, this message will be displayed
1426
+ #
1427
+ attr_accessor :no_data
1428
+
1429
+ #
1430
+ # [Export as image] (text) text for right click menu
1431
+ #
1432
+ attr_accessor :export_as_image
1433
+
1434
+ #
1435
+ # [Error in data file] (text) this text is displayed if there is an error in data file or there is no data in file. "There is no data" means that there should actually be at least one space in data file. If data file will be completly empty, it will display "error loading file" text
1436
+ #
1437
+ attr_accessor :error_in_data_file
1438
+
1439
+ #
1440
+ # [Collecting data] (text) this text is displayed while exporting chart to an image
1441
+ #
1442
+ attr_accessor :collecting_data
1443
+
1444
+ #
1445
+ # the strings below are only important if you format your axis values as durations
1446
+ #
1447
+ attr_accessor :wrong_zoom_value
1448
+
1449
+ #
1450
+ # [] unit of seconds
1451
+ #
1452
+ attr_accessor :ss
1453
+
1454
+ #
1455
+ # [:] unit of minutes
1456
+ #
1457
+ attr_accessor :mm
1458
+
1459
+ #
1460
+ # [:] unit of hours
1461
+ #
1462
+ attr_accessor :hh
1463
+
1464
+ #
1465
+ # [d. ] unit of days
1466
+ #
1467
+ attr_accessor :DD
1468
+ end
1469
+ #
1470
+ # <menu function_name="printChart" title="Print chart"></menu>
1471
+ #
1472
+ class ContextMenu
1473
+ include Base
1474
+
1475
+ VALUES = [:default_items]
1476
+ #
1477
+
1478
+ #
1479
+ attr_accessor :default_items
1480
+
1481
+
1482
+ #
1483
+
1484
+ #
1485
+ class DefaultItems
1486
+ include Base
1487
+
1488
+ VALUES = [:zoom,:print]
1489
+ #
1490
+ # [false] (true / false) to show or not flash players zoom menu
1491
+ #
1492
+ attr_accessor :zoom
1493
+
1494
+ #
1495
+ # [true] (true / false) to show or not flash players print menu
1496
+ #
1497
+ attr_accessor :print
1498
+ end
1499
+ end
1500
+ #
1501
+ # labels can also be added in data xml file, using exactly the same structure like it is here
1502
+ #
1503
+ class Labels
1504
+ include Base
1505
+
1506
+ VALUES = [:label]
1507
+ #
1508
+
1509
+ #
1510
+ attr_accessor :label
1511
+
1512
+
1513
+ #
1514
+
1515
+ #
1516
+ class Label
1517
+ include Base
1518
+
1519
+ VALUES = [:x,:y,:rotate,:width,:align,:text_color,:text_size,:text]
1520
+ ATTRIBUTES = [:lid]
1521
+ #
1522
+ # [0] (Number / Number% / !Number)
1523
+ #
1524
+ attr_accessor :x
1525
+
1526
+ #
1527
+ # [0] (Number / Number% / !Number)
1528
+ #
1529
+ attr_accessor :y
1530
+
1531
+ #
1532
+ # [false] (true / false)
1533
+ #
1534
+ attr_accessor :rotate
1535
+
1536
+ #
1537
+ # [] (Number / Number%) if empty, will stretch from left to right untill label fits
1538
+ #
1539
+ attr_accessor :width
1540
+
1541
+ #
1542
+ # [left] (left / center / right)
1543
+ #
1544
+ attr_accessor :align
1545
+
1546
+ #
1547
+ # [text_color] (hex color code) button text color
1548
+ #
1549
+ attr_accessor :text_color
1550
+
1551
+ #
1552
+ # [text_size](Number) button text size
1553
+ #
1554
+ attr_accessor :text_size
1555
+
1556
+ #
1557
+ # [] (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]]>
1558
+ #
1559
+ attr_accessor :text
1560
+
1561
+ #
1562
+ # xml attribute
1563
+ #
1564
+ attr_accessor :lid
1565
+ end
1566
+ end
1567
+ #
1568
+ # if graph settings are defined both here and in data file, the ones from data file are used
1569
+ #
1570
+ class Graphs
1571
+ include Base
1572
+
1573
+ VALUES = [:graph]
1574
+ #
1575
+ # if you are using XML data file, graph "gid" must match graph "gid" in data file
1576
+ #
1577
+ attr_accessor :graph
1578
+
1579
+
1580
+ #
1581
+ # if you are using XML data file, graph "gid" must match graph "gid" in data file
1582
+ #
1583
+ class Graph
1584
+ include Base
1585
+
1586
+ VALUES = [:axis,:title,:color,:color_hover,:line_alpha,:line_width,:fill_alpha,:fill_color,:balloon_color,:balloon_alpha,:balloon_text_color,:bullet,:bullet_size,:bullet_color,:bullet_alpha,:hidden,:selected,:balloon_text,:data_labels,:data_labels_text_color,:data_labels_text_size,:data_labels_position,:vertical_lines,:visible_in_legend]
1587
+ ATTRIBUTES = [:gid]
1588
+ #
1589
+ # [left] (left/ right) indicates which y axis should be used
1590
+ #
1591
+ attr_accessor :axis
1592
+
1593
+ #
1594
+ # [] (graph title)
1595
+ #
1596
+ attr_accessor :title
1597
+
1598
+ #
1599
+ # [] (hex color code) if not defined, uses colors from this array: #FF0000, #0000FF, #00FF00, #FF9900, #CC00CC, #00CCCC, #33FF00, #990000, #000066
1600
+ #
1601
+ attr_accessor :color
1602
+
1603
+ #
1604
+ # [#BBBB00] (hex color code)
1605
+ #
1606
+ attr_accessor :color_hover
1607
+
1608
+ #
1609
+ # [100] (0 - 100)
1610
+ #
1611
+ attr_accessor :line_alpha
1612
+
1613
+ #
1614
+ # [0] (Number) 0 for hairline
1615
+ #
1616
+ attr_accessor :line_width
1617
+
1618
+ #
1619
+ # [0] (0 - 100) if you want the chart to be area chart, use bigger than 0 value
1620
+ #
1621
+ attr_accessor :fill_alpha
1622
+
1623
+ #
1624
+ # [grpah.color] (hex color code). Separate color codes with comas for gradient
1625
+ #
1626
+ attr_accessor :fill_color
1627
+
1628
+ #
1629
+ # [graph color] (hex color code) leave empty to use the same color as graph
1630
+ #
1631
+ attr_accessor :balloon_color
1632
+
1633
+ #
1634
+ # [100] (0 - 100)
1635
+ #
1636
+ attr_accessor :balloon_alpha
1637
+
1638
+ #
1639
+ # [#FFFFFF] (hex color code)
1640
+ #
1641
+ attr_accessor :balloon_text_color
1642
+
1643
+ #
1644
+ # The chart will look for this file in "path" folder ("path" is set in HTML)
1645
+ #
1646
+ attr_accessor :bullet
1647
+
1648
+ #
1649
+ # [8](Number) affects only predefined bullets, does not change size of custom loaded bullets
1650
+ #
1651
+ attr_accessor :bullet_size
1652
+
1653
+ #
1654
+ # [graph color] (hex color code) affects only predefined (square and round) bullets, does not change color of custom loaded bullets. Leave empty to use the same color as graph
1655
+ #
1656
+ attr_accessor :bullet_color
1657
+
1658
+ #
1659
+ # [graph alpha] (hex color code) Leave empty to use the same alpha as graph
1660
+ #
1661
+ attr_accessor :bullet_alpha
1662
+
1663
+ #
1664
+ # [false] (true / false) vill not be visible until you check corresponding checkbox in the legend
1665
+ #
1666
+ attr_accessor :hidden
1667
+
1668
+ #
1669
+ # [true] (true / false) if true, balloon indicating value will be visible then roll over plot area
1670
+ #
1671
+ attr_accessor :selected
1672
+
1673
+ #
1674
+ # [<b>{value}</b><br>{description}] ({title} {value} {series} {description} {percents}) You can format any balloon text: {title} will be replaced with real title, {value} - with value and so on. You can add your own text or html code too.
1675
+ #
1676
+ attr_accessor :balloon_text
1677
+
1678
+ #
1679
+ # to avoid overlapping, data labels, the same as bullets are not visible if there are more then hide_bullets_count data points on plot area.
1680
+ #
1681
+ attr_accessor :data_labels
1682
+
1683
+ #
1684
+ # [text_color] (hex color code)
1685
+ #
1686
+ attr_accessor :data_labels_text_color
1687
+
1688
+ #
1689
+ # [text_size] (Number)
1690
+ #
1691
+ attr_accessor :data_labels_text_size
1692
+
1693
+ #
1694
+ # [above] (below / above)
1695
+ #
1696
+ attr_accessor :data_labels_position
1697
+
1698
+ #
1699
+ # [false] (true / false) whether to draw vertical lines or not. If you want to show vertical lines only (without the graph, set line_alpha to 0
1700
+ #
1701
+ attr_accessor :vertical_lines
1702
+
1703
+ #
1704
+ # [true] (true / false) whether to show legend entry for this graph or not
1705
+ #
1706
+ attr_accessor :visible_in_legend
1707
+
1708
+ #
1709
+ # xml attribute
1710
+ #
1711
+ attr_accessor :gid
1712
+ end
1713
+ end
1714
+ #
1715
+ # guides are straight lines drawn through all plot area at a give value. Can also be filled with color
1716
+ #
1717
+ class Guides
1718
+ include Base
1719
+
1720
+ VALUES = [:max_min,:guide]
1721
+ #
1722
+ # [false] (true / false) whether to include guides' values when calculating min and max of a chart
1723
+ #
1724
+ attr_accessor :max_min
1725
+
1726
+ #
1727
+ # there can be any number of quides. guides can also be set in data xml file, using the same syntax as here
1728
+ #
1729
+ attr_accessor :guide
1730
+
1731
+
1732
+ #
1733
+ # there can be any number of quides. guides can also be set in data xml file, using the same syntax as here
1734
+ #
1735
+ class Guide
1736
+ include Base
1737
+
1738
+ VALUES = [:axis,:start_value,:end_value,:title,:width,:color,:alpha,:fill_color,:fill_alpha,:inside,:centered,:rotate,:text_size,:text_color,:dashed,:dash_length]
1739
+ #
1740
+ # [left] (left / right) y axis of a guide. There should be at least one graph assigned to this axis in order guide to be visible
1741
+ #
1742
+ attr_accessor :axis
1743
+
1744
+ #
1745
+ # (Number) value at which guide should be placed
1746
+ #
1747
+ attr_accessor :start_value
1748
+
1749
+ #
1750
+ # (Number) if you set value here too, another quide will be drawn. If you set fill alpha > 0, then the area between these quides will be filled with color
1751
+ #
1752
+ attr_accessor :end_value
1753
+
1754
+ #
1755
+ # [] (String) text which will be displayed near the guide
1756
+ #
1757
+ attr_accessor :title
1758
+
1759
+ #
1760
+ # [0] (Number) width of a guide line (0 for hairline)
1761
+ #
1762
+ attr_accessor :width
1763
+
1764
+ #
1765
+ # [#000000] (hex color code) color of guide line
1766
+ #
1767
+ attr_accessor :color
1768
+
1769
+ #
1770
+ # [100] (0 - 100) opacity of guide line
1771
+ #
1772
+ attr_accessor :alpha
1773
+
1774
+ #
1775
+ # [guide.color] (hex color code) fill color. If not defined, color of a guide will be used. Separate color codes with comas for gradient
1776
+ #
1777
+ attr_accessor :fill_color
1778
+
1779
+ #
1780
+ # [0] (0 - 100) opacity of a fill
1781
+ #
1782
+ attr_accessor :fill_alpha
1783
+
1784
+ #
1785
+ # [values.y_{axis}.inside] whether to place title inside plot area
1786
+ #
1787
+ attr_accessor :inside
1788
+
1789
+ #
1790
+ # [true] (true / false) if you have start and end values defined, title can be placed in the middle between these values. If false, it will be placed near start_value
1791
+ #
1792
+ attr_accessor :centered
1793
+
1794
+ #
1795
+ # [values.y_{axis}.rotate](0 - 90) angle of rotation of title
1796
+ #
1797
+ attr_accessor :rotate
1798
+
1799
+ #
1800
+ # [values.y_{axis}.text_size] (Number)
1801
+ #
1802
+ attr_accessor :text_size
1803
+
1804
+ #
1805
+ # [values.y_{axis}.color](hex color code)
1806
+ #
1807
+ attr_accessor :text_color
1808
+
1809
+ #
1810
+ # [false] (true / false)
1811
+ #
1812
+ attr_accessor :dashed
1813
+
1814
+ #
1815
+ # [5] (Number)
1816
+ #
1817
+ attr_accessor :dash_length
1818
+ end
1819
+ end
1820
+ end
1821
+ end
1822
+ end