Module: PlotSimple::Charts

Defined in:
lib/plot_simple.rb

Defined Under Namespace

Classes: BarChart, PieChart, StackedColumn

Instance Method Summary collapse

Instance Method Details

#chartToXML(chart = nil) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/plot_simple.rb', line 90

def chartToXML(chart = nil)
  chart ||= @chart
  if !chart.template.nil?
    template = "/plot_simple/"+chart.template
    render :partial=>template,:locals=>{:chart=>chart}
  elsif chart.type == "bar"
  render :partial=>"plot_simple/barchartxml",:locals=>{:chart=>chart}
  elsif chart.type == "pie"
    render :partial=>"plot_simple/piechartxml",:locals=>{:chart=>chart}
  elsif chart.type == "stacked"
    render :partial=>"plot_simple/stackedcolumnxml",:locals=>{:chart=>chart}
  end
end