Created
May 12, 2011 18:35
-
-
Save tylor/969155 to your computer and use it in GitHub Desktop.
Give yhahn/searchlight_graphael horizontal bar charts, depends on http://drupal.org/node/1155710
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git plugins/searchlight_graphael_box.inc plugins/searchlight_graphael_box.inc | |
index 60116c1..34394c9 100644 | |
--- plugins/searchlight_graphael_box.inc | |
+++ plugins/searchlight_graphael_box.inc | |
@@ -30,6 +30,7 @@ class searchlight_graphael_box extends boxes_box { | |
'#options' => array( | |
'pie' => t('Pie'), | |
'bar' => t('Bar'), | |
+ 'hbar' => t('Horizontal Bar'), | |
'line' => t('Line'), | |
'dot' => t('Dot'), | |
), | |
diff --git searchlight_graphael.module searchlight_graphael.module | |
index 8ba5a33..3aeb022 100644 | |
--- searchlight_graphael.module | |
+++ searchlight_graphael.module | |
@@ -4,7 +4,7 @@ | |
* Build gRaphael graph parameters from a search facet. | |
* | |
* @param string $pie | |
- * The gRaphael method to use. Either 'pie', 'bar', 'line', or 'dot'. | |
+ * The gRaphael method to use. Either 'pie', 'bar', 'hbar', 'line', or 'dot'. | |
* @param string $datasource | |
* The Searchlight datasource to use for faceting. | |
* @param string $environment | |
@@ -48,6 +48,7 @@ function searchlight_graphael_build($method = 'pie', $datasource, $environment = | |
$graph = array('method' => $method, 'values' => array(), 'params' => array(), 'extend' => array()); | |
switch ($method) { | |
case 'bar': | |
+ case 'hbar': | |
foreach ($facets as $item) { | |
$graph['values'][] = (int) $item['count']; | |
$graph['extend']['label']['values'][] = truncate_utf8($item['title'], 30, TRUE, TRUE) . "\n" . $item['count']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment