Class: Vega::Chart
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from BaseChart
#embed_options!, #to_html, #to_iruby, #to_iruby_mimebundle, #to_json
Constructor Details
#initialize ⇒ Chart
Returns a new instance of Chart.
16
17
18
19
|
# File 'lib/vega/chart.rb', line 16
def initialize
@schema = "https://vega.github.io/schema/vega/v5.json"
super()
end
|
Instance Attribute Details
#spec ⇒ Object
Returns the value of attribute spec.
14
15
16
|
# File 'lib/vega/chart.rb', line 14
def spec
@spec
end
|
Instance Method Details
#data!(value) ⇒ Object
21
22
23
24
|
# File 'lib/vega/chart.rb', line 21
def data!(value)
(@spec[:data] ||= []) << data_value(value)
self
end
|
#to_pdf ⇒ Object
35
36
37
|
# File 'lib/vega/chart.rb', line 35
def to_pdf
export("vg2pdf")
end
|
#to_png ⇒ Object
27
28
29
|
# File 'lib/vega/chart.rb', line 27
def to_png
export("vg2png")
end
|
#to_svg ⇒ Object
31
32
33
|
# File 'lib/vega/chart.rb', line 31
def to_svg
export("vg2svg")
end
|