[82669] branches/gsoc11-statistics/stats-server/app/controllers/ chart_controller.rb
derek at macports.org
derek at macports.org
Thu Aug 18 08:13:31 PDT 2011
Revision: 82669
http://trac.macports.org/changeset/82669
Author: derek at macports.org
Date: 2011-08-17 13:59:13 -0700 (Wed, 17 Aug 2011)
Log Message:
-----------
- Added dataset_empty? method to check if a chart has any data in its dataset
- Added a couple comments
Modified Paths:
--------------
branches/gsoc11-statistics/stats-server/app/controllers/chart_controller.rb
Modified: branches/gsoc11-statistics/stats-server/app/controllers/chart_controller.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/controllers/chart_controller.rb 2011-08-17 20:57:36 UTC (rev 82668)
+++ branches/gsoc11-statistics/stats-server/app/controllers/chart_controller.rb 2011-08-17 20:59:13 UTC (rev 82669)
@@ -8,7 +8,7 @@
set_chart_attribute chart_name, :data, dataset
set_chart_attribute chart_name, :populate, populate_code
end
-
+
# Set the chart's title
def set_chart_title(chart, title)
set_chart_attribute chart, :title, title
@@ -25,14 +25,23 @@
populate.call(chart_name, chart)
end
+ # Get the dataset associate with this chart
def chart_dataset(chart_name)
@charts[chart_name][:data]
end
+ # Check if the chart's dataset is empty
+ def dataset_empty?(chart_name)
+ dataset = chart_dataset(chart_name)
+ return dataset.empty?
+ end
+
+ # Get the title associate with this chart
def chart_title(chart_name)
@charts[chart_name][:title]
end
+ # Get the type of this chart (eg: PieChart, LineChart, etc...)
def chart_type(chart_name)
@charts[chart_name][:type]
end
@@ -50,5 +59,4 @@
attrs[attribute] = value
@charts[chart] = attrs
end
-
-end
\ No newline at end of file
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110818/d6ec9e6c/attachment.html>
More information about the macports-changes
mailing list