class GerbilCharts::Charts::StackedAreaChart

StackedAreaChart

The models are stacked on top of each other !

Public Class Methods

new(opt={}) click to toggle source
Calls superclass method GerbilCharts::Charts::ChartBase::new
# File lib/gerbilcharts/charts/stacked_area_chart.rb, line 8
def initialize(opt={})
  super(opt)
end

Public Instance Methods

create_chart_elements() click to toggle source
# File lib/gerbilcharts/charts/stacked_area_chart.rb, line 12
def create_chart_elements
  
  # other elements
  @thechart.add_child(GerbilCharts::Surfaces::SurfaceBackground.new(:orient => ORIENT_OVERLAY))
  @thechart.add_child(GerbilCharts::Surfaces::StackedGrid.new(:orient => ORIENT_OVERLAY))
  @thechart.add_child(GerbilCharts::Surfaces::TitlePanel.new(:orient => ORIENT_OVERLAY, :dim => 30))

  # timetracker will consume events to  circle datapoints  tooltips
  if @feature_circledatapoints 
      @thechart.add_child(GerbilCharts::Surfaces::Tracker.new(:orient => ORIENT_OVERLAY )) if @feature_timetracker
      @thechart.add_child(GerbilCharts::Surfaces::StackedAreaSurface.new(:orient => ORIENT_OVERLAY),:anchor => true)
  else
      @thechart.add_child(GerbilCharts::Surfaces::StackedAreaSurface.new(:orient => ORIENT_OVERLAY),:anchor => true)
      @thechart.add_child(GerbilCharts::Surfaces::Tracker.new(:orient => ORIENT_OVERLAY )) if @feature_timetracker
  end

  # link pivots
  if @feature_linkpivots
      @thechart.add_child(GerbilCharts::Surfaces::LinkPivots.new(:orient => ORIENT_OVERLAY ))
  end

  @thechart.add_child(GerbilCharts::Surfaces::Legend.new(:orient=> ORIENT_OVERLAY, :dim => @legend_width, :align => :left ))  
  @thechart.add_child(GerbilCharts::Surfaces::DetailedLegend.new(:orient=> ORIENT_OVERLAY, :dim => 3*@legend_width, :align => :left))  
  @thechart.add_child(GerbilCharts::Surfaces::VerticalAxis.new(:orient => ORIENT_WEST, :dim => 40 , :cumulative => true ))
  @thechart.add_child(GerbilCharts::Surfaces::HorizontalTimeAxis.new(:orient => ORIENT_SOUTH, :dim => 25 ))

  # optional features
  if @feature_timetracker
      @thechart.add_child(GerbilCharts::Surfaces::Tracker.new(:orient => ORIENT_SOUTH, :dim => 10 ))
  end
end