New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82669


Ignore:
Timestamp:
08/17/11 13:59:13 (4 years ago)
Author:
derek@…
Message:
  • Added dataset_empty? method to check if a chart has any data in its dataset
  • Added a couple comments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/stats-server/app/controllers/chart_controller.rb

    r82154 r82669  
    99    set_chart_attribute chart_name, :populate, populate_code 
    1010  end 
    11    
     11     
    1212  # Set the chart's title 
    1313  def set_chart_title(chart, title) 
     
    2626  end 
    2727   
     28  # Get the dataset associate with this chart 
    2829  def chart_dataset(chart_name) 
    2930    @charts[chart_name][:data] 
    3031  end 
    3132   
     33  # Check if the chart's dataset is empty 
     34  def dataset_empty?(chart_name) 
     35    dataset = chart_dataset(chart_name) 
     36    return dataset.empty? 
     37  end 
     38   
     39  # Get the title associate with this chart 
    3240  def chart_title(chart_name) 
    3341    @charts[chart_name][:title] 
    3442  end 
    3543   
     44  # Get the type of this chart (eg: PieChart, LineChart, etc...) 
    3645  def chart_type(chart_name) 
    3746    @charts[chart_name][:type] 
     
    5160    @charts[chart] = attrs 
    5261  end 
    53    
    5462end 
Note: See TracChangeset for help on using the changeset viewer.