Class: Ambling::Pie::Settings::Pie
- Inherits:
-
Object
- Object
- Ambling::Pie::Settings::Pie
- Includes:
- Base
- Defined in:
- lib/ambling/pie.rb
Constant Summary collapse
- 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]
Instance Attribute Summary collapse
-
#alpha ⇒ Object
- 100
-
(0 - 100) slices alpha.
-
#angle ⇒ Object
- 0
-
(0 - 90) lean angle (for 3D effect).
-
#base_color ⇒ Object
-
(hex color code) color of first slice.
-
-
#brightness_step ⇒ Object
- 20
-
(-100 - 100) if base_color is used, every next slice is filled with lighter by brightnessStep % color.
-
#colors ⇒ Object
- #FF0F00,#FF6600,#FF9E01,#FCD202,#F8FF01,#B0DE09,#04D215,#0D8ECF,#0D52D1,#2A0CD0,#8A0CCF,#CD0D74,#754DEB,#DDDDDD,#999999,#333333,#990000
-
(hex color codes separated by comas).
-
#gradient ⇒ Object
-
(linear/radial) Allows slices to be filled with gradient colors.
-
-
#gradient_ratio ⇒ Object
- 0,-40
-
(Numbers from (-255 to 255) separated by commas) Controls the gradient ratio.
-
#height ⇒ Object
- 0
-
(Number) pie height (for 3D effect).
-
#hover_brightness ⇒ Object
- 0
-
(from -255 to 255) The pie slice may darken/lighten when the use rolls over it.
-
#inner_radius ⇒ Object
- 0
-
(Number / Number%) the radius of the hole (if you want to have donut, use > 0).
-
#link_target ⇒ Object
-
(_blank, _top…) If pie slice has a link this is link target.
-
-
#outline_alpha ⇒ Object
- 0
-
(Number).
-
#outline_color ⇒ Object
- #FFFFFF
-
(hex color code).
-
#radius ⇒ Object
- 25%
-
(Number / Number%).
-
#start_angle ⇒ Object
- 90
-
(0-360) angle of a first slice.
-
#x ⇒ Object
[50%](Number / Number% / !Number).
-
#y ⇒ Object
[45%](Number / Number% / !Number).
Method Summary
Methods included from Base
#build_xml, #initialize, #populate, #to_xml
Instance Attribute Details
#alpha ⇒ Object
- 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.
224 225 226 |
# File 'lib/ambling/pie.rb', line 224 def alpha @alpha end |
#angle ⇒ Object
- 0
-
(0 - 90) lean angle (for 3D effect)
184 185 186 |
# File 'lib/ambling/pie.rb', line 184 def angle @angle end |
#base_color ⇒ Object
-
(hex color code) color of first slice
204 205 206 |
# File 'lib/ambling/pie.rb', line 204 def base_color @base_color end |
#brightness_step ⇒ Object
- 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
209 210 211 |
# File 'lib/ambling/pie.rb', line 209 def brightness_step @brightness_step end |
#colors ⇒ Object
- #FF0F00,#FF6600,#FF9E01,#FCD202,#F8FF01,#B0DE09,#04D215,#0D8ECF,#0D52D1,#2A0CD0,#8A0CCF,#CD0D74,#754DEB,#DDDDDD,#999999,#333333,#990000
-
(hex color codes separated by comas)
214 215 216 |
# File 'lib/ambling/pie.rb', line 214 def colors @colors end |
#gradient ⇒ Object
-
(linear/radial) Allows slices to be filled with gradient colors
234 235 236 |
# File 'lib/ambling/pie.rb', line 234 def gradient @gradient end |
#gradient_ratio ⇒ Object
- 0,-40
-
(Numbers from (-255 to 255) separated by commas) Controls the gradient ratio
239 240 241 |
# File 'lib/ambling/pie.rb', line 239 def gradient_ratio @gradient_ratio end |
#height ⇒ Object
- 0
-
(Number) pie height (for 3D effect)
179 180 181 |
# File 'lib/ambling/pie.rb', line 179 def height @height end |
#hover_brightness ⇒ Object
- 0
-
(from -255 to 255) The pie slice may darken/lighten when the use rolls over it. The intensity may be set here
229 230 231 |
# File 'lib/ambling/pie.rb', line 229 def hover_brightness @hover_brightness end |
#inner_radius ⇒ Object
- 0
-
(Number / Number%) the radius of the hole (if you want to have donut, use > 0)
174 175 176 |
# File 'lib/ambling/pie.rb', line 174 def inner_radius @inner_radius end |
#link_target ⇒ Object
-
(_blank, _top…) If pie slice has a link this is link target
219 220 221 |
# File 'lib/ambling/pie.rb', line 219 def link_target @link_target end |
#outline_alpha ⇒ Object
- 0
-
(Number)
199 200 201 |
# File 'lib/ambling/pie.rb', line 199 def outline_alpha @outline_alpha end |
#outline_color ⇒ Object
- #FFFFFF
-
(hex color code)
194 195 196 |
# File 'lib/ambling/pie.rb', line 194 def outline_color @outline_color end |
#radius ⇒ Object
- 25%
-
(Number / Number%)
169 170 171 |
# File 'lib/ambling/pie.rb', line 169 def radius @radius end |
#start_angle ⇒ Object
- 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
189 190 191 |
# File 'lib/ambling/pie.rb', line 189 def start_angle @start_angle end |
#x ⇒ Object
[50%](Number / Number% / !Number)
159 160 161 |
# File 'lib/ambling/pie.rb', line 159 def x @x end |
#y ⇒ Object
[45%](Number / Number% / !Number)
164 165 166 |
# File 'lib/ambling/pie.rb', line 164 def y @y end |