class GerbilCharts::Charts::AreaChart
Area Chart¶ ↑
Draws each model in a shaded area. We use a transparency to show hidden charts. Not the best looking, but has its uses.
Public Class Methods
new(opt={})
click to toggle source
Calls superclass method
# File lib/gerbilcharts/charts/area_chart.rb, line 10 def initialize(opt={}) super(opt) end
Public Instance Methods
create_chart_elements()
click to toggle source
# File lib/gerbilcharts/charts/area_chart.rb, line 14 def create_chart_elements # anchor (line surface) @thechart.create_filter(GerbilCharts::SVGDC::LinearGradientVertical.new("vertgrad","rgb(255,255,255)","rgb(224,224,224)")) # additional filter by name @thechart.create_filter(GerbilCharts::SVGDC::LikeButton.new('LikeButton')) if @gerbilfilter == 'LikeButton' # other elements @thechart.add_child(GerbilCharts::Surfaces::SurfaceBackground.new(:orient => ORIENT_OVERLAY)) @thechart.add_child(GerbilCharts::Surfaces::MarkBand.new(:orient => ORIENT_OVERLAY)) @thechart.add_child(GerbilCharts::Surfaces::BasicGrid.new(:orient => ORIENT_OVERLAY)) # 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::AreaSurface.new(:orient => ORIENT_OVERLAY),:anchor => true) else @thechart.add_child(GerbilCharts::Surfaces::AreaSurface.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::TitlePanel.new(:orient => ORIENT_OVERLAY, :dim => 30)) @thechart.add_child(GerbilCharts::Surfaces::Legend.new(:orient=> ORIENT_OVERLAY, :dim => @legend_width)) @thechart.add_child(GerbilCharts::Surfaces::DetailedLegend.new(:orient=> ORIENT_OVERLAY, :dim => 3*@legend_width)) @thechart.add_child(GerbilCharts::Surfaces::VerticalAxis.new(:orient => ORIENT_WEST, :dim => 40 )) @thechart.add_child(GerbilCharts::Surfaces::HorizontalTimeAxis.new(:orient => ORIENT_SOUTH, :dim => 25 )) end