Class: Ambling::Stock::Settings::Charts::Chart::Graphs::Graph
- Inherits:
-
Object
- Object
- Ambling::Stock::Settings::Charts::Chart::Graphs::Graph
- Includes:
- Base
- Defined in:
- lib/ambling/stock.rb
Overview
- left
-
(left / right) axis of this graph #
Defined Under Namespace
Classes: DataSources, Legend
Constant Summary collapse
- VALUES =
[:axis,:type,:connect,:data_sources,:period_value,:compare_source,:title,:color,:cursor_color,:cursor_alpha,:positive_color,:negative_color,:width,:alpha,:fill_alpha,:dashed,:bullet,:bullet_size,:smoothed,:stack_to,:legend]
- ATTRIBUTES =
[:gid]
Instance Attribute Summary collapse
-
#alpha ⇒ Object
- 0
-
(0 - 100) opacity of fill #.
-
#axis ⇒ Object
- line
-
(line / column / candlestick / ohlc / step / step_no_risers ) the type of this graph #.
-
#bullet ⇒ Object
- 6
-
(Number) #.
-
#bullet_size ⇒ Object
- false
-
(true / false) whether to smooth line or not #.
-
#color ⇒ Object
- data_set.color
-
(hex code) #.
-
#compare_source ⇒ Object
-
(text) title of the graph can be displayed in the legend #.
-
#connect ⇒ Object
data sources define which column from data CSV file will be used.
-
#cursor_alpha ⇒ Object
- #00CC00
-
(hex code) “candlestick” and “ohlc” chart types do not use graph color, they use positive and negative colors to show whether value of the period increased or decreased #.
-
#cursor_color ⇒ Object
- 100
-
(0 - 100) opacity of the cursor#.
-
#dashed ⇒ Object
-
(round / square / round_outline / square_outline / round_outlined / square_outlined only “line” and “step” graph types can have bullets #.
-
#data_sources ⇒ Object
Returns the value of attribute data_sources.
-
#fill_alpha ⇒ Object
- false
-
(true / false) whether the graph should be dashed #.
-
#gid ⇒ Object
xml attribute.
-
#legend ⇒ Object
Returns the value of attribute legend.
-
#negative_color ⇒ Object
- 0
-
(Number) width of a line (in case type is “line”, “step” or “ohlc”), also for high/low of “candlestick”.
-
#period_value ⇒ Object
-
(the name of column) you should set which column of your data sets will be used for “comparing” graph.
-
#positive_color ⇒ Object
- #CC0000
-
(hex code) #.
-
#smoothed ⇒ Object
-
(gid of another graph) You can stack this graph to another.
-
#stack_to ⇒ Object
the following section describes what information should be shown in the legend.
-
#title ⇒ Object
- data_set.color
-
(hex code) by default, graph uses data set color.
-
#type ⇒ Object
- true
-
(true / false) whether to connect data points if there are some missing data between them.
-
#width ⇒ Object
- 100
-
(0 - 100) graph opacity #.
Method Summary
Methods included from Base
#build_xml, #initialize, #populate, #to_xml
Instance Attribute Details
#alpha ⇒ Object
- 0
-
(0 - 100) opacity of fill #
1004 1005 1006 |
# File 'lib/ambling/stock.rb', line 1004 def alpha @alpha end |
#axis ⇒ Object
- line
-
(line / column / candlestick / ohlc / step / step_no_risers ) the type of this graph #
944 945 946 |
# File 'lib/ambling/stock.rb', line 944 def axis @axis end |
#bullet ⇒ Object
- 6
-
(Number) #
1017 1018 1019 |
# File 'lib/ambling/stock.rb', line 1017 def bullet @bullet end |
#bullet_size ⇒ Object
- false
-
(true / false) whether to smooth line or not #
1021 1022 1023 |
# File 'lib/ambling/stock.rb', line 1021 def bullet_size @bullet_size end |
#color ⇒ Object
- data_set.color
-
(hex code) #
977 978 979 |
# File 'lib/ambling/stock.rb', line 977 def color @color end |
#compare_source ⇒ Object
-
(text) title of the graph can be displayed in the legend #
968 969 970 |
# File 'lib/ambling/stock.rb', line 968 def compare_source @compare_source end |
#connect ⇒ Object
data sources define which column from data CSV file will be used.
line, column and step charts requires <close> data source only
candlestick and ohlc charts requires <open>, <close>, <low> and <high> data sources #
955 956 957 |
# File 'lib/ambling/stock.rb', line 955 def connect @connect end |
#cursor_alpha ⇒ Object
- #00CC00
-
(hex code) “candlestick” and “ohlc” chart types do not use graph color, they use positive and negative colors to show whether value of the period increased or decreased #
986 987 988 |
# File 'lib/ambling/stock.rb', line 986 def cursor_alpha @cursor_alpha end |
#cursor_color ⇒ Object
- 100
-
(0 - 100) opacity of the cursor#
981 982 983 |
# File 'lib/ambling/stock.rb', line 981 def cursor_color @cursor_color end |
#dashed ⇒ Object
-
(round / square / round_outline / square_outline / round_outlined / square_outlined
only "line" and "step" graph types can have bullets #
1013 1014 1015 |
# File 'lib/ambling/stock.rb', line 1013 def dashed @dashed end |
#data_sources ⇒ Object
Returns the value of attribute data_sources.
959 960 961 |
# File 'lib/ambling/stock.rb', line 959 def data_sources @data_sources end |
#fill_alpha ⇒ Object
- false
-
(true / false) whether the graph should be dashed #
1008 1009 1010 |
# File 'lib/ambling/stock.rb', line 1008 def fill_alpha @fill_alpha end |
#gid ⇒ Object
xml attribute
1061 1062 1063 |
# File 'lib/ambling/stock.rb', line 1061 def gid @gid end |
#legend ⇒ Object
Returns the value of attribute legend.
1056 1057 1058 |
# File 'lib/ambling/stock.rb', line 1056 def legend @legend end |
#negative_color ⇒ Object
- 0
-
(Number) width of a line (in case type is “line”, “step” or “ohlc”), also for
high/low of "candlestick". If you set column_width to 0, vertical lines will also use this width #
996 997 998 |
# File 'lib/ambling/stock.rb', line 996 def negative_color @negative_color end |
#period_value ⇒ Object
-
(the name of column) you should set which column of your data sets will be used
for "comparing" graph. Do not set anything here if this graph doesn't need to be compared #
964 965 966 |
# File 'lib/ambling/stock.rb', line 964 def period_value @period_value end |
#positive_color ⇒ Object
- #CC0000
-
(hex code) #
990 991 992 |
# File 'lib/ambling/stock.rb', line 990 def positive_color @positive_color end |
#smoothed ⇒ Object
-
(gid of another graph) You can stack this graph to another. Graphs can not be smoothed.
The graph to which you are stacking must be described above the graph which you are stacking. #
1026 1027 1028 |
# File 'lib/ambling/stock.rb', line 1026 def smoothed @smoothed end |
#stack_to ⇒ Object
the following section describes what information should be shown in the legend. There
are 4 different states:
1) mouse is over plot area and no data sets for comparing are selected - <date>
2) mouse is away from plot area and no data sets for comparing are selected - <period>
3) mouse is over plot area and at data set for comparing is selected: - <date_comparing>
4) mouse is away plot area and at data set for comparing is selected: - <period_comparing>
"key" attribute defines whether color key should be displayed near the legend entry;
"title" defines whether short title of the data set should be displayed near the legend entry
Use names of <data_sources> to display value of a date or period:
{open}, {close}, {high}, {low}
You can aslo use {sum} and {average} to display the sum or average.
If you want to show percent change of a value use the following syntax:
{close.percents}
If you want to show value change, use:
{close.change}
Note, that the legend is not wrapped, so you should think about the length of your legend
#
1052 1053 1054 |
# File 'lib/ambling/stock.rb', line 1052 def stack_to @stack_to end |
#title ⇒ Object
- data_set.color
-
(hex code) by default, graph uses data set color. However, as you
can have more then one graph from one data set, you can set different color here #
973 974 975 |
# File 'lib/ambling/stock.rb', line 973 def title @title end |
#type ⇒ Object
- true
-
(true / false) whether to connect data points if there are some missing data between
them. This applies for line and step line graph types only. #
949 950 951 |
# File 'lib/ambling/stock.rb', line 949 def type @type end |
#width ⇒ Object
- 100
-
(0 - 100) graph opacity #
1000 1001 1002 |
# File 'lib/ambling/stock.rb', line 1000 def width @width end |